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
644 stars 107 forks source link

PNG file decoding errors #24

Closed reinhard2 closed 5 years ago

reinhard2 commented 5 years ago

decrypter creates non-working PNG files that cannot be opened Balloon Balloon.zip

Petschko commented 5 years ago

It seems a running gag here to open Issues without providing all information. (See last issues: https://github.com/Petschko/RPG-Maker-MV-Decrypter/issues?q=is%3Aissue+is%3Aclosed )

reinhard2 commented 5 years ago

system.zip Decrypted RPG-Files (1).zip

Systemjson.zip

fed1232cc399d2f7abc1d13940f271ab

Yorna: Monster Girl's Secret by Yeehaw Games 0.7а (hentai) https://yeehaw-games.itch.io/yorna

Petschko commented 5 years ago

It seems it uses an other Layer of encryption as well, there is also additional code in the rpg_core.js which is usually non-existent But didn't find out currently. Thanks for the link, without the whole game I could not help you else

reinhard2 commented 5 years ago

thanks waiting for the decision of problem.

Petschko commented 5 years ago

When I build this project I was not to good with all the File-Header stuff etc, but I played a bit with my HEX-Editor and found out you can just use a standard PNG-Header (on images) to receive the images. No need for any Decryption-Key whatsoever .

The decryption key just has the use to re-encrypt it now, I will implement this into that project, which will allow much easier "decryption" and less failures (should be none at all)

Edit: I was able to view the Files where I added a standard PNG-Header, even in this game

reinhard2 commented 5 years ago

I would like to know when there will be a test version. the program as I understand it decodes the files twice, and not to replace the PNG Header using a HEX Editor. since it is no longer PNG encoding and it does not see other programs. (for game)

Petschko commented 5 years ago

I'm a bit confused what do you want to tell me with your last comment?

I can quickly give you a small form which includes the same as my suggestion to solve. I will post the link inside here~

reinhard2 commented 5 years ago

I mean, just changing the PNG header doesn't work. and the link(program) to address the issue can leave.

fz0000 commented 5 years ago

By the way, the "encryptionKey" in the System.json is "fc1b4dc02a3fe2d0ef4f111e74175c9q" in the latest version(v0.8a) of the game. The last char 'q' looks strange... 🤔

Petschko commented 5 years ago

Usually the Key contains only HEX-Chars, so the "q" is probably not correct?

Maybe the TE gave me older Files, I will re-check this

Petschko commented 5 years ago

So took a big look at this project it seems they using a Plugin named "Options bypass", which changes the encryption key via multiple functions:

function b(string) { // Warn: Unused function
    var string = string; // Warn: Duplicate declaration
    string += "e2b2594f019";
    c(string);
}; // Warn: Unnecessary Semicolon

function c(string) {
    var string = string; // Warn: Duplicate declaration
    string += "43016a41d3";
    d(string);
}; // Warn: Unnecessary Semicolon

function d(string) {
    var string = string.split(/(.{2})/); // Warn: Duplicate declaration
    e(string);
}; // Warn: Unnecessary Semicolon

function e(string) {
    string = string.filter(Boolean);
    f(string);
}

function f(string) {
    Decrypter._encryptionKey = string;
}

I could check this more, but since this is the first game with that I will not invest this further

My IDE tells me its unused, but when I debug the game these functions are called and set the encryption key to: f5e9ce22c51e2b2594f01943016a41d3 - Version 09b

Which works for decrypting!

Aka the key from the System.json is ignored by this game xP

reinhard2 commented 5 years ago

Thanks. good job. function a(string) in file YEP_BattleEngineCore

Petschko commented 5 years ago

I think its just placed randomly in files to avoid people finding them, especially how bad they are written, they look hacked in.

It does not matter since you can find out the string in no time, even if they use 100 different functions

reinhard2 commented 5 years ago

Perhaps this is a temporary encryption while the game is demo. Since the other games from this author were not encrypted generally.

Petschko commented 5 years ago

Yeah that can may be, but it doesn't provide any protection like the normal encryption...

They could even go a step further and store them encrypted on a Web-Server and request them only if the game runs via xhr xD That would make it more complicated but even that would not provide protection. So I don't get the point

reinhard2 commented 5 years ago

But at least it will postpone the hack time, if you use a regular descriptor. Already 2 months have passed before the discovery of the encryption code.