Extracting .bnk container out of .SBP Container (How???)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
rkthelegend
Posts: 56
Joined: Wed Jun 20, 2018 7:57 pm

Extracting .bnk container out of .SBP Container (How???)

Post by rkthelegend »

Topic closed
Last edited by rkthelegend on Fri Jan 14, 2022 6:02 pm, edited 2 times in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Extracting .bnk container out of .SBP Container (How???)

Post by aluigi »

Each entry containing offset and size of the file is encrypted, check the two "DUMMY" fields below:

Code: Select all

. 000000c8 get     DUMMY      0xbb316aa3 4
. 000000cc get     DUMMY      0xc59b254d 4
. 000000d0 get     DUMMY      0x00000001 4
. 000000d4 get     SOME_CRC   0x03c39c18 4
. 000000d8 getdstr NAME       "SND_vo_lvl_pro_s360_002_kra" 56
    53 4e 44 5f 76 6f 5f 6c 76 6c 5f 70 72 6f 5f 73   SND_vo_lvl_pro_s
    33 36 30 5f 30 30 32 5f 6b 72 61 00 00 00 00 00   360_002_kra.....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
    00 00 00 00 00 00 00 00                           ........

The good thing is that all the archived files are BKHD and so you can just dump them by looking for the "BKHD" magic field:

Code: Select all

findloc OFFSET binary "BKHD"
do
    goto OFFSET
    get DUMMY long
    findloc NEXT_OFFSET binary "BKHD" 0 ""
    if NEXT_OFFSET == ""
        get SIZE asize
    else
        math SIZE = NEXT_OFFSET
    endif
    math SIZE -= OFFSET
    log "" OFFSET SIZE
    math OFFSET = NEXT_OFFSET
while NEXT_OFFSET != ""