-
Notifications
You must be signed in to change notification settings - Fork 27
DATA.BIN Encryption
The DATA.BIN file on the Monster Hunter UMDs contains all of the [quests](Quest Encryption), graphics, sounds, dialog, etc. Only Monster Hunter Freedom Unite, Monster Hunter Portable 2nd G and Monster Hunter Portable 3rd encrypt the DATA.BIN and there are a few files that are left unencrypted such as the movies.
###Format The DATA.BIN is a sort of archive that contains files that are aligned to 2KiB blocks. The first file is a table of contents for the remaining files. The table of contents starts out with a list of 2KiB block offsets for each of the remaining files followed by the 2KiB block offset of the end of the DATA.BIN file. You can use the first entry in the table of contents to determine the size of the table of contents.
###Encryption The encryption method for the files in the DATA.BIN file is an XOR cipher followed by a substitution cipher. Each file is encrypted separately so you must seed the XOR cipher with the 2KiB block address at the start of each file. The files that are not encrypted are not indicated in the DATA.BIN, they are stored in the game's executable.
###Game Functions
The retrieval and decryption of files from the DATA.BIN file is handled by a thread named fakeRofsLoader
which controls two other threads with event flags. The thread named transferThread
handles moving the data around and the thread named sha1Thread
handles decrypting the data.