Script to re-encrypt after I've decrypted?

Programming related discussions related to game research
umithink
Posts: 3
Joined: Tue Feb 18, 2020 3:01 am

Script to re-encrypt after I've decrypted?

Post by umithink »

Context: Phoenix Wright: Ace Attorney's sound files (.unity3d) are encrypted with Rijndael. I am able to successfully decrypt the file, modify it, and then I need to encrypt it again so the game will accept it.

I'm using this script (from https://www.zenhax.com/viewtopic.php?f=9&t=11186) to decrypt:

Code: Select all

get NAME filename
encryption Rijndael "\x35\x38\x9A\xFF\xF2\x61\xB3\xE8\x87\x22\x24\x0B\x6B\x0B\x25\xC8" "\x01\x85\x40\xA5\x57\xDE\x8C\x4E\x86\xE4\x23\xE3\x3A\xB9\x77\x84"
get SIZE asize
log NAME 0 SIZE


To re-encrypt what I've decrypted, would I just run the same script on my output file again? (Doesn't seem like that works.) Or are there changes that need to be made to this script to be able to encrypt?
Last edited by umithink on Thu Feb 27, 2020 2:39 pm, edited 1 time in total.
umithink
Posts: 3
Joined: Tue Feb 18, 2020 3:01 am

Re: Script to re-encrypt after I've decrypted?

Post by umithink »

(If this thread would be a better fit under the "Help with QuickBMS & tools" forum, feel free to move this thread there.)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Script to re-encrypt after I've decrypted?

Post by aluigi »

Just add 1 to the "encryption" instruction and it will encrypt the file:

Code: Select all

get NAME filename
encryption Rijndael "\x35\x38\x9A\xFF\xF2\x61\xB3\xE8\x87\x22\x24\x0B\x6B\x0B\x25\xC8" "\x01\x85\x40\xA5\x57\xDE\x8C\x4E\x86\xE4\x23\xE3\x3A\xB9\x77\x84" 1
get SIZE asize
log NAME 0 SIZE
YellowBoiii
Posts: 4
Joined: Tue Jun 22, 2021 8:33 pm

Re: Script to re-encrypt after I've decrypted?

Post by YellowBoiii »

it doesn't work
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Script to re-encrypt after I've decrypted?

Post by aluigi »

Impossible.
It's a simple block-cipher encryption, indeed I already tested it: decrypt + encrypt = original