l_oliveira
Grand Master
On this thread I'll try to explain the approach I use when decrypting games manually.
The target, an American revision of Street Fighter Zero/Alpha3.
I am starting with the encrypted romset, decryption keys (mame can execute the game) and mame debugger.
The first step is discern is the size of the encrypted memory range:
MAME source code is a good start for this. So here's the relevant line:
src/src/mame/machine/cps2crpt.c
{ "sfa3u", { 0xe7bbf0e5,0x67943248 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
So we have:
Keypair -> 0xe7bbf0e5,0x67943248
Encryption range -> 0x100000
Watchdog kick instruction -> // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0 (commented, put on SRC just for documentation reasons)
So we now know the encryption range is 0x100000. Which means 1MB. That's the first two chips.
So now we go to the second step, which is obtain the decrypted code for analysis:
Load the game on MAME debugger and run the following commands:
save sfa3u.bin,0,100000,0
This saves a 1MB file with the contents of the first two ROMs
dasm sfa3ud.asm,0,100000,1,0
This saves a text file with ASM listing for the contents of the first two ROMs in decrypted form. It's mangled in the sense that anything which isn't code are corrupted.
The target, an American revision of Street Fighter Zero/Alpha3.
I am starting with the encrypted romset, decryption keys (mame can execute the game) and mame debugger.
The first step is discern is the size of the encrypted memory range:
MAME source code is a good start for this. So here's the relevant line:
src/src/mame/machine/cps2crpt.c
{ "sfa3u", { 0xe7bbf0e5,0x67943248 }, 0x100000 }, // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0
So we have:
Keypair -> 0xe7bbf0e5,0x67943248
Encryption range -> 0x100000
Watchdog kick instruction -> // 0C80 1C62 F5A8 cmpi.l #$1C62F5A8,D0 (commented, put on SRC just for documentation reasons)
So we now know the encryption range is 0x100000. Which means 1MB. That's the first two chips.
So now we go to the second step, which is obtain the decrypted code for analysis:
Load the game on MAME debugger and run the following commands:
save sfa3u.bin,0,100000,0
This saves a 1MB file with the contents of the first two ROMs
dasm sfa3ud.asm,0,100000,1,0
This saves a text file with ASM listing for the contents of the first two ROMs in decrypted form. It's mangled in the sense that anything which isn't code are corrupted.