CPK

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

CPK

Post by chrrox »

Could you update the quickbms script to handle encrypted toc cpk files?
the xor key is

Code: Select all

5FCBA7B3AF5B77C3FFEB47D34F7B17E39F0BE7F3EF9BB7033F2B87138FBB5723DF4B27332FDBF7437F6BC753CFFB97631F8B67736F1B3783BFAB07930F3BD7A3

this is a sample cpk
https://www.sendspace.com/file/98mmf6
raykingnihong
Posts: 71
Joined: Fri Oct 24, 2014 3:13 pm

Re: CPK

Post by raykingnihong »

chrrox wrote:Could you update the quickbms script to handle encrypted toc cpk files?
the xor key is

Code: Select all

5FCBA7B3AF5B77C3FFEB47D34F7B17E39F0BE7F3EF9BB7033F2B87138FBB5723DF4B27332FDBF7437F6BC753CFFB97631F8B67736F1B3783BFAB07930F3BD7A3

this is a sample cpk
https://www.sendspace.com/file/98mmf6
Hi chrrox, thank you for sharing, can you explain what: game script, once again thank you very much
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: CPK

Post by aluigi »

I guess he means to add the following instruction after 'idstring "CPK "' in the cpk.bms script:

Code: Select all

filexor "0x5F 0xCB 0xA7 0xB3 0xAF 0x5B 0x77 0xC3 0xFF 0xEB 0x47 0xD3 0x4F 0x7B 0x17 0xE3 0x9F 0x0B 0xE7 0xF3 0xEF 0x9B 0xB7 0x03 0x3F 0x2B 0x87 0x13 0x8F 0xBB 0x57 0x23 0xDF 0x4B 0x27 0x33 0x2F 0xDB 0xF7 0x43 0x7F 0x6B 0xC7 0x53 0xCF 0xFB 0x97 0x63 0x1F 0x8B 0x67 0x73 0x6F 0x1B 0x37 0x83 0xBF 0xAB 0x07 0x93 0x0F 0x3B 0xD7 0xA3" 0x10

But I think there is something missing, for example the format is not 100% the original (I tried also to use it against the manually xored file).
chrrox
Posts: 388
Joined: Thu Aug 07, 2014 10:28 pm

Re: CPK

Post by chrrox »

Each table is xored with that key.
you can tell by the 0xFF 00 00 00 flag on unencrypted files vs encrypted files.
If i decrypt the tables. then run quickbms on it its fine.
So whenever the file table gets read it just needs to have the xor applied when the flag is 00 00 00 00.