Twin Matrix
Aug 25 2011, 01:42 AM
When a project is encrypted, how can you overwrite the existing files? Is there a way, maybe through scripting?
Example:
An actor has the character sprite 'Bob'.
I want to place a different version of 'Bob' in Graphics/Characters/, but how can I get the game to use that one instead of the encrypted one?
Example 2:
There's a map with id 004.
I want to place that map file, but updated, in Data/, but how can I get the game to load that instead of the encrypted one?
etc.
Amy Pond
Aug 25 2011, 03:08 AM
Due to the ease of decrypting RPG Maker files several game patching scripts exist. One was made by Yeyinde, I'm not sure where it is though.
As to allowing the game to use files out of the folder - not sure; sounds like a bad idea as then the game would be easy to hack.
Mr. Bump
Aug 25 2011, 05:37 AM
While I agree with Amy Pond about the safeness, I think quite a few developers would like this tool....
CODE
#==============================================================================
# ** Mr. Bump's Unsafe Loading Script
#------------------------------------------------------------------------------
# This script is designed to overwrite the existing files in an encrypted
# game.
#==============================================================================
#--------------------------------------------------------------------------
# * Alias Objects
#--------------------------------------------------------------------------
alias mb_unsafeLoading_load_data load_data unless $@
#--------------------------------------------------------------------------
# * Load_Data ( filename )
#--------------------------------------------------------------------------
def load_data(filename)
# If the file is in the folder
if FileTest.exist?(filename)
# Load the one in the folder
obj = nil
File.open(filename, "rb") { |f|
obj = Marshal.load(f)
}
return obj
# If the file is not in the folder, run as normal
else
return mb_unsafeLoading_load_data(filename)
end
end
In the encrypted game, make sure that the map has the same filename and filepath as the original ( e.g. Data/Map001.rxdata )
Redd
Aug 25 2011, 07:00 AM
Very nice script there Mr. Bump!!
I've stopped caring really about encrypting projects and such, because people can't just decrypt and hack them anyway. However, I DO know that many people are nice and don't hack, and many people are lazy and don't hack. Hacking is like cheating at the game, and I'm a big cheater, so I'm usually okay with it xD Although I don't do it myself. If you look at all commercial games, they have their files out in the open as well, and that is why computer games have so many mods.
I love that script though.
Twin Matrix
Aug 26 2011, 11:31 AM
Thank you so much, Mr. Bump! (Hm, that sounds weird when you say it. ;0) Does it actually overwrite the files in the permanent sense, or does it just load the non-encrypted version?
Anyway, I can imagine it makes the game easier to adjust, but I don't see how it makes it easier to hack (unless perhaps you're using some special encryption method). So I think it'll be fine to use.
Amy Pond
Aug 26 2011, 11:48 AM
QUOTE (Twin Matrix @ Aug 26 2011, 08:31 PM)

Thank you so much, Mr. Bump! (Hm, that sounds weird when you say it. ;0) Does it actually overwrite the files in the permanent sense, or does it just load the non-encrypted version?
Anyway, I can imagine it makes the game easier to adjust, but I don't see how it makes it easier to hack (unless perhaps you're using some special encryption method). So I think it'll be fine to use.

It's as simple as opening up RPG Maker and making your own Map014.rxdata and putting it in the directory instead of the one in the patch.
Twin Matrix
Aug 26 2011, 12:23 PM
Yes, but I meant hacking in the sense of retrieving original files. Not in the sense of adjusting. If someone wants to make a map to get unlimited gold, I really don't mind, that's their choice. But as long as it doesn't make getting my original sprites easier, it's fine with me. (:
Amy Pond
Aug 26 2011, 02:11 PM
Sounds fair enough

I'm sure more could be done eventually with events and call script - but it wouldn't be easier than just downloading one of the programs etc to crack it so that's moot to be honest.
Twin Matrix
Aug 27 2011, 12:59 AM
Yeah. (:
Hm, I wonder where Mr. Bump went to. His only post is in this topic? I sure hope he comes back so I don't end up erasing half my game with test files, lol.
Redd
Aug 27 2011, 06:37 AM
Locking, since you've found your answer!

EDIT: Whoops! Sorry bout that Twin Matrix >.> I've opened your topic for you again
Twin Matrix
Aug 27 2011, 03:45 PM
Thank you! :3 So to recap: if anyone knows if Mr. Bump's script replaces the encrypted files with the 'new' ones permanently or not, that would be great.
Zeriab
Aug 28 2011, 01:49 AM
The default behavior when loading .rxdata files (files containing marshalled ruby objects more generally) is that the game first checks if the file is in the encrypted archive and loads it from there should that be the case. Otherwise it will try to load the file from the file system.
Mr. Bump's script changes this behavior so it first tries to load the file from the file system. If it does not find the file there it tries to load it from the encrypted archive.
This practically means that you can replace Data/Map001.rxdata in the encrypted archive by making a Data folder and saving the new version of Map001.rxdata there. No overwrites will happen. It will simply load that file instead of the one in the encrypted archive.
As for non-encrypted projects or test-playing before you encrypt. It should have no effect as the files are present in the file system.
*hugs*
Twin Matrix
Oct 9 2011, 07:16 AM
Thanks guys, works good. But I guess you can't replace Scripts.rxdata this way or any way if you're playing an encrypted game?
Zeriab
Oct 9 2011, 10:36 AM
You cannot replace Scripts.rxdata with Mr. Bump's script.
You can however insert a section at the very top where you use the unsafe loading script to read the Scripts.rxdata, you decompress the scripts and you run them using eval.
*hugs*
Twin Matrix
Oct 10 2011, 10:13 AM
Woah, woah. That sounds like a
great idea, but how would I execute it? Sorry, from what you said I only know how to use eval.

;
Night5h4d3
Oct 10 2011, 10:48 AM
Theoretically, shouldn't it be possible to marshal dump the project, replace the file, and then re-encrypt it? Though this'd be entirely unsafe. Though I must ask, why would you want the rxdata/rvdata or whatever to be patched into the encrypted rgssad(2)?
*enter's ruby lab*
Twin Matrix
Oct 10 2011, 03:13 PM
Well, so I can give my (beta)testers fixes of the script file without having to give them 100 MB files each time. It's really rather inconvenient to upload these big patches each time a game crashing bug occurs. :c But of course the game needs to be encrypted... Graphics being the most important.
Night5h4d3
Oct 10 2011, 03:20 PM
If you can't trust your beta testers with an unencrypted version of the game, perhaps they're not the best people for the job? Best option would be a script that would take a file, say Scripts.rxdata, encrypt that, so you could send just that; then when the game runs, it'd detect the encrypted file, dencrypt, and then run.
We all (well, all as in those concerned) know the key RMXP uses to encrypt the files, you can use that same key to encrypt the patch file, and then it'll work with the built in 'load_data'
Zeriab
Oct 11 2011, 08:51 AM
Here is an untested idea of how you could do it:
CODE
if FileTest.exist?('Data/Scripts.rxdata')
begin
# Read and load the scripts
scripts = nil;
File.open('Data/Scripts.rxdata', "rb") {
scripts = Marshal.load(file.read)
}
# Remove the first script (This script)
scripts.shift
# Decompress and evaluate the scripts
for tuple in scripts
script = Zlib::Inflate.inflate(tuple[2])
eval(script)
end
# Exit the game since we don't want to run the scripts again
exit
rescue
# Malformed file => Do nothing
end
end
*hugs*
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.