SARC

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

SARC

Post by h3x3r »

Hi there guys i need little help.
How to assign string "as filepath/filename" to a file?
I have made bms script but it use only last string from string table and assign it to all files.
Thank you.

Code: Select all

####################################
get SIGN4 long
idstring "SARC"
get VERSION long
get ENTRYSIZE long
get STRINGTABLE long
math ENTRYSIZE -= STRINGTABLE
math ENTRYSIZE /= 20
math FILES = ENTRYSIZE

for i = 0 < FILES
   get FNAME string
next i

for i = 0 < FILES
   get FILETYPE long
   get OFFSET long
   get SIZE long
   get HASH0 long
   get HASH1 long

if OFFSET == 0
   log FNAME OFFSET 0
else
   log FNAME OFFSET SIZE
endif
next i
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: SARC

Post by aluigi »

You have 2 options:

1) array:

Code: Select all

putarray 0 i FNAME
...
getarray FNAME 0 i


2) multidimensional array:

Code: Select all

get FNAME[i] string
...
log FNAME[i] OFFSET SIZE
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: SARC

Post by h3x3r »

Thank you very much!