Probably not, cause it can still be modified and changed, and is still visible. 🙁
It may deter a fair few folk from trying to figure it out though. 🙂
Interesting. I was not aware that using those functions would be against EULA (it seems to be, in fact, reverse engineering), there's a lot of people who use this technique. But I removed the link, thanks!
Since all the Ruby code must be evaluated inside RPG Maker (legally), I can't think of a 100% safe way to protect your script. It's only a matter of the possible hacker figuring out what you did.
@Andar
Agreed. It's very known over the web that modifying the executable and the original dlls is against the EULA, but this is the first time I see someone bringing up the "reverse engineering" problem. There are several scripts out there breaking these terms.
@Dekita
Thanks for the info! I will take a look 😀
@Tsukihime
Since it's sending data to RPG Maker, can't someone access this data and the used method to verify the launcher?
Here is something you can do to make it a little harder...
Have all your scripts stored in an alternative scripts.rvdata file. Perhaps rename it 'MyScripts' Then put this snippet at the top of your script editor... (above ALL other scripts)
$RGSS_SCRIPTS.clear$RGSS_SCRIPTS = nil$RGSS_SCRIPTS = load_data("Data/MyScripts.rvdata2").inject([]) do |r,i| r << [*i.shift(2),i.first,Zlib::Inflate.inflate(i.shift)]endWhat this does is wipe the $RGSS_SCRIPTS variable before it is properly initialized, then it replaces all the scripts with whatever scripts are contained in the 'MyScripts' file.
This would mean that in order to gain access to see your script, you have to print out all of the scripts individually ~ also, it means that the scripts used for the game are not contained within the script editor, so when hacked open, all they see is the above snippet.
Feel free to tell me how awesome I am for figuring out how they initialize the default scripts ^_^
White-Flute's crypt-EX used the same approach for encrypting their scripts.
Which made it REALLY easy to get the resources because it was pretty obvious what it's doing if I can read the code myself.
Later iterations of their system used a DLL call to initialize the scripts, but the problem here is that everything is still loaded into $RGSS_SCRIPTS, so that doesn't really work.
Yea, i do agree it leaves the resources fairly open for theft, but it would at least hide the scripts from the editor. Could also conceal the code in a common class to try hide it a little more. 🙂
Didnt know whiteflutes system used that approach. Been a while since i even thought of that system. Certainly good info to know though 😀
So their later versions, it evals a string or something to do the same thing as exampled above?
I don't know how the later versions worked.
They eval'ed a string, but the string was just a DLL call and it somehow loaded all the scripts into a ruby variable.
Yea, they likely just returned a string from the dll call. One of Esitroles scripts do this too which leave them really vulnerable, cause you can literally open the dll in notepad and see the code that gets evaled... Not ideal at all :/
but using the above snippet i gave, it would mean that the person hacking would have to firt figure out that the scripts are actually being loaded from elsewhere, then, they have to figure how to make the changes to allow them access to the real scripts. I mean, its not really hard, but I imagine for someone with 0 knowledge of ruby, it could be somewhat tricky. Alternatively, loading a .so that does the above example would make things that bit safer again 😀
The method Dekita suggested is simple but effective. I think people that would steal a script can't code at all - that means they want an easy way get access to other people's scripts, like an one-click "decrypter" (I don't know if this word exists lol). So, if you block them from seeing the scripts by just opening the script editor after a decryption, I would say that your code is safe from a lot of thieves. Also, advanced coders prefer to write their own code. Unless it's very sensitive data, the risk level is manageable.
And we could also embed that extra script file into another file and make a hidden extraction script before it's even loaded... Or maybe even a few "false" methods inserted into the loading scheme would make them shy away more from touching it.
Just don't try to Marshal.dump things as a string, coz it just adds some things to the strings so it's still readable by normal people.