Important information: this site is currently scheduled to go offline indefinitely by December 1st 2023.
If you wish to donate to attempt the preservation of tools and software somewhere else before it goes down, check the GoFundMe

Battle Hearts (*.DAT)

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1716 times

Battle Hearts (*.DAT)

Post 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.
Last edited by Ekey on Sat Jul 21, 2012 3:38 pm, edited 2 times in total.
User avatar
aluigi
VVIP member
VVIP member
Posts: 1916
Joined: Thu Dec 08, 2005 12:26 pm
Location: www.ZENHAX.com
Has thanked: 4 times
Been thanked: 1270 times
Contact:

Re: Battle Hearts (*.DAT)

Post 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
Post Reply