Need help understanding assembly code related to how the savegame file is encrypted using AES

Reading, editing and everything related to the files created by games to contain savegames and configurations
doantuankhoi
Posts: 12
Joined: Fri Mar 06, 2020 4:44 am

Need help understanding assembly code related to how the savegame file is encrypted using AES

Post by doantuankhoi »

Game name: RESTAURANT DASH: GORDON RAMSAY - https://play.google.com/store/apps/deta ... ordondashx
Currently the game has stopped receiving updates and some outfits are now unobtainable even with using real money so I want to figure out how the savegame file and the cache file used to store item drop list and its odds are encrypted to edit them and obtain all the outfits to make a video archiving them. I have done so with one of their earlier games, Diner Dash, but I was lucky because it wasn't encrypted back then: https://www.youtube.com/watch?v=9CaNWUIkNe0
Files I need to decrypt:
save.json: https://drive.google.com/open?id=1ZJuzq ... rNhps1ItSb , https://drive.google.com/open?id=15leGB ... 64qJVjOixm (same account but at different points of saving)
.hptc_kache_glu.gordondashx: https://drive.google.com/open?id=1m3zur ... 43ACnZqi8T
I have tried looking into their game lib (full lib folder: https://drive.google.com/open?id=1DJX3X ... cXUjr_0hsA) and found that the game uses AES-128 and AES-256 to encrypt different kinds of files, with the strings shown here from the libpfgame.so file:
Image
Image
The problem is I don't have any experience in IT so I can't understand what the code means and how to get a key from it. Please help me out, it would help us fans know what the subscription-exclusive items look like since even if we subscribed, it doesn't get us those items anymore and no one has done a video on them :( I have asked for permission from one of the game staff (I'm currently playing their current game, Diner DASH Adventures and got in touch with the devs since I'm a mod of the game's fan-created players' group), shown below here. Unfortunately he can't give me all the items directly now since the game is still being supported so yeah cracking the encryption is the only way to do this :( Thanks for reading this!
Image
P. S. Here's the full game folder with all the files: https://drive.google.com/open?id=1jp8Fu ... yB_RBO2wDB
atom0s
Posts: 250
Joined: Sat Dec 27, 2014 8:49 pm

Re: Need help understanding assembly code related to how the savegame file is encrypted using AES

Post by atom0s »

The save files in this game use Blowfish.
The base key is: Xg8DzT6V9

However, internally it appends 3 more A's to the end of the key if the key length is 9. So the full key is:
Xg8DzT6V9AAA

You can use a site like this to decrypt it:
http://blowfish.online-domain-tools.com/

Set the input type to file, function to BLOWFISH, mode to ECB, and use the above key. The file should decrypt to plain text json.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Need help understanding assembly code related to how the savegame file is encrypted using AES

Post by aluigi »

Code: Select all

encryption "EncryptFinal bf_ecb" "Xg8DzT6V9AAA"
get SIZE asize
get NAME filename
log NAME 0 SIZE