Tool RPGM RPG Maker MV .RPGMV* File Decryptor

TheFapper2

Member
Sep 6, 2017
150
49
May the encryption key is not in the System.json file in that game, if it's "Sensual Samanta" just send me the /www/js/rpg_core.js File, I send you the Key then (may search first in the Topic of the game for the key)
Try Sensual Samantha and get this error. How can I search for the key?

Edit: by your last comment I was capable to found the key. Thanks!
 
  • Like
Reactions: petschko

Iron Man

Newbie
Jun 13, 2017
73
20
I download the game IC in paradise but i can't view the images. I try follow the way from first page but i can't worked it. I can't find encryption key?

sorry on my english
 

Surgy

Member
Modder
Apr 23, 2018
340
1,316
It should work based on what I saw in the source code
Also it is very basic. I was triggered by lack of proper UI. Here is the modified version of that program's base script with some semblance of an UI. I've tested it on game I researched and it actually worked sufficiently well.

edit: the script is now only in the newer topic to avoid confusion with the 2 years old version that was posted here and had an unfixed bug appear in latest Python 3 versions.
 
Last edited:
  • Like
Reactions: malikon and Krull

DS23

New Member
Jun 26, 2017
8
17

Checked, it work fine. Just start program and choose the directory
 
  • Like
Reactions: malikon

malikon

Newbie
Jul 8, 2017
49
21
Hello Everyone :) I have some .png files and i should convert them to .rpgvmp to plug a hole in a game. Can anyone tell me how to do the conversion / ecryption? Thanks a lot, in advance ;)
 

Surgy

Member
Modder
Apr 23, 2018
340
1,316
malikon: due to XOR operation being reversible by itself just see the code from my previous post to understand what to do. The encryption is the same as decryption and the first 16 bytes cut are constant.
 
Last edited:
  • Like
Reactions: malikon

malikon

Newbie
Jul 8, 2017
49
21
malikon: due to XOR operation being reversible by itself just see the code from my previous post to understand what to do. The encryption is the same as decryption and the first 16 bytes cut are constant.
Wow thanks!! I used your decrypter and your suggestions and it worked great! Thank you so much for your precious help!
 

petschko

Newbie
Jan 18, 2017
39
112
Hey,

I just want to mention, I finally had more time... I changed the appearance of the Web-En/Decrypter and also added a new Feature, which doesn't requires the Decryption-Key for Images anymore.
I also want to mention, this was send via E-Mail to me from a person who want to stay anonymous. They pointed to me, that every PNG has the same first 16 bytes, which is true... I wasn't checking this back then, but I implemented this feature now, because I think most people are interested in Images, for sounds-files you can still use the old-decryption method.

The new method just replaces the the first 32 bytes of an "encrypted" PNG with the 16 byte Starting-PNG-Header (89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52).
Every PNG has the same first 16 bytes, so the key isn't needed here anymore, because RPG-Maker-MV just encrypts the first 16 bytes

PS: Sorry for Grave-Digging, but I don't think it makes sense to open a new Topic, so I just wrote here, hope that's fine

Edit: Also I need to rewrite the Java-Decrypter, its messy and doesn't work that well I think... Except there are already good tools, then I would like to link on my page to that tool
 
Last edited:

gue5t

Active Member
Sep 11, 2016
594
1,025
Hey,

I just want to mention, I finally had more time... I changed the appearance of the Web-En/Decrypter and also added a new Feature, which doesn't requires the Decryption-Key for Images anymore.
I also want to mention, this was send via E-Mail to me from a person who want to stay anonymous. They pointed to me, that every PNG has the same first 16 bytes, which is true... I wasn't checking this back then, but I implemented this feature now, because I think most people are interested in Images, for sounds-files you can still use the old-decryption method.

The new method just replaces the the first 32 bytes of an "encrypted" PNG with the 16 byte Starting-PNG-Header (89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52).
Every PNG has the same first 16 bytes, so the key isn't needed here anymore, because RPG-Maker-MV just encrypts the first 16 bytes

PS: Sorry for Grave-Digging, but I don't think it makes sense to open a new Topic, so I just wrote here, hope that's fine

Edit: Also I need to rewrite the Java-Decrypter, its messy and doesn't work that well I think... Except there are already good tools, then I would like to link on my page to that tool
petschko, I wonder what will happen when your new method is applayed on a non PNG image renamed to .png or a malformed PNG file that doesn't start with IHDR chunk? I haven't seen detection for such problems in your code, if there is such code can you point me to it and sorry for missing it.
 

petschko

Newbie
Jan 18, 2017
39
112
gue5t
As far I've seen, there don't exists PNGs without the IHDR-Chunk at the start:
(...) This signature indicates that the remainder of the file contains a single PNG image, consisting of a series of chunks beginning with an IHDR chunk and ending with an IEND chunk.

(...)

A decoder may further verify that the next eight bytes contain an IHDR chunk header with the correct chunk length; this will catch bad transfers that drop or alter null (zero) bytes. (...)
See 3.1:
Also 12.12.

(...) A valid PNG image must contain an IHDR chunk, one or more IDAT chunks, and an IEND chunk. (...)
See:

-------------
So as far I understood the first 16 bytes of all valid PNGs are always the same, if its different it doesn't meet the PNG-Specifications. So if a malformed PNG is thrown in there, the File would be corrupted. But I don't think the game or any other program would show it too, so it wouldn't make sense. Also the new Method can only restore Encrypted .rpgmvp-Files -> PNG-Files, if people have PNGs, they are not meant to be restored anyway (Because they are already PNGs).
RPG-Maker MV only encrypts PNG-Files, so if a Game-Creator would rename a PNG to a JPG, it would be in your folder as original =)
If a JPG was renamed to a PNG some programs can't open it, I'm unsure if even the RPG-Maker engine could handle it (Not tested)... Because it would have the JPG-Header and not a valid PNG-Header, but expecting a PNG~

I could add an optional File-Header verification for to RPG-Maker-MV-Header to the new method (Like in the Decryption). But I would love to keep it optional because the RPG-Maker-MV-File-Header isn't needed for anything than detecting that it is an RPGMMV-Encrypted-File

I hope these information help a little. If something is wrong or other people know more about feel free to correct me or add the missing informations ;)

PS: When rewriting the Java-Tool, I will add more checks (Because it messes with files directly), but in the Web-Version I think there are enough checks/barriers to avoid choosing the wrong files. Usually its bad to rely on HTML-Restrictions, but the whole Web-Version runs client-side, so I can also only use client-side checks (such as limiting File-Input-File-Types)
But when there are ideas suggestion what to implement/check, please let me know~
 
Last edited:

gue5t

Active Member
Sep 11, 2016
594
1,025
petschko, sorry for the confusion. What I meant was a developer using for example a JPG file renamed to .PNG before encrypting the game resulting in a .rpgmvp file that contains a JPG image. I'm attaching one such JPG file here and if you want I can upload the whole game project for testing (RPG Maker MV should be able to use/display any valid image type supported by nodejs or the browser used to run the game). Haven't tested with animated GIF or APNG files tough but JPG and PNG work without a problem. The file encryptionKey is ef093161917087748125e0a8301e8cfb

P.S.
I used malformed PNG file exactly because I have seen few that don't start with IHDR chunk - if I remember correctly they ware exported from a very old version of Adobe Illustrator for MAC according to the meta data in them ...
 

petschko

Newbie
Jan 18, 2017
39
112
Hm I see, yeah it could be possible to add a check for this case, I could check if the ending of the file is either this

"49 45 4E 44 AE 42 60 82" <- PNG-File-Ending

or this

"FF D9" <- JPG-File-Ending

Could also use this check in the normal decryption method to give the correct file-extension on images^^

The Problem is, I can't use the header since its encrypted for detection, so this could be use to sort out JPGs. For JPGs I could output a message, that these have to be decrypted the normal way as always
About the missing IHDR-Chunk I can't tell but these are not valid PNGs, I never seen such an file myself before. It would best to get such a file myself because else I can just guess whats wrong there. Maybe they where also no PNGs but an other format
 
Last edited:

gue5t

Active Member
Sep 11, 2016
594
1,025
I'd suggest just checking for the PNG's IEND chunk and displaying an error message if it not found. I see no point in trying to determine what other type the file is if you need to process it, maybe automatically do the decryption if you have the key.

P.S. Are you sure no software is writing ancillary or private chunks after it?
 

petschko

Newbie
Jan 18, 2017
39
112
gue5t
If there are different PNG headers, the software violates the PNG standards, so I can't imagine any (or any relevant programs) do it (never saw it so far). And if so, the PNG should not have an IEND chuck, since both are connected to each other, either way it could be detected as non-png.

No thats the PNG ending, no data after it is allowed, else its against the PNG standards -

The IEND-Chuck is for programs to know the image ends here (usefull when sending PNG images via network streams for example) - So its always the last data in the PNG

"IHDR must be the first chunk in a PNG image"
and
"IEND is the simplest chunk of all; it contains no data, just indicates that there are no more chunks in the image. IEND is primarily useful when the PNG image is being transferred over the network as a stream, especially when it is part of a larger MNG stream (Chapter 12, "Multiple-Image Network Graphics"). And it serves as one more check that the PNG file is complete and internally self-consistent."

I will build the check for that into it!
 

gue5t

Active Member
Sep 11, 2016
594
1,025
petschko, standards are very good thing as long as everyone follows them but unfortunately we have such "small" companies like Apple and Adobe that are in the habit of ignoring them and plenty of "one man" or small developer teams behind a tool that don't have the knowledge/time to care enough about them ...
 

petschko

Newbie
Jan 18, 2017
39
112
Thats true, but even these usually extra-sausage-companies do the standard-png format as well, if you find Non-Standard PNGs send them and tell me which origin program they have, I didnt saw any so far
 

petschko

Newbie
Jan 18, 2017
39
112
It belongs here, since most PMs are about the decrypter:

If someone has questions to me, don't send me private messages here, because I'm tired of that google captcha! I do not work for free for google, I do not reply on PMs here. Plus I have a pretty bad score on ReCaptcha (means hard captchas), since I value my privacy and google doesnt like that
Send me an E-Mail or open a Ticket on Github. That google captcha is killing me and I told myself not using functions which need that thing, since I usually need 10 minutes to get through, thats not worth my time

If that thing is also needed for login or other actions, I may stop using that site altogether

I post the answer of my last PM public, since its maybe interesting for the public (and i do not need to solve that nightmare):
To Sakrilas :
Hey,

thank you im happy its usefull for you! =)

To use the unencrypted version of a game you just need to do these things:
- File structure MUST be the same as in the Encrypted version (except Images/Audio has now the normal file extension)
- REMOVE these keys & values from the System.json, NOT set them to false/null:

"hasEncryptedImages": true,
"hasEncryptedAudio": true,
"encryptionKey": "xxxx"

Then it should work =)
 
Last edited:

RT_Zinky

Member
Dec 30, 2019
278
253
So what should I do when it seems "encryptionKey": "xxxx" has been purposely removed from the system.json? I tried the script from the pastebin link on the rpg_core.js file and all I get is this error

Error
Uncaught TypeError: Cannot read property "split" of undefined

I can get the images now with the improvements you made to the decrypter, but I'm trying to get my hands on the audio files too.
 

NaorM

New Member
Nov 2, 2019
7
2
Hi petschko first off all i want to Thank you so much for me your'e my Champion :)
I was able to decipher the RPGMVP files of the game A New Dawn To PNG files,
but now i have a few question and i would be happy if you can help please.

After I've decrypted the files, it's possible to delete the RPGMVP files and replace them with the PNG files I received?
I mean if the files I converted won't interfere with the proper operation of the game?
Will the game be able to work properly and smoothly like before the decryption?

T.H.N.K.S. for your work i really appreciate it :)
 
Last edited:

gekk0z

Member
Nov 6, 2017
204
786
The game is "Autumn Boulevard v1 1 Comp". It is a RPGM game. upon inspection, it has a www/img/pictures directory which contains all the *.png CG files. But I am unable to view them.

Please help me, teach me how to view them (like you would view any *.png or *.jpg file)

I have searched the forum and read the threads. was not able to find an answer.

a member petschko did share some hints, but I am not adequate to grasp the solution.

gue5t

So as far I understood the first 16 bytes of all valid PNGs are always the same, if its different it doesn't meet the PNG-Specifications. So if a malformed PNG is thrown in there, the File would be corrupted. But I don't think the game or any other program would show it too, so it wouldn't make sense. Also the new Method can only restore Encrypted .rpgmvp-Files -> PNG-Files, if people have PNGs, they are not meant to be restored anyway (Because they are already PNGs).
RPG-Maker MV only encrypts PNG-Files, so if a Game-Creator would rename a PNG to a JPG, it would be in your folder as original =)
If a JPG was renamed to a PNG some programs can't open it, I'm unsure if even the RPG-Maker engine could handle it (Not tested)... Because it would have the JPG-Header and not a valid PNG-Header, but expecting a PNG~