Page 1 of 1

Battle Hearts (*.DAT)

Posted: Sat Jul 21, 2012 3:15 pm
by Ekey
Finally done :)

Code: Select all

# Battle Hearts (DAT format)
# 
# Written by Ekey (h4x0r)
# http://www.progamercity.net
# 
# Thanks Aluigi
# script for QuickBMS http://quickbms.aluigi.org

set KEY "0x69 0x6F 0x6E 0x30 0x76 0x61 0x73 0x64 0x6E 0x76 0x56 0x6E 0x47 0x72 0x39 0x38 0x35 0x36 0x59 0x69 0x75 0x64 0x68 0x66 0x67 0x66 0x2D 0x38 0x34 0x35 0x2E 0x53"

goto -0x10
get NULLS long
get TABLEOFFSET long
get TABLESIZE long
get VERSION long

goto TABLEOFFSET

for
    filexor KEY NULLS
    get NSIZE byte
    getdstring NAME NSIZE
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE
    savepos TMP
    if TMP == TABLESIZE
  cleanexit
 endif
next
Thx aluigi.

Re: Battle Hearts (*.DAT)

Posted: Sat Jul 21, 2012 3:23 pm
by aluigi
you can make the last part smaller removing filexor "" because doesn't get used and using do while:

Code: Select all

...
do
    filexor KEY NULLS
    get NSIZE byte
    getdstring NAME NSIZE
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE
    savepos TMP
while TMP < TABLESIZE
I know that a "while {} do" would have been better (only in case there are no files at all in the archive) but doesn't exist that command in the bms language