Petschko / RPG-Maker-MV-Decrypter

You can decrypt RPG-Maker-MV Resource Files with this project ~ If you don't wanna download it, you can use the Script on my HP:
https://petschko.org/tools/mv_decrypter/
MIT License
646 stars 107 forks source link

Suggestion for recovering the encryption code #29

Closed monoidic closed 3 years ago

monoidic commented 3 years ago

So, as far as I understand it, the files are formatted like this: Bytes 0-15: RPG Maker MV header. Bytes 16-31: The first 16 bytes of a file XOR-ed with a 16-byte key shared across all files in the game. Bytes 32-...: The rest of the file.

Currently, this project supports recovering PNGs without the key, as well-formed PNGs are guaranteed to have the exact same first 16 bytes (89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52). However, this can easily be leveraged to recover the original XOR key, since plaintext XOR key == ciphertext, but also ciphertext XOR plaintext == key, and we have both the ciphertext (the "encrypted" bytes 16-31 of an encrypted PNG) and the plaintext (those constant first 16 bytes of a PNG). And since the key is shared, users could be directed to decrypt a single .rpgmvp from the game to get the key, which they can use for any of the rest of the files.

Petschko commented 3 years ago

Makes sense, also it could be used to restore the Audio-Files when needed (for example if the user cant get the key from system.json)

Also if the user only uses images/audio files in the decryption input form, it could use an image to detect the key automatically instead of the system.json which got more and more protected by the game-devs over the years.

Petschko commented 3 years ago

Added: https://github.com/Petschko/RPG-Maker-MV-Decrypter/commit/9a05623e13bfaf38358473182df163b61b690bcd