Star Wars: Force Commander (*.rpk)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Star Wars: Force Commander (*.rpk)

Post by Acewell »

Hi i'm making a bms script to extract files from the rpk archives and i can get a full
extraction with what i have here so far but i'm having trouble with the string matching
algorithm and i have reached a point where i can go no further. :(
i have names disabled for now but i think the 2nd table might be the key but not sure.

Code: Select all

# script for QuickBMS http://aluigi.altervista.org/quickbms.htm

idstring "\x52\x6F\x6E\x69\x6E\x20\x50\x61\x6B\x46\x69\x6C\x65\x0D\x0A\x00"
get TBL1_OFF long
goto TBL1_OFF 0 seek_cur
get ZERO long
get NUM_TBL1_ENTRIES long
for i = 0 < NUM_TBL1_ENTRIES
    get NUM long
    get STR_SZ long
    getdstring NAME STR_SZ
next i
goto 0x18 0 seek_cur
get NUM_TBL2_ENTRIES long
for i = 0 < NUM_TBL2_ENTRIES
    getdstring UNK 0x1c
next i
get NUM_TBL3_ENTRIES long
for i = 0 < NUM_TBL3_ENTRIES
    getdstring UNK2 0x18
    get OFFSET long
    get SIZE long
    log "" OFFSET SIZE
next i


any help here regarding name matching is appreciated. :)

here is a smaller sample
fcv1p1.7z
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Star Wars: Force Commander (*.rpk)

Post by aluigi »

Let's recap:
0x284 names
0x30f "entries", biggested referenced ids: 0x310, 0x283 (name) and 0x30f
0x279 files, biggest reference id is 0x310

Maybe the entries in the middle are the directory structure, it starts to be quite painful :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Star Wars: Force Commander (*.rpk)

Post by aluigi »

This is the max I can do:
http://aluigi.org/bms/ronin_pakfile.bms
The duplicate names are probably right because they are meant to be resource names and not files... mah
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: Star Wars: Force Commander (*.rpk)

Post by Acewell »

thank you for the attempt but it breaks on the larger samples.
i think maybe if i stare at it long enough i can figure it out,
i might just try to skip folders and just get file names instead. :)

edit
the duplicate named files are okay i think because they are meant to sit inside different folders.
i think i see the pattern, will update my script when i get it working or i may just use python for this. :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Star Wars: Force Commander (*.rpk)

Post by aluigi »

What you mean with "break"? Does quickbms return an error?