ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sun May 27, 2018 5:29 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed May 09, 2018 1:10 am 
User avatar

Joined: Fri Aug 08, 2014 1:06 am
Posts: 490
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:
# 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
Attachment:
fcv1p1.7z [1.59 MiB]
Downloaded 7 times

_________________
Quickbms.com link thread
Search bms scripts


Top
   
PostPosted: Wed May 09, 2018 2:12 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 8139
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 :)


Top
   
PostPosted: Wed May 09, 2018 2:47 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 8139
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


Top
   
PostPosted: Thu May 10, 2018 5:03 am 
User avatar

Joined: Fri Aug 08, 2014 1:06 am
Posts: 490
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. :)

_________________
Quickbms.com link thread
Search bms scripts


Top
   
PostPosted: Fri May 11, 2018 1:49 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 8139
What you mean with "break"? Does quickbms return an error?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited