Run Sackboy Run! data.pak

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
lemurboy12
Posts: 265
Joined: Fri Oct 17, 2014 2:57 am

Run Sackboy Run! data.pak

Post by lemurboy12 »

http://puu.sh/bVAhR.7z

All of the game's models and textures are in data.pak, and I can't find a script that opens it.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Run Sackboy Run! data.pak

Post by aluigi »

Another "1KAP" archive.
I remember to have seen another one just recently but I have no script for that signature in my archive so, even if I don't remember that other game/archive, I think I had no success with it.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Run Sackboy Run! data.pak

Post by aluigi »

Anyway the following script works:

Code: Select all

idstring "1KAP"
get FILES long
get OFFSET long # for what?
for STOP = 0 == 0
    get DUMMY long
    if DUMMY != 0xffffffff
    if DUMMY u> FILES
        math STOP = 1
    endif
    endif
next

goto -4 0 SEEK_CUR
for i = 0 < FILES
    get NAME_CRC long
    get DUMMY long
    get ZSIZE long
    get SIZE long
    get OFFSET long
    if SIZE == ZSIZE
        log "" OFFSET SIZE
    else
        clog "" OFFSET ZSIZE SIZE   # unknown compression
    endif
next i
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

lemurboy12 wrote:http://puu.sh/bVAhR.7z

All of the game's models and textures are in data.pak, and I can't find a script that opens it.

This game for iOS/Android right? I have not found any links for download.

aluigi wrote:Another "1KAP" archive.
I remember to have seen another one just recently but I have no script for that signature in my archive so, even if I don't remember that other game/archive, I think I had no success with it.

Game from the developers of Little Big Planet. They use encryption (At least as it was on the PS3)
Miles2345
Posts: 76
Joined: Thu Oct 16, 2014 3:05 am

Re: Run Sackboy Run! data.pak

Post by Miles2345 »

The PS3 version is not encrypted, it uses ZLIB. I made a post about it.
lemurboy12
Posts: 265
Joined: Fri Oct 17, 2014 2:57 am

Re: Run Sackboy Run! data.pak

Post by lemurboy12 »

I tried it on the Android version. It gets four files, then it stops.
https://www.dropbox.com/s/taqh2jrkxd5jt ... n.zip?dl=0
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Run Sackboy Run! data.pak

Post by aluigi »

It's not supported.
It seems that it uses encryption or obfuscation because the non-compressed files are all scrambled.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

Well, seems it's simple xor
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Run Sackboy Run! data.pak

Post by aluigi »

Have you dumped the key at object+2068 and key_size at object+2072?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

Empty space or i'm blind -> https://www.sendspace.com/file/jn6pp4

About strange table: I checked 3 version PS, iOS and Android and it always with size 0x400.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

Ok key is dynamic. Key generated by Mersenne Twister algorithm from seed.

dwSeed -> 0xBAFF1EDu
dwKeySize -> 773

Code: Select all

Pak::Archive::Archive(v6, v3, 0xBAFF1EDu, 773);


Simple way :

1) Generate MT State from Seed
2) Copy random bytes from this state

Code: Select all

 
   //Make copy state > from generated state
   _aeabi_memcpy(&MT_State, Pak::GetInitRandState(unsigned int)::state, 2504);

   //Make key
   for ( ; KeySize; --KeySize )
      *(_BYTE *)pKey++ = Pak::GetRand(&MT_State);
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

Here my code based on PseudoCode for generating key. Hope key is valid :)

Code for decrypt -> see below
Last edited by Ekey on Thu Dec 04, 2014 8:58 pm, edited 2 times in total.
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

Okay decryption finished.

PS : See below
Last edited by Ekey on Fri Dec 05, 2014 3:26 pm, edited 1 time in total.
lemurboy12
Posts: 265
Joined: Fri Oct 17, 2014 2:57 am

Re: Run Sackboy Run! data.pak

Post by lemurboy12 »

so what does all this do?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

I written unpacker (supported all version). Hash algorithm is CRC32 but generated hashes from my list is invalid. Any ideas? :?
Last edited by Ekey on Fri Dec 05, 2014 3:27 pm, edited 3 times in total.
lemurboy12
Posts: 265
Joined: Fri Oct 17, 2014 2:57 am

Re: Run Sackboy Run! data.pak

Post by lemurboy12 »

any idea where the model textures are stored in this game?
Ekey
Posts: 1383
Joined: Sat Aug 09, 2014 2:34 pm

Re: Run Sackboy Run! data.pak

Post by Ekey »

Check the files manually until a hash algorithm is not clear
lemurboy12
Posts: 265
Joined: Fri Oct 17, 2014 2:57 am

Re: Run Sackboy Run! data.pak

Post by lemurboy12 »

I don't know what that is
lemurboy12
Posts: 265
Joined: Fri Oct 17, 2014 2:57 am

Re: Run Sackboy Run! data.pak

Post by lemurboy12 »

http://puu.sh/e1xV1.zip

The game had a new update and the script doesn't work on it anymore. This is for the iOS version.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Run Sackboy Run! data.pak

Post by aluigi »

Am I wrong or is it obfuscated now?