# Scripts

Source: http://aluigi.altervista.org/quickbms.htm
Script:
filexor "\xed\xb9\xb6\x06\x05\xa9\x9a\x30\xc8\xa9\xd3\xae\x67\x0e\x93\x54\x63\x96\x87\xb8\xe9\xe1\x06\xe2\x46\x97\xd1\xce\xc4\x06\x1d\x4f\x63\xcb\x80\xb7\x79\x65\x9e\xe0\xc5\x0a\x92\x5c\x6c\xbf\x56\xbf\x6d\x2d\x5a\x70\xe5\x7a\x4b\x86\x26\xb7\x31\xa7\xf0\x5e\x87\xe1\x44\xd0\x0f\x90\x9f\xa5\x37\x73\x8b\x92\x05\x3a\x21\x4a\x3a\x34\xe7\x09\xd6\x04\x58\xab\xc9\x83\x53\xd2\xa8\xe2\x10\x26\x38\x72\x98\x6e\x2a\xfa\x00\x91\xaa\xd3\x22\xea\xf3\xae\x0e\xd7\x88\x9a\xd8\xd3\xc3\xde\xc9\x9d\xc5\xbf\xd6\x90\xfe\xe9\xad\x84\x76\xe9\x68\x4d\x9b\x5e\x23\x53\x42\xe6\x92\xba\x23\x21\xbc\x90\x89\xdb\x49\x32\xe9\x65\xc0\x77\x8a\x24\xb6\x9b\xfb\x23\x4e\xa0\x8a\x2e\xbb\x16\x28\x22\x90\x10\x46\x96\xe3\xa9\x5e\xfc\xb2\x9b\x82\xde\x41\xcf\x10\x01\xc5\x62\x5f\x99\xfb\x98\x66\xf8\x7b\xa3\xbc\x29\x9a\x71\x9a\xb0\xd0\xf3\xfd\xc9\x1e\x5f\x6c\xa5\x78\x20\xbe\x8b\xc8\x51\xff\x1a\x61\x86\x8b\x05\xae\x32\x09\xd0\xbc\xb5\x53\xc2\x0c\x05\xb8\x6e\x6a\x21\xb0\x69\x4b\x85\x15\x86\x97\x48\x84\xca\xe6\x61\x7f\x18\x1b\x0a\x57\x52\xd6\x0f\xaa\x13\x9a\xfd\x99\xe1"
get SIZE asize
get NAME basename
string NAME += ".xml"
log NAME 0 SIZE


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring DUMMY 260
getdstring SIGN 32
math PKG_OLD = -1
get FULLSIZE asize
do
    get DUMMY long
    get OFFSET long
    get DUMMY long
    get ZSIZE long
    getdstring DUMMY 0x28
    get SIZE long
    getdstring NAME2 260
    getdstring NAME 260
    get DUMMY long
    get PKG long
    get DUMMY long
    if PKG != PKG_OLD
        string PKG_NAME p= "pkg%03d.pkg" PKG
        open FDSE PKG_NAME 1
        math PKG_OLD = PKG
    endif
    string NAME += NAME2
    clog NAME OFFSET ZSIZE SIZE 1
    savepos CURR
while CURR < FULLSIZE


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzss
get VER long
if VER == 0
    endian big
endif
get INFO_SIZE long
get FILES long
get INFO_OFF long
goto INFO_OFF

get DUMMY long
get OFFSET long
for i = 0 < FILES
    get ZIP long
    get OFFSET long
    get ZSIZE long
    if VER != 0
        get SIZE long
    endif
    get CRC long
    if ZIP == 0
        log "" OFFSET ZSIZE
    else
        #if VER == 0
            savepos TMP
            goto OFFSET
            get SIZE long
            goto TMP
        #endif
        math OFFSET += 4    # SIZE again
        math ZSIZE -= 4
        clog "" OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "PAK "
get FILES long
get INFO_LIMIT long
get DUMMY long

for i = 0 < FILES
    get OFFSET long
    get SIZE long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get NAME string

    savepos TMP
    do
        if TMP & 7
            math TMP += 1
        endif
    while TMP & 7
    goto TMP

    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.4.6
getdstring SIGN 4
if SIGN == KCAP
    endian big
elif SIGN == PACK
    endian little
else
    cleanexit
endif
get DUMMY long
get FILES long

math INFO_OFF = FILES
math INFO_OFF *= 0x120
math INFO_OFF n= INFO_OFF
goto INFO_OFF 0 SEEK_END

for i = 0 < FILES
    getdstring NAME 0x100
    get SIZE long
    get ZSIZE long
    get OFFSET long
    get ZIP long
    getdstring DUMMY 16
    if ZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring SGMF
get DUMMY short
get FILES long
get CHUNKS long
get DUMMY long
get DUMMY long

savepos NAME_OFF
math INFO_OFF == FILES
math INFO_OFF *= 0x58
math INFO_OFF += NAME_OFF

print "wait the unpacking of the pak filesystem in the TEMPORARY_FILE"

log TEMPORARY_FILE 0 0
append
for i = 0 < CHUNKS
    goto INFO_OFF
    get DUMMY long
    get TYPE long
    get OFFSET long
    savepos INFO_OFF

    goto OFFSET
    get ZSIZE long
    savepos OFFSET
    if TYPE == 0
        log TEMPORARY_FILE OFFSET ZSIZE
    elif TYPE == 1
        comtype lzo1x
        clog TEMPORARY_FILE OFFSET ZSIZE 0x8000
    elif TYPE == 4
        comtype rlew
        clog TEMPORARY_FILE OFFSET ZSIZE 0x8000
    else
        print "unknown chunk type %TYPE%"
        cleanexit
    endif
next i
append

open "." TEMPORARY_FILE 1

goto NAME_OFF
for i = 0 < FILES
    getdstring NAME 0x50
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE 1
next i

print "remember to remove the file called TEMPORARY_FILE from the output folder!"


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "AKPK"
get SIZE long
get DUMMY long
get SIZE long
getdstring DUMMY SIZE
get NAME unicode
get DUMMY long
get FILES long
for i = 0 < FILES
    get DUMMY long
    get DUMMY long
    get SIZE longlong
    get OFFSET longlong
    log "" OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get DUMMY long
get FILES long
math OFFSET = FILES
math OFFSET *= 20
math OFFSET += 8
goto OFFSET
get SIZE long
math OFFSET += 4
log MEMORY_FILE OFFSET SIZE
math OFFSET += SIZE
goto OFFSET
get ENTRIES long
savepos OFFSET
math SIZE = ENTRIES
math SIZE *= 4
log MEMORY_FILE2 OFFSET SIZE
goto 8
for i = 0 < FILES
    get OFFSET long
    get NAME_OFF long
    get FOLDER_OFF long
    get SIZE long
    get DUMMY long

    math NAME_OFF *= 4
    goto NAME_OFF MEMORY_FILE2
    get NAME_OFF long MEMORY_FILE2
    goto NAME_OFF MEMORY_FILE
    get NAME1 string MEMORY_FILE

    math FOLDER_OFF *= 4
    goto FOLDER_OFF MEMORY_FILE2
    get FOLDER_OFF long MEMORY_FILE2
    goto FOLDER_OFF MEMORY_FILE
    get NAME string MEMORY_FILE

    string NAME += /
    string NAME += NAME1

    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
set MEMORY_FILE2 binary "\x55\x89\xe5\x56\x8b\x75\x10\x53\x8b\x55\x08\x8b\x4d\x0c\xd1\xee\x74\x23\x31\xc0\x69\xd2\xfd\x43\x03\x00\x81\xc2\xc3\x9e\x26\x00\x89\xd3\xc1\xeb\x10\x66\x81\xe3\xff\x7f\x66\x31\x1c\x41\x83\xc0\x01\x39\xc6\x77\xdf\x5b\x5e\x5d\xc3"

getdstring SIGN 32
set SIGN unicode SIGN
string SIGN -= -13
if SIGN != "Resource File"
    cleanexit
endif

get FULLSIZE asize
for NEXT = 0x404 < FULLSIZE
    goto NEXT
    math OFFSET = NEXT
    get TYPE long
    get FILES long
    get ZSIZE long
    get SIZE long
    get NEXT long
    math OFFSET -= ZSIZE

    # type & 4 uses a compressed container
    # instead of single compressed files

    if SIZE != 0
        if TYPE & 4
            math OFFSET -= 8
        endif
        log MEMORY_FILE OFFSET ZSIZE
        if TYPE & 2
            calldll MEMORY_FILE2 0 cdecl "" 666666 MEMORY_FILE ZSIZE
        endif
        if TYPE & 1
            clog MEMORY_FILE 0 ZSIZE SIZE MEMORY_FILE
        endif

        if TYPE & 4
            math TMP = OFFSET
            math TMP += ZSIZE
            goto TMP
            get ZSIZE long
            get SIZE long
            math OFFSET -= ZSIZE
            log MEMORY_FILE4 OFFSET ZSIZE
            if TYPE & 2
                calldll MEMORY_FILE2 0 cdecl "" 666666 MEMORY_FILE4 ZSIZE
            endif
            if TYPE & 1
                clog MEMORY_FILE4 0 ZSIZE SIZE MEMORY_FILE4
            endif
        endif

        for i = 0 < FILES
            getdstring NAME 0x208 MEMORY_FILE
            set NAME unicode NAME
            get OFFSET long MEMORY_FILE
            get ZSIZE long MEMORY_FILE
            get SIZE long MEMORY_FILE
            get CRC long MEMORY_FILE
            get ZERO long MEMORY_FILE
            if TYPE & 4
                log MEMORY_FILE3 OFFSET ZSIZE MEMORY_FILE4
            else
                log MEMORY_FILE3 OFFSET ZSIZE
                if TYPE & 2
                    calldll MEMORY_FILE2 0 cdecl "" 666666 MEMORY_FILE3 ZSIZE
                endif
                if TYPE & 1
                    clog MEMORY_FILE3 0 ZSIZE SIZE MEMORY_FILE3
                endif
            endif
            log NAME 0 SIZE MEMORY_FILE3
        next i
    endif
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype deflate_noerroropen FDDE "idx" 0open FDDE "dat" 1get DUMMY shortget DUMMY byteget FILES longget DUMMY longfor i = 0 < FILES    get CRC long    get ZSIZE long    get SIZE long    get OFFSET long    get ZIP byte    if ZIP == 0        log "" OFFSET SIZE 1    else        math OFFSET += 10        math ZSIZE -= 10        clog "" OFFSET ZSIZE SIZE 1    endifnext i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "ATG CORE CEMENT LIBRARY"
goto 0x24
get OFFSET long
if OFFSET u>= 0x01000000
    reverselong OFFSET
    endian big
endif
get INFOSZ long
get NAMES_OFF long
get NAMES_SIZE long
get DUMMY long
get FILES long

goto OFFSET
for i = 0 < FILES
    get CRC long
    get OFFSET long
    get SIZE long
    putarray 0 i OFFSET
    putarray 1 i SIZE
next i

# OFFSET sorting
math TMP = FILES
math TMP -= 1
for i = 0 < TMP
    getarray OFFSET 0 i
    math j = i
    for j += 1 < FILES
        getarray OFFSET2 0 j
        if OFFSET2 < OFFSET
            getarray SIZE  1 i
            getarray SIZE2 1 j
            putarray 0 i OFFSET2
            putarray 1 i SIZE2
            putarray 0 j OFFSET
            putarray 1 j SIZE
            math OFFSET = OFFSET2
        endif
    next j
next i

goto NAMES_OFF
endian little
get DUMMY long
get DUMMY long
for i = 0 < FILES
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get NAMESZ long
    math NAMESZ -= 1
    getdstring NAME NAMESZ
    get DUMMY long

    getarray OFFSET 0 i
    getarray SIZE 1 i
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "PACK"
get OFFSET long
get FILES long
math FILES /= 0x40
goto OFFSET
for i = 0 < FILES
    getdstring NAME 0x38
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get BASE_NAME basename
string BASE_NAME += /
comtype deflate
endian big
getdstring SIGN 4
if SIGN == "segs"
    get DUMMY short
    get CHUNKS short
    get FULL_SIZE long
    get FULL_ZSIZE long
    putvarchr MEMORY_FILE 0 FULL_SIZE
    log MEMORY_FILE 0 0
    append
    for i = 0 < CHUNKS
        get ZSIZE short
        get SIZE short
        get OFFSET long
        math OFFSET -= 1
        if SIZE == 0
            math SIZE = 0x00010000
        endif
        clog MEMORY_FILE OFFSET ZSIZE SIZE
    next i
    append
else
    # pfd
    get SIZE asize
    log MEMORY_FILE 0 SIZE
endif

# the files are just compressed pfd files
# so we handle them here automatically (both!)

goto 0 MEMORY_FILE
get FULL_SIZE asize MEMORY_FILE
endian little
getdstring TYPE 4 MEMORY_FILE
if TYPE == ""   # pfd
    get DUMMY long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    get FILES long MEMORY_FILE
    savepos BASE_OFF MEMORY_FILE
    for BASE_OFF = BASE_OFF < FULL_SIZE
        get HEADDATA_SIZE long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get DUMMY long MEMORY_FILE
        get DUMMY long MEMORY_FILE
        get NAME string MEMORY_FILE
        math OFFSET += BASE_OFF
        set FNAME string BASE_NAME
        string FNAME += NAME
        log FNAME OFFSET SIZE MEMORY_FILE
        math BASE_OFF += HEADDATA_SIZE
        goto BASE_OFF MEMORY_FILE
    next
elif TYPE == "FPAC"
    endian big
    get BASE_OFF long MEMORY_FILE
    get TOT_SIZE long MEMORY_FILE
    get FILES long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    for i = 0 < FILES
        getdstring NAME 20 MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get DUMMY long MEMORY_FILE
        math OFFSET += BASE_OFF
        set FNAME string BASE_NAME
        string FNAME += NAME
        log FNAME OFFSET SIZE MEMORY_FILE
    next i
else
    get NAME basename
    get EXT extension
    string NAME += "_unpacked."
    string NAME += EXT
    set FNAME string BASE_NAME
    string FNAME += NAME
    log FNAME 0 FULL_SIZE MEMORY_FILE
endif

print "\nyou can try to reuse this script with the output files (pac, pfd and so on)\nfor extracting the other files contained in them"


Source: http://aluigi.altervista.org/quickbms.htm
Script:
endian big
comtype deflate
idstring "FbRB"
get SIZE long
savepos OFFSET
set MEM_FILE long 1
callfunction gzip_fbrb_sux

math OFFSET += SIZE
get SIZE asize
math SIZE -= OFFSET
goto OFFSET
set MEM_FILE long 2
callfunction gzip_fbrb_sux

get VER long MEMORY_FILE
get INFO_OFF long MEMORY_FILE
savepos NAME_BASE MEMORY_FILE
math INFO_OFF += NAME_BASE
goto INFO_OFF MEMORY_FILE
get FILES long MEMORY_FILE
for i = 0 < FILES
    get NAMEOFF long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get XSIZE long MEMORY_FILE
    get NAMESZ long MEMORY_FILE

    savepos TMP MEMORY_FILE
    math NAMEOFF += NAME_BASE
    goto NAMEOFF MEMORY_FILE
    #getdstring NAME NAMESZ MEMORY_FILE
    get NAME string MEMORY_FILE
    goto TMP MEMORY_FILE

    log NAME OFFSET SIZE MEMORY_FILE2
next i

# fbrb sux, it specifies a wrong size for the gzip file in some archives (like ondemand_awards-00.fbrb)
# so when QuickBMS goes at its end to find the uncompressed size field it finds a zero... bad
startfunction gzip_fbrb_sux
    savepos TMP_OFF
    endian little
    get GZIP_SIGN short
    if GZIP_SIGN == 0x8b1f
        get CM byte
        get FLAGS byte
        get MTIME long
        get XFL byte
        get OS byte
        if FLAGS & 4
            get TMP short
            getdstring TMP TMP
        endif
        if FLAGS & 8
            get TMP string
        endif
        if FLAGS & 16
            get TMP string
        endif
        if FLAGS & 2
            get TMP short
        endif
        savepos TMP
        math SIZE += OFFSET
        math SIZE -= 4  # uncompressed size
        goto SIZE
        get XSIZE long
        math SIZE -= TMP
        if XSIZE < SIZE # so also if it's 0
            math XSIZE = SIZE
            math XSIZE *= 12    # enough?
        endif
        if MEM_FILE == 1
            clog MEMORY_FILE TMP SIZE XSIZE
        else
            clog MEMORY_FILE2 TMP SIZE XSIZE
        endif
    else
        if MEM_FILE == 1
            log MEMORY_FILE OFFSET SIZE
        else
            log MEMORY_FILE2 OFFSET SIZE
        endif
    endif
    goto TMP_OFF
    endian big
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype unzip_dynamic
getdstring SIGN 4
if SIGN == "KAPT"
    math TYPE = 0
elif SIGN == "TPAK"
    math TYPE = 1
else
    print "invalid signature (%SIGN%)"
    cleanexit
endif
get VERSION long
if TYPE != 0
    get DUMMY long
endif
get FILES long

if VERSION >= 4
    get DUMMY long
endif

get NAMETABLESZ long
get NAMETABLESZZ long
if TYPE == 0
    get DUMMY long
endif
savepos OFFSET
log MEMORY_FILE OFFSET NAMETABLESZZ
putvarchr MEMORY_FILE 0 0x78
putvarchr MEMORY_FILE 1 0x9c
clog MEMORY_FILE2 0 NAMETABLESZZ NAMETABLESZ MEMORY_FILE

math OFFSET += NAMETABLESZZ
if TYPE != 0
    math OFFSET x= 4
endif
goto OFFSET

if TYPE != 0
    for i = 0 < FILES
        get DUMMY long
    next i
    get TMP long
    for i = 0 < TMP
        get DUMMY long
    next i
endif

get FILETABLESZ long
get FILETABLESZZ long
savepos OFFSET
log MEMORY_FILE OFFSET FILETABLESZZ
putvarchr MEMORY_FILE 0 0x78
putvarchr MEMORY_FILE 1 0x9c
clog MEMORY_FILE3 0 FILETABLESZZ FILETABLESZ MEMORY_FILE

math OFFSET += FILETABLESZZ
if TYPE != 0
    math OFFSET x= 4
endif
goto OFFSET
savepos BASE_OFFSET

comtype zlib
for i = 0 < FILES
    get SIZE long MEMORY_FILE3
    get ZSIZE long MEMORY_FILE3
    if TYPE == 0
        get OFFSET long MEMORY_FILE3
        get NAMEOFF long MEMORY_FILE3
        get NAMESZ long MEMORY_FILE3
        get ZIP long MEMORY_FILE3
    else
        get ZIP long MEMORY_FILE3
        get OFFSET long MEMORY_FILE3
        get NAMEOFF long MEMORY_FILE3
        math NAMEOFF -= 4
        if ZIP != -1
        if SIZE == ZSIZE
            math ZIP = 0
        endif
        endif
    endif
    getdstring TIMESTAMP 8 MEMORY_FILE3

    goto NAMEOFF MEMORY_FILE2
    if TYPE != 0
        get NAMESZ long MEMORY_FILE2
    endif
    getdstring NAME NAMESZ MEMORY_FILE2

    math OFFSET += BASE_OFFSET

    math CL == NAMESZ
    math DL == NAMESZ
    math DL %= 5
    math DL += i
    for j = 0 < NAMESZ
        getvarchr BYTE NAME j
        math BL == j
        math BL += CL
        math BL += BL
        math BL += DL
        math BYTE ^= BL
        putvarchr NAME j BYTE
    next j

    if ZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
goto 0x10
get DUMMY short
if DUMMY == 0
    endian big
endif
goto 0

get PACK_SIZE asize
getdstring SIGN 8
if SIGN == "AsuraCmp"
    get ZSIZE long
    get SIZE long
    math ZSIZE = PACK_SIZE
    math ZSIZE -= 8
    comtype huffboh
    clog TEMPORARY_FILE 8 ZSIZE SIZE
    open "." TEMPORARY_FILE
    get PACK_SIZE asize
    getdstring SIGN 8
elif SIGN == "AsuraZlb"
    get ZERO long
    get ZSIZE long
    get SIZE long
    savepos OFFSET
    math ZSIZE = PACK_SIZE
    math ZSIZE -= OFFSET
    comtype zlib
    clog TEMPORARY_FILE OFFSET ZSIZE SIZE
    open "." TEMPORARY_FILE
    get PACK_SIZE asize
    getdstring SIGN 8
endif
if SIGN != "Asura   "
    cleanexit
endif

for x = 0
    savepos CHUNK_OFFSET
    math TMP = CHUNK_OFFSET
    math TMP += 16
    if TMP >= PACK_SIZE
        cleanexit
    endif
    get CHUNK long
    string CHUNK = CHUNK
    get CHUNKSZ long
    get DUMMY long
    get DUMMY long
    if CHUNK == "RSCF"
        get TYPE long
        get DUMMY long
        get SIZE long
        get NAME string
        math OFFSET = CHUNK_OFFSET
        math OFFSET += CHUNKSZ
        math OFFSET -= SIZE
        log NAME OFFSET SIZE
    elif CHUNK == "ASTS"
        get FILES long
        for i = 0 < FILES
            callfunction padded_name 1
            get DUMMY byte
            get SIZE long
            get OFFSET long
            log NAME OFFSET SIZE
        next i
    else
        savepos OFFSET
        math SIZE = CHUNK_OFFSET
        math SIZE += CHUNKSZ
        math SIZE -= OFFSET
        set NAME string CHUNK
        string NAME += "_chunk/"
        string NAME += x
        string NAME += ".dat"
        log NAME OFFSET SIZE    # comment here if you don't want to extract these useless chunks
    endif
    math CHUNK_OFFSET += CHUNKSZ
    goto CHUNK_OFFSET
next x

startfunction padded_name
    set NAME string ""
    set NAME_POS long 0
    do
        get DUMMY long
        string NAME += "PADD"
        putvarchr NAME NAME_POS DUMMY long
        math NAME_POS += 4
        strlen NAMESZ NAME
    while NAMESZ >= NAME_POS
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "PAK\x01"
get INFO_OFF long
get INFO_SIZE long
get INFO_ZSIZE long
clog MEMORY_FILE INFO_OFF INFO_ZSIZE INFO_SIZE

get FILES long MEMORY_FILE
for i = 0 < FILES
    get NAMESZ long MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    math SIZE -= OFFSET
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
endian big
get HEAD_SIZE long
if HEAD_SIZE == 0
    get FULLSIZE long
    math SIZE = 65536

    log TEMPORARY_FILE 0 0
    for TOT = 0 < FULLSIZE
        get ZSIZE long
        savepos OFFSET
        if ZSIZE == SIZE
            log MEMORY_FILE OFFSET SIZE
        else
            clog MEMORY_FILE OFFSET ZSIZE SIZE
        endif
        math OFFSET += ZSIZE
        goto OFFSET
        math TOT += SIZE
        if TOT > FULLSIZE
            math TOT -= SIZE
            math SIZE = FULLSIZE
            math SIZE -= TOT
            math TOT += SIZE
        endif
        append
        log TEMPORARY_FILE 0 SIZE MEMORY_FILE
        append
    next

    open "." TEMPORARY_FILE
    get HEAD_SIZE long
    math MINIME = 1
else
    get DUMMY long
    get FULLSIZE asize
    math MINIME = 0
endif
get DUMMY long
get DUMMY long
get START long
math START += 4
goto START
math FILES = HEAD_SIZE
math FILES -= START

if MINIME == 0
    math FILES /= 12
    for i = 0 < FILES
        get CRC long
        get OFFSET long
        get SIZE long
        log "" OFFSET SIZE
    next i
else
    math FILES /= 8
    get CRC long
    get OFFSET long
    for i = 1 <= FILES
        if i < FILES
            get CRC long
            get SIZE long
        else
            math SIZE = FULLSIZE
        endif
        math SIZE -= OFFSET
        log "" OFFSET SIZE
        math OFFSET += SIZE
    next i
endif


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring SIGN 4
if SIGN == "2KAP"
elif SIGN == "PAK2"
    comtype xmemdecompress
    endian big
else
    cleanexit
endif

get VERSION long
get MYALIGN long
goto 0x38
get NAMES_SIZE long
if NAMES_SIZE == 0
    goto MYALIGN
    get NAMES_SIZE long
endif

savepos OFFSET
encryption xor "VXo40j3@$%\\%`x"
log MEMORY_FILE OFFSET NAMES_SIZE
encryption "" ""
math OFFSET += NAMES_SIZE
math OFFSET x= MYALIGN
goto OFFSET

get FILES long
get DUMMY long
get DUMMY long
for i = 0 < FILES
    get NAME_OFF long
    get DUMMY long
    get SIZE long
    get TIMESTAMP longlong
    get OFFSET longlong
    if SIGN == "2KAP"
        if VERSION >= 2
            get DUMMY long
            get ZSIZE long
        endif
    endif
    get ZERO long
    if ZERO == 0
        getdstring DUMMY 0x18
    endif

    if OFFSET != -1
        math OFFSET *= MYALIGN
        savepos TMP
        goto OFFSET

        if SIGN == "PAK2"
            get ZSIZE long
            #math ZSIZE -= 4    # ???
            savepos OFFSET
            get DUMMY long
            if DUMMY == 0x10000
                get ZSIZE long
            else
                goto OFFSET
            endif
        else
            get DUMMY long
            if DUMMY == 0x10000
                comtype unzip_dynamic   #deflate
                get ZSIZE long
            else
                comtype unzip_dynamic   #zlib
                goto OFFSET
                if VERSION <= 1
                    get ZSIZE long
                endif
            endif
        endif

        savepos OFFSET
        goto TMP

        goto NAME_OFF MEMORY_FILE
        get NAME string MEMORY_FILE

        math TMP = ZSIZE
        math TMP x= MYALIGN

        if SIZE == TMP
            log NAME OFFSET SIZE
        elif SIZE == ZSIZE
            log NAME OFFSET SIZE
        else
            if i == 0
            if SIGN == "PAK2"
                comtype zlib_noerror
                clog MEMORY_FILE3 OFFSET ZSIZE SIZE
                get XSIZE asize MEMORY_FILE3
                if XSIZE < SIZE
                    comtype xmemdecompress
                else
                    comtype unzip_dynamic   #zlib
                endif
            endif
            endif
            clog NAME OFFSET ZSIZE SIZE
        endif
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.3.12get PAK_SIZE asizeget VER longget DUMMY longget SIGN longif SIGN == 0x43344334   # C4C4    # endian littleelif SIGN == 0x34433443 # 4C4C    endian bigelse    cleanexitendifget INFO_SIZE longsavepos INFO_OFFlog MEMORY_FILE INFO_OFF INFO_SIZEget MEM_SIZE asize MEMORY_FILEmath BASE_OFF = INFO_OFFmath BASE_OFF += INFO_SIZEset PATH string ""set NAME string ""get DUMMY long MEMORY_FILEget DUMMY long MEMORY_FILEget DUMMY long MEMORY_FILEget OFFSET1 long MEMORY_FILEget OFFSET2 long MEMORY_FILEsavepos OFFSET MEMORY_FILEcallfunction extractstartfunction extract    if OFFSET != 0    if OFFSET < MEM_SIZE        goto OFFSET MEMORY_FILE        get OFFSET1 long MEMORY_FILE        get OFFSET2 long MEMORY_FILE        get OFFSET3 long MEMORY_FILE        get OFFSET4 long MEMORY_FILE        get NAME string MEMORY_FILE        set OLD_PATH string PATH        string PATH += NAME        string PATH += /        math OFFSET = OFFSET3        callfunction extract2        math OFFSET = OFFSET4        callfunction extract        set PATH string OLD_PATH        math OFFSET = OFFSET1        callfunction extract        math OFFSET = OFFSET2        callfunction extract    endif    endifendfunctionstartfunction extract2    if OFFSET != 0    if OFFSET < MEM_SIZE        goto OFFSET MEMORY_FILE        get OFFSET1 long MEMORY_FILE        get OFFSET2 long MEMORY_FILE        callfunction extract_type 1        get OFFSET3 long MEMORY_FILE        math OFFSET = OFFSET1        callfunction extract2        math OFFSET = OFFSET2        callfunction extract2        math OFFSET = OFFSET3        callfunction extract3    endif    endifendfunctionstartfunction extract3    if OFFSET != 0    if OFFSET < MEM_SIZE        goto OFFSET MEMORY_FILE        get OFFSET1 long MEMORY_FILE        get OFFSET2 long MEMORY_FILE        get FILE_OFFSET long MEMORY_FILE        get FILE_SIZE long MEMORY_FILE        get NAME string MEMORY_FILE        set FULLNAME string PATH   


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.3.12
get PAK_SIZE asize
get VER long
get DUMMY long
get SIGN long
if SIGN == 0x43344334   # C4C4
    # endian little
elif SIGN == 0x34433443 # 4C4C
    endian big
else
    cleanexit
endif
get INFO_SIZE long
savepos INFO_OFF
log MEMORY_FILE INFO_OFF INFO_SIZE
get MEM_SIZE asize MEMORY_FILE
math BASE_OFF = INFO_OFF
math BASE_OFF += INFO_SIZE

set PATH string ""
set NAME string ""
get DUMMY long MEMORY_FILE
get DUMMY long MEMORY_FILE
get DUMMY long MEMORY_FILE
get OFFSET1 long MEMORY_FILE
get OFFSET2 long MEMORY_FILE
savepos OFFSET MEMORY_FILE
callfunction extract

startfunction extract
    if OFFSET != 0
    if OFFSET < MEM_SIZE
        goto OFFSET MEMORY_FILE
        get OFFSET1 long MEMORY_FILE
        get OFFSET2 long MEMORY_FILE
        get OFFSET3 long MEMORY_FILE
        get OFFSET4 long MEMORY_FILE
        get NAME string MEMORY_FILE

        set OLD_PATH string PATH
        string PATH += NAME
        string PATH += /

        math OFFSET = OFFSET3
        callfunction extract2

        math OFFSET = OFFSET4
        callfunction extract

        set PATH string OLD_PATH

        math OFFSET = OFFSET1
        callfunction extract

        math OFFSET = OFFSET2
        callfunction extract
    endif
    endif
endfunction

startfunction extract2
    if OFFSET != 0
    if OFFSET < MEM_SIZE
        goto OFFSET MEMORY_FILE
        get OFFSET1 long MEMORY_FILE
        get OFFSET2 long MEMORY_FILE
        callfunction extract_type 1
        get OFFSET3 long MEMORY_FILE

        math OFFSET = OFFSET1
        callfunction extract2
        math OFFSET = OFFSET2
        callfunction extract2
        math OFFSET = OFFSET3
        callfunction extract3
    endif
    endif
endfunction

startfunction extract3
    if OFFSET != 0
    if OFFSET < MEM_SIZE
        goto OFFSET MEMORY_FILE
        get OFFSET1 long MEMORY_FILE
        get OFFSET2 long MEMORY_FILE
        get FILE_OFFSET long MEMORY_FILE
        get FILE_SIZE long MEMORY_FILE
        get NAME string MEMORY_FILE

        set FULLNAME string PATH
        string FULLNAME += NAME
        string FULLNAME += TYPE
        math FILE_OFFSET *= 0x10
        math FILE_OFFSET += BASE_OFF
        log FULLNAME FILE_OFFSET FILE_SIZE

        math OFFSET = OFFSET1
        callfunction extract3
        math OFFSET = OFFSET2
        callfunction extract3
    endif
    endif
endfunction

startfunction extract_type
    getdstring TYPE4 1 MEMORY_FILE
    getdstring TYPE3 1 MEMORY_FILE
    getdstring TYPE2 1 MEMORY_FILE
    getdstring TYPE1 1 MEMORY_FILE

    set TYPE string "."
    string TYPE += TYPE1
    string TYPE += TYPE2
    string TYPE += TYPE3
    string TYPE += TYPE4
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
goto -0x800
savepos MAX_SIZE
idstring "ARC\0"
get VER long
get OFFSET long
get SIZE long
get ZSIZE long
get FILES long
get ALIGN long

math OFFSET *= ALIGN
clog MEMORY_FILE OFFSET ZSIZE SIZE

for i = 0 < FILES
    idstring MEMORY_FILE "ARCH"
    get OFFSET long MEMORY_FILE
    get NEXT long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get ZSIZE long MEMORY_FILE
    get ZIP long MEMORY_FILE
    get NAMESZ long MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE
    math OFFSET *= ALIGN
    if ZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "\x37\x75\x43\x23"
idstring "\x01\x00\x00\x00"
get SIZE asize
math SIZE -= 8
log MEMORY_FILE 8 SIZE

for extract = 0 < 2
    goto 0 MEMORY_FILE
    do
        set CM_SIZE long 1
        callfunction cakemania_decrypt
        get TYPE byte MEMORY_FILE2

        set break_extract long 0
        if TYPE & 0x80
            set break_extract long 1
        else
            set CM_SIZE long 1
            callfunction cakemania_decrypt
            get NAMESZ byte MEMORY_FILE2

            set CM_SIZE long NAMESZ
            callfunction cakemania_decrypt
            getdstring NAME NAMESZ MEMORY_FILE2

            set CM_SIZE long 4
            callfunction cakemania_decrypt
            get SIZE long MEMORY_FILE2

            set CM_SIZE long 8
            callfunction cakemania_decrypt
            get TIMESTAMP longlong MEMORY_FILE2

            if extract != 0
                savepos TMP_OFF MEMORY_FILE
                goto OFFSET MEMORY_FILE
                set CM_SIZE long SIZE
                callfunction cakemania_decrypt
                log NAME 0 SIZE MEMORY_FILE2
                math OFFSET += SIZE
                goto TMP_OFF MEMORY_FILE
            endif
        endif
    while break_extract == 0
    if extract == 0
        savepos OFFSET MEMORY_FILE
    endif
next extract

startfunction cakemania_decrypt
    savepos CM_OFFSET MEMORY_FILE
    math CM_SIZE += CM_OFFSET
    putvarchr MEMORY_FILE2 CM_SIZE 0    # pre-allocate

    set EAX0 long 0x00d1f1f5     # eax[0] = 0x00d1f1f5;
    set EAX1 long 0x0052f8ab     # eax[1] = 0x0052f8ab;
    set EAX2 long 0x02222115     # eax[2] = 0x02222115;
    set EAX3 long 0x04bd4f83     # eax[3] = 0x04bd4f83;
    set ECX0 long 0x000141b0     # ecx[0] = 0x000141b0;
    set ECX1 long 0x008271e4     # ecx[1] = 0x008271e4;

    math y = 0
    for x = CM_OFFSET < CM_SIZE
        math EAX2 += ECX0       # eax[2] += ecx[0];
        math EAX3 += ECX1       # eax[3] += ecx[1];
        math EAX1 -= EAX3       # eax[1] -= eax[3];
        math TMP = EAX0         # t = (eax[0] + eax[2]);
        math TMP += EAX2
        math EAX0 = EAX1        # eax[0] = ((eax[1] ^ t) * t) >> 8;
        math EAX0 ^= TMP
        math EAX0 *= TMP
        math EAX0 >>= 8
        math EAX0 &= 0x00ffffff # sign stuff
        getvarchr BYTE MEMORY_FILE x    # data[i] ^= eax[0];
        math BYTE ^= EAX0
        putvarchr MEMORY_FILE2 y BYTE
        math y += 1
    next x

    goto x MEMORY_FILE
    goto 0 MEMORY_FILE2
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "\x37\x75\x43\x23"
idstring "\x01\x00\x00\x00"
get SIZE asize
math SIZE -= 8
log MEMORY_FILE 8 SIZE

for extract = 0 < 2
    goto 0 MEMORY_FILE
    do
        set CM_SIZE long 1
        callfunction cakemania_decrypt
        get TYPE byte MEMORY_FILE2

        set break_extract long 0
        if TYPE & 0x80
            set break_extract long 1
        else
            set CM_SIZE long 1
            callfunction cakemania_decrypt
            get NAMESZ byte MEMORY_FILE2

            set CM_SIZE long NAMESZ
            callfunction cakemania_decrypt
            getdstring NAME NAMESZ MEMORY_FILE2

            set CM_SIZE long 4
            callfunction cakemania_decrypt
            get SIZE long MEMORY_FILE2

            set CM_SIZE long 8
            callfunction cakemania_decrypt
            get TIMESTAMP longlong MEMORY_FILE2

            if extract != 0
                savepos TMP_OFF MEMORY_FILE
                goto OFFSET MEMORY_FILE
                set CM_SIZE long SIZE
                callfunction cakemania_decrypt
                log NAME 0 SIZE MEMORY_FILE2
                math OFFSET += SIZE
                goto TMP_OFF MEMORY_FILE
            endif
        endif
    while break_extract == 0
    if extract == 0
        savepos OFFSET MEMORY_FILE
    endif
next extract

startfunction cakemania_decrypt
    savepos CM_OFFSET MEMORY_FILE
    math CM_SIZE += CM_OFFSET
    putvarchr MEMORY_FILE2 CM_SIZE 0    # pre-allocate

    set EAX0 long 0x2aabafef     # eax[0] = 0x00d1f1f5;
    set EAX1 long 0x030e8535     # eax[1] = 0x0052f8ab;
    set EAX2 long 0x2eaa5841     # eax[2] = 0x02222115;
    set EAX3 long 0x14cca08f     # eax[3] = 0x04bd4f83;
    set ECX0 long 0x000141b0     # ecx[0] = 0x000141b0;
    set ECX1 long 0x0094c164     # ecx[1] = 0x008271e4;

    math y = 0
    for x = CM_OFFSET < CM_SIZE
        math EAX2 += ECX0       # eax[2] += ecx[0];
        math EAX3 += ECX1       # eax[3] += ecx[1];
        math EAX1 -= EAX3       # eax[1] -= eax[3];
        math TMP = EAX0         # t = (eax[0] + eax[2]);
        math TMP += EAX2
        math EAX0 = EAX1        # eax[0] = ((eax[1] ^ t) * t) >> 8;
        math EAX0 ^= TMP
        math EAX0 *= TMP
        math EAX0 >>= 8
        math EAX0 &= 0x00ffffff # sign stuff
        getvarchr BYTE MEMORY_FILE x    # data[i] ^= eax[0];
        math BYTE ^= EAX0
        putvarchr MEMORY_FILE2 y BYTE
        math y += 1
    next x

    goto x MEMORY_FILE
    goto 0 MEMORY_FILE2
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "\x37\x75\x43\x23"
get VER long
get SIZE asize
math SIZE -= 8
log MEMORY_FILE 8 SIZE

math DECRYPT = 1
for EXTRACT = 0 < 2
    goto 0 MEMORY_FILE
    do
        math CM_SIZE = 1
        callfunction cakemania_decrypt
        get TYPE byte MEMORY_FILE

        set break_extract long 0
        if TYPE & 0x80
            set break_extract long 1
        else
            math CM_SIZE = 1
            callfunction cakemania_decrypt
            get NAMESZ byte MEMORY_FILE

            math CM_SIZE = NAMESZ
            callfunction cakemania_decrypt
            getdstring NAME NAMESZ MEMORY_FILE

            math CM_SIZE = 4
            callfunction cakemania_decrypt
            get SIZE long MEMORY_FILE

            math CM_SIZE = 8
            callfunction cakemania_decrypt
            get TIMESTAMP longlong MEMORY_FILE

            if EXTRACT != 0
                savepos TMP_OFF MEMORY_FILE
                goto OFFSET MEMORY_FILE
                math CM_SIZE = SIZE
                math DECRYPT = 1
                callfunction cakemania_decrypt
                math DECRYPT = 0
                log NAME OFFSET SIZE MEMORY_FILE
                math OFFSET += SIZE
                goto TMP_OFF MEMORY_FILE
            endif
        endif
    while break_extract == 0
    if EXTRACT == 0
        savepos OFFSET MEMORY_FILE
        math DECRYPT = 0
    endif
next EXTRACT

startfunction cakemania_decrypt
    if DECRYPT != 0
        set EAX0 long 0x3682892f
        set EAX1 long 0x03120780
        set EAX2 long 0x28b2fc59
        set EAX3 long 0x1a4afc04
        set ECX0 long 0x0000a4e4
        set ECX1 long 0x00945bc2

        savepos CM_OFFSET MEMORY_FILE
        math CM_SIZE += CM_OFFSET
        for x = CM_OFFSET < CM_SIZE
            math EAX2 += ECX0
            math EAX3 += ECX1
            math EAX1 -= EAX3
            math TMP = EAX0
            math TMP += EAX2
            math EAX0 = EAX1
            math EAX0 ^= TMP
            math EAX0 *= TMP
            math EAX0 u>>= 8
            getvarchr TMP MEMORY_FILE x
            math TMP ^= EAX0
            putvarchr MEMORY_FILE x TMP
        next x
        goto CM_OFFSET MEMORY_FILE
    endif
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "\x37\x75\x43\x23"
get VER long
get SIZE asize
math SIZE -= 8
log MEMORY_FILE 8 SIZE

math DECRYPT = 1
for EXTRACT = 0 < 2
    goto 0 MEMORY_FILE
    do
        math CM_SIZE = 1
        callfunction cakemania_decrypt
        get TYPE byte MEMORY_FILE

        set break_extract long 0
        if TYPE & 0x80
            set break_extract long 1
        else
            math CM_SIZE = 1
            callfunction cakemania_decrypt
            get NAMESZ byte MEMORY_FILE

            math CM_SIZE = NAMESZ
            callfunction cakemania_decrypt
            getdstring NAME NAMESZ MEMORY_FILE

            math CM_SIZE = 4
            callfunction cakemania_decrypt
            get SIZE long MEMORY_FILE

            math CM_SIZE = 8
            callfunction cakemania_decrypt
            get TIMESTAMP longlong MEMORY_FILE

            if EXTRACT != 0
                savepos TMP_OFF MEMORY_FILE
                goto OFFSET MEMORY_FILE
                math CM_SIZE = SIZE
                math DECRYPT = 1
                callfunction cakemania_decrypt
                math DECRYPT = 0
                log NAME OFFSET SIZE MEMORY_FILE
                math OFFSET += SIZE
                goto TMP_OFF MEMORY_FILE
            endif
        endif
    while break_extract == 0
    if EXTRACT == 0
        savepos OFFSET MEMORY_FILE
        math DECRYPT = 0
    endif
next EXTRACT

startfunction cakemania_decrypt
    if DECRYPT != 0
        set EAX0 long 0x36871d11
        set EAX1 long 0x030cd76f
        set EAX2 long 0x2ea8d1a1
        set EAX3 long 0x2637332b
        set ECX0 long 0x0000a49e
        set ECX1 long 0x0094aa28

        savepos CM_OFFSET MEMORY_FILE
        math CM_SIZE += CM_OFFSET
        for x = CM_OFFSET < CM_SIZE
            math EAX2 += ECX0
            math EAX3 += ECX1
            math EAX1 -= EAX3
            math TMP = EAX0
            math TMP += EAX2
            math EAX0 = EAX1
            math EAX0 ^= TMP
            math EAX0 *= TMP
            math EAX0 u>>= 8
            getvarchr TMP MEMORY_FILE x
            math TMP ^= EAX0
            putvarchr MEMORY_FILE x TMP
        next x
        goto CM_OFFSET MEMORY_FILE
    endif
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzss
idstring "pack"
get no_z_len short
get filever short
get chunks long
savepos current_offset
math chunk_offset = chunks
math chunk_offset *= 2
math chunk_offset += current_offset
if filever == 0x8000
    math chunk_offset += 4  # crc
endif

get name filename
string name += ".unpacked"
log name 0 0    # avoids to append if already exists
append
for i = 0 < chunks
    get zlen short
    if zlen == 0xffff
        math zlen = no_z_len
        log name chunk_offset zlen
    else
        clog name chunk_offset zlen 0x10000
    endif
    math chunk_offset += zlen
next i
append


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring MCPK
goto 0x20
get OFFSET long
get FILES long
get SIZE asize
math SIZE -= OFFSET

encryption rc4 "\x3e\xa9\xa0\x39\x4a\xab\x44\xaa\xdd\x14\x8c\xfa\xfa\x5c\x66\x93" # md5 of "allocator"
log MEMORY_FILE OFFSET SIZE
encryption "" ""

for i = 0 < FILES
    get ZSIZE long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get OFFSET long MEMORY_FILE
    getdstring DUMMY 20 MEMORY_FILE
    get DUMMY long MEMORY_FILE
    get NAMESZ long MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE

    if ZSIZE == SIZE
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.4.6
get PATH basename
get VER long    # 4 for civ4, 6 for civ5/rev
idstring "FPK_"
if VER <= 4
    get DUMMY byte
else
    get DUMMY short
endif
get FILES long
for i = 0 < FILES
    get NAMESZ long
    math TMP = NAMESZ
    math TMP += 8
    math TMP x= 4
    if VER <= 4
        filerot -1
    endif
    getdstring NAME TMP
    filerot ""
    putvarchr NAME NAMESZ 0
    get SIZE long
    get OFFSET long

    set FULLNAME string PATH
    string FULLNAME += /
    string FULLNAME += NAME
    log FULLNAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "Sr\x1a\x1b"       # Stormregion file
idstring "\x0d\x0a\x87\x0a" # Stormregion file
idstring PACK               # PACK file
get INFO_SIZE long
log MEMORY_FILE 16 INFO_SIZE
math BASE_OFF = 16
math BASE_OFF += INFO_SIZE

set SAVED binary "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
for INFO_OFF = 0 < INFO_SIZE
    get USE_SAVED byte MEMORY_FILE
    get NAMESZ byte MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get ISFILE byte MEMORY_FILE
    get NEXT long MEMORY_FILE
    savepos INFO_OFF MEMORY_FILE

    if USE_SAVED == 0
        set FULLNAME string NAME
    else
        set FULLNAME string SAVED
        set TMP long USE_SAVED
        math TMP n= TMP
        string FULLNAME -= TMP
        string FULLNAME += NAME
    endif

    if SIZE != 0
        math OFFSET += BASE_OFF
        log FULLNAME OFFSET SIZE
        for j = 0 < NAMESZ
            getvarchr TMP FULLNAME j
            putvarchr SAVED j TMP
        next j
    endif
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
filerot 0xbd

goto -4
get VER long
goto -8
get INFO_SIZE long
goto -12
get FILES long

get INFO_OFF asize
math INFO_OFF -= 8
math INFO_OFF -= INFO_SIZE
goto INFO_OFF

get FOLDERS long
for j = 0 < FOLDERS
    get NAMESZ short
    getdstring NAME NAMESZ
    get FILES long

    for i = 0 < FILES
        get NAMESZ short
        getdstring NAME NAMESZ
        get OFFSET long
        get DUMMY long
        get ZSIZE long
        get TYPE long
        getdstring TIMESTAMP 8
        get SIZE long

        if TYPE == 1
            log NAME OFFSET SIZE
        elif TYPE == 2
            clog NAME OFFSET ZSIZE SIZE
        elif TYPE == 3
            # nothing, it's a folder
        else
            print "unknown type %TYPE%"
            cleanexit
        endif
    next i
next j


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.3.12
endian big
comtype cpk

idstring "CPK "

set query->offset long 0
set query->index long 0
set query->name string "TocOffset"
callfunction query_utf 1
set toc_offset long UTF_VALUE

set query->offset long 0
set query->index long 0
set query->name string "ContentOffset"
callfunction query_utf 1
set content_offset long UTF_VALUE

set query->offset long 0
set query->index long 0
set query->name string "Files"
callfunction query_utf 1
set CpkHeader_count long UTF_VALUE

goto toc_offset
getdstring signature 4
if signature != "TOC "
    print "TOC signature not found"
    cleanexit
endif

set query->offset long toc_offset
set query->index long 0
set query->name string ""
callfunction query_utf 1
set CpkHeader_count long UTF_VALUE
set toc_entries long table_info.rows    # it remains saved after the call

if content_offset < 0           # "if" can't be unsigned
    set add_offset long toc_offset
elif toc_offset < 0
    set add_offset long content_offset
elif content_offset < toc_offset
    set add_offset long content_offset
else
    set add_offset long toc_offset
endif

for mytoc = 0 < toc_entries
    set query->offset long toc_offset
    set query->index long mytoc
    set query->name string "DirName"
    callfunction query_utf 1
    set file_name string UTF_VALUE

    set query->offset long toc_offset
    set query->index long mytoc
    set query->name string "FileName"
    callfunction query_utf 1
    set file_name2 string UTF_VALUE

    string file_name += /
    string file_name += file_name2

    set query->offset long toc_offset
    set query->index long mytoc
    set query->name string "FileSize"
    callfunction query_utf 1
    set file_size long UTF_VALUE

    set query->offset long toc_offset
    set query->index long mytoc
    set query->name string "ExtractSize"
    callfunction query_utf 1
    set extract_size long UTF_VALUE

    set query->offset long toc_offset
    set query->index long mytoc
    set query->name string "FileOffset"
    callfunction query_utf 1
    set file_offset long UTF_VALUE

    math file_offset += add_offset
    if extract_size > file_size
        clog file_name file_offset file_size extract_size
    else
        log file_name file_offset file_size
    endif
next mytoc



startfunction query_utf
    set COLUMN_STORAGE_MASK        long 0xf0
    set COLUMN_STORAGE_PERROW      long 0x50
    set COLUMN_STORAGE_CONSTANT    long 0x30
    set COLUMN_STORAGE_ZERO        long 0x10
    set COLUMN_TYPE_MASK           long 0x0f
    set COLUMN_TYPE_DATA           long 0x0b
    set COLUMN_TYPE_STRING         long 0x0a
    set COLUMN_TYPE_FLOAT          long 0x08
    set COLUMN_TYPE_8BYTE2         long 0x07
    set COLUMN_TYPE_8BYTE          long 0x06
    set COLUMN_TYPE_4BYTE2         long 0x05
    set COLUMN_TYPE_4BYTE          long 0x04
    set COLUMN_TYPE_2BYTE2         long 0x03
    set COLUMN_TYPE_2BYTE          long 0x02
    set COLUMN_TYPE_1BYTE2         long 0x01
    set COLUMN_TYPE_1BYTE          long 0x00

    set UTF_VALUE string ""
    math offset = query->offset
    math offset += 0x10     # needed by the tool
    goto offset

    set table_info.table_offset long offset
    getdstring UTF_signature 4
    if UTF_signature != "@UTF"
        print "not a @UTF table at %offset%"
        cleanexit
    endif
    get table_info.table_size long
    set table_info.schema_offset long 0x20
    get table_info.rows_offset long
    get table_info.string_table_offset long
    get table_info.data_offset long
    get table_name_string long
    get table_info.columns short
    get table_info.row_width short
    get table_info.rows long

    for i = 0 < table_info.columns
        get schema.type byte
        get schema.column_name long
        putarray 0 i schema.type
        putarray 1 i schema.column_name
        putarray 2 i -1     # schema.constant_offset

        math TMP = schema.type
        math TMP &= COLUMN_STORAGE_MASK
        if TMP == COLUMN_STORAGE_CONSTANT
            savepos schema.constant_offset
            putarray 2 i schema.constant_offset

            math TMP = schema.type
            math TMP &= COLUMN_TYPE_MASK
            if TMP == COLUMN_TYPE_STRING
                getdstring DUMMY 4
            elif TMP == COLUMN_TYPE_DATA
                getdstring DUMMY 8
            elif TMP == COLUMN_TYPE_FLOAT
                getdstring DUMMY 4
            elif TMP == COLUMN_TYPE_8BYTE2
                getdstring DUMMY 8
            elif TMP == COLUMN_TYPE_8BYTE
                getdstring DUMMY 8
            elif TMP == COLUMN_TYPE_4BYTE2
                getdstring DUMMY 4
            elif TMP == COLUMN_TYPE_4BYTE
                getdstring DUMMY 4
            elif TMP == COLUMN_TYPE_2BYTE2
                getdstring DUMMY 2
            elif TMP == COLUMN_TYPE_2BYTE
                getdstring DUMMY 2
            elif TMP == COLUMN_TYPE_1BYTE2
                getdstring DUMMY 1
            elif TMP == COLUMN_TYPE_1BYTE
                getdstring DUMMY 1
            else
                print "unknown type for constant"
                cleanexit
            endif
        endif
    next i

    math TMP = table_info.string_table_offset
    math TMP += 8
    math TMP += offset
    math string_table_size = table_info.data_offset
    math string_table_size -= table_info.string_table_offset
    log MEMORY_FILE TMP string_table_size

    for i = query->index < table_info.rows
        math TMP = i
        math TMP *= table_info.row_width
        math row_offset = table_info.table_offset
        math row_offset += 8
        math row_offset += table_info.rows_offset
        math row_offset += TMP

        for j = 0 < table_info.columns
            getarray type 0 j
            getarray column_name 1 j
            getarray constant_offset 2 j

            if constant_offset >= 0
                math data_offset = constant_offset
            else
                math data_offset = row_offset
            endif

            math TMP = type
            math TMP &= COLUMN_STORAGE_MASK
            if TMP == COLUMN_STORAGE_ZERO
                set value long 0
            else
                goto data_offset
                math TMP = type
                math TMP &= COLUMN_TYPE_MASK
                if TMP == COLUMN_TYPE_STRING
                    get string_offset long
                    goto string_offset MEMORY_FILE
                    get value string MEMORY_FILE
                elif TMP == COLUMN_TYPE_DATA
                    get vardata_offset long
                    get vardata_size long
                    goto vardata_offset MEMORY_FILE
                    getdstring value vardata_size MEMORY_FILE
                elif TMP == COLUMN_TYPE_FLOAT
                    get value long
                elif TMP == COLUMN_TYPE_8BYTE2
                    get DUMMY long  # no 64 bit support!
                    get value long
                elif TMP == COLUMN_TYPE_8BYTE
                    get DUMMY long  # no 64 bit support!
                    get value long
                elif TMP == COLUMN_TYPE_4BYTE2
                    get value long
                elif TMP == COLUMN_TYPE_4BYTE
                    get value long
                elif TMP == COLUMN_TYPE_2BYTE2
                    get value short
                elif TMP == COLUMN_TYPE_2BYTE
                    get value short
                elif TMP == COLUMN_TYPE_1BYTE2
                    get value byte
                elif TMP == COLUMN_TYPE_1BYTE
                    get value byte
                else
                    print "unknown normal type"
                    cleanexit
                endif

                if constant_offset < 0
                    savepos row_offset  # row_offset += bytes_read
                endif
            endif

            goto column_name MEMORY_FILE
            get column_name string MEMORY_FILE
            if column_name == query->name
                set UTF_VALUE string value  # result.value.value (qthis)
                math i = table_info.rows    # break
                math j = table_info.columns # break
            endif
        next j
    next i
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get SIGN long   # 0xd2f17e00
if SIGN == 0x007ef1d2
    endian big
endif
getdstring DAT_NAME 32
get FILES long
get EVER1 long
get BASE_OFF long
get ENTRY_SIZE long
get INFO_OFF long

math NAMESZ = ENTRY_SIZE
math NAMESZ -= 24
set FOLDER_OFF long 0x40
math INFO_OFF += FOLDER_OFF
math BASE_OFF += INFO_OFF

goto INFO_OFF
for i = 0 < FILES
    savepos TMP
    get CRC long
    get FOLDER long
    get OFFSET long
    get ZSIZE long
    get SIZE long
    get ZIP long
    getdstring NAME NAMESZ

    savepos TMP
    math FOLDER += FOLDER_OFF
    goto FOLDER
    get FULLNAME string
    goto TMP
    string FULLNAME += NAME
    math OFFSET += BASE_OFF

    if ZIP == 0
        log FULLNAME OFFSET SIZE
    else
        clog FULLNAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get FILES long
get FILES64 long
for i = 0 < FILES
    getdstring NAME 0x40
    get SIZE long
    get ZSIZE long
    get OFFSET long
    get OFFSET64 long
    getdstring TIMESTAMP 8
    get TYPE long

    filerot "0x4c 0xbe 0xcf 0x0c 0x92 0x75 0x03 0x25 0xac 0xc7 0xb4 0x6e 0x83 0xee 0xc6 0x4f 0x61 0xe1 0x6b 0xd9 0x29 0x68 0xb9 0x5b 0x8d 0x4a 0xf7 0xee 0xce 0xf8 0x7b 0xe4 0x9f 0x50 0x93 0x6a 0x66 0x93 0x63 0xa1 0x67 0x0d 0x4a 0x29 0x7f 0x78 0x48 0x90 0xa6 0xa4 0x76 0x65 0xda 0x74 0x4b 0x4b 0x51 0xf7 0x8e 0x83 0xb1 0xf4 0xce 0x49 0x40 0x97 0x97 0x79 0x96 0x19 0x48 0xed 0x3d 0xf9 0x2a 0x2f 0x17 0xc0 0xa0 0xd1 0x58 0x60 0x07 0x78 0x5f 0xe2 0x24 0x2a 0xe1 0xbc 0x60 0xf9 0x96 0xf0 0x6d 0x2b 0xa7 0xf4 0xfd 0x18 0xc7 0xc2 0x2e 0x6f 0x1c 0xb8 0x2c 0x1a 0x3b 0x78 0x1a 0x4d 0x7c 0x91 0x5d 0x42 0xd6 0x57 0xbe 0x16 0x44 0x84 0x34 0x3d 0x20 0x95 0x90 0x0c 0xbd 0x91 0xf4 0x81 0x40 0x81 0x4c 0x77 0xcd 0x38 0xaf 0x8e 0xd7 0x3c 0xa2 0xb4 0x78 0x83 0xda 0xec 0x7b 0x5d 0x78 0xdf 0xf9 0x06 0xcf 0x2f 0x02 0x45 0xb5 0x9e 0xba 0x09 0xa1 0x12 0xc6 0xe3 0x36 0x65 0x71 0xf2 0xff 0x4d 0xe5 0x31 0x3c 0xb9 0xc4 0x9f 0xf1 0x8e 0x80 0x17 0xfd 0x00 0xbf 0x95 0x6d 0xcc 0x51 0xc2 0xa1 0xf5 0x60 0x3b 0x24 0x59 0xb1 0xf7 0x16 0x42 0xb3 0x86 0x3a 0x02 0xfd 0xc1 0x28 0x0d 0xf8 0x0e 0xc9 0x0a 0x9e 0x3a 0x95 0x2e 0x6d 0x9a 0x51 0x36 0x71 0x78 0x61 0x25 0x1d 0xc9 0x72 0x71 0x8b 0x45 0x9d 0xf6 0xda 0x9c 0xfa 0x11 0x97 0x56 0xcc 0x72 0x03 0x72 0x18 0xba 0x20 0x99 0x31 0x0a 0x1b 0x93 0x4d 0x34 0x4d 0x9d 0x3d 0xd3 0x76 0x83 0x20 0xd4 0xb1 0x35 0x1a 0x43 0x6f 0x3c 0x65 0x4e 0xfa 0x75 0xbf 0xe2 0x80 0xb3 0xff 0x7b 0x75 0x91 0xce 0x28 0xcd 0xee 0xca 0x1a 0xef 0x0f 0xd6 0x63 0x78 0x59 0xcc 0xbe 0x9b 0xd8 0xad 0xbe 0xbf 0xbe 0x4d 0x59 0xf6 0x12 0xad 0x2a 0x64 0xdf 0x17 0x77 0x49 0x10 0x6d 0xad 0xb6 0x08 0x44 0x90 0xc2 0xd7 0x82 0x9e 0x1c 0xb5 0x04 0xcc 0xf7 0x9f 0xab 0x62 0x91 0xd3 0x59 0xa1 0x35 0xac 0xcc 0x0f 0x39 0x51 0x83 0xa1 0x6e 0xd9 0x07 0x2b 0xba 0x82 0xa3 0x5e 0x65 0x06 0x84 0x22 0xf6 0x00 0xef 0xd1 0x9c 0x2c 0xaa 0x82 0xf9 0xf5 0x59 0xe1 0xee 0xad 0x04 0xde 0xff 0x0f 0x0c 0x9e 0x97 0x6e 0x19 0xe7 0x04 0x0f 0xf3 0x30 0x13 0x31 0xfa 0xff 0x99 0xe2 0x0f 0x7d 0x5f 0x66 0x61 0xb5 0x38 0x39 0x3e 0x6d 0xb9 0x03 0x6c 0x81 0x09 0x8e 0x31 0xe6 0x1c 0xdf 0xbd 0x82 0x50 0x07 0x9d 0xdb 0xf3 0x03 0x06 0x4d 0xb4 0x3f 0xfe 0x53 0x37 0x51 0x5f 0xc2 0x4e 0x4d 0x06 0xed 0xdb 0x62 0xaa 0xda 0x30 0x0e 0x03 0x42 0xa2 0x6e 0xff 0x76 0x5e 0xb5 0x49 0x5c 0xea 0xbc 0xa6 0xbb 0xdc 0xe2 0x66 0x66 0xf7 0x7f 0x40 0x8e 0x21 0x2a 0x61 0x51 0x88 0xba 0x20 0x61 0xa4 0x6b 0x7b 0x91 0x2f 0xc4 0x19 0x8e 0x46 0xd6 0x21 0x7f 0x1d 0xca 0x08 0xeb 0xc1 0xc9 0x1f 0x68 0x54 0x03 0x9c 0x1f 0xd4 0xda 0x43 0x23 0x98 0x59 0x04 0x84 0x91 0x8c 0xcf 0x86 0x86 0x1c 0x0f 0xc1 0x99 0xcf 0x30 0x6c 0x33 0xa1 0x30 0x0e 0xd4 0x5e 0x07 0x4e 0x06 0x2d 0x9f 0x46 0xef 0x24 0xa5 0x7e 0x4d 0xa2 0x17 0xeb 0x13 0xfe 0xd0 0x67 0x5d 0xea 0x95 0x05 0xb5 0xb4 0xa2 0xb3 0xca 0x60 0x8b 0x7e 0x60 0x89 0x89 0xb9 0xcd 0x42 0xa9 0x5c 0xaf 0x5f 0x5d 0x42 0xa0 0xf0 0xdb 0xcf 0xa4 0xa3 0x9f 0xfe 0xac 0x7d 0x8b 0x66 0x4f 0xd3 0xa6 0x91 0xaa 0x1c 0xc2 0x15 0xcd 0x46 0xf4 0x26 0xdd 0x33 0x68 0xd3 0x2a 0x7d 0x1c 0xa3 0x3a 0xf3 0x1f 0x0d 0xd7 0x3b 0x83 0xe7 0xcb 0x40 0x0b 0xf0 0x0d 0x61 0x16 0xb4 0x4b 0x80 0x69 0x10 0x62 0xa9 0x8e 0xcf 0x3a 0x48 0xa0 0x60 0xf3 0xc9 0x2e 0x44 0x39 0xd7 0x7a 0x65 0x2b 0x02 0xb3 0x01 0x57 0xe7 0x10 0x5b 0x0f 0xcb 0x57 0xda 0x99 0x88 0x3f 0x48 0xd1 0x9a 0x16 0xcc 0xff 0xc6 0x83 0x63 0x73 0x23 0x1e 0xc9 0x30 0xf9 0x23 0xa6 0xeb 0x98 0x98 0x6a 0x2b 0x1b 0x5d 0xd9 0xce 0xf4 0x08 0xab 0x50 0x07 0x43 0xe8 0x21 0x88 0xe7 0x4a 0xa7 0xcc 0x38 0x50 0x17 0xd8 0x15 0xab 0xe8 0x67 0xcf 0xf5 0x72 0x46 0x87 0x12 0xb4 0x7d 0xdf 0x49 0x61 0x63 0x56 0xdb 0xd8 0x38 0x22 0xb4 0x90 0x41 0xb4 0x91 0xc8 0x0b 0x5e 0x78 0x0b 0xb6 0x27 0x08 0x7e 0x95 0x13 0x90 0x81 0x4d 0x3b 0xdc 0xe7 0xcc 0x85 0x80 0x57 0x75 0xdc 0xed 0x0e 0x8c 0xed 0xb6 0x89 0x34 0x35 0xea 0x5b 0x1a 0x63 0x84 0xf5 0x05 0x42 0x63 0x4d 0x00 0x5a 0xa4 0x85 0x69 0xa2 0x7e 0x16 0x0f 0xb4 0xb2 0xf1 0xe8 0xda 0xd7 0x1d 0x95 0x5d 0x15 0x11 0x98 0xd6 0x3c 0x11 0xaa 0x6a 0xbe 0xef 0x44 0xb3 0x5c 0x2b 0xca 0x33 0x46 0xe9 0x93 0x43 0x3a 0xd5 0x64 0xf5 0x18 0x36 0xa7 0x8b 0x90 0xce 0x60 0x7e 0x10 0x3a 0xee 0x64 0x64 0xd6 0x3e 0x7d 0x07 0xa2 0xc0 0xd0 0x6e 0xcf 0x89 0xde 0xb7 0xee 0x77 0xa8 0xf0 0x10 0xbc 0x39 0xb1 0x7c 0xab 0x27 0x9f 0xa8 0xf3 0xa0 0x68 0xab 0x0e 0x35 0x9e 0x57 0x10 0x76 0x5a 0xd0 0x80 0xca 0x60 0x93 0xaa 0x06 0x97 0x89 0x23 0xca 0x6b 0x03 0x47 0xfc 0xa7 0x6b 0x3c 0xe8 0x62 0x39 0x79 0x0f 0x2f 0xc5 0x9b 0x54 0xbd 0xd2 0xed 0xa1 0x3a 0xb7 0xd3 0x08 0x72 0xa7 0x42 0xe2 0x52 0x19 0x8c 0xae 0x71 0x6c 0xcf 0x16 0x1d 0xc2 0x57 0x70 0x27 0x88 0x9d 0x5b 0x19 0x61 0xe0 0xf6 0xb6 0x6c 0x43 0x9c 0x9c 0xdc 0x30 0xc7 0x41 0xb2 0x6c 0x25 0x30 0x24 0x33 0xff 0xe2 0x74 0x1f 0x93 0x4d 0x74 0x92 0x19 0xf5 0xc8 0xa6 0x8d 0xed 0x11 0xbe 0xc5 0x42 0xbe 0x04 0x07 0xe2 0xea 0xf2 0xf6 0x3c 0xa3 0x27 0x16 0x12 0x19 0xa5 0xce 0x61 0x54 0x1d 0xf0 0x87 0x2d 0x66 0x3c 0xe3 0x66 0x3c 0x08 0xa9 0xf0 0x0f 0x90 0x5c 0x8a 0xea 0x38 0xca 0x56 0x2c 0x1d 0x94 0xa2 0x06 0x1b 0x9c 0x92 0xf4 0x9d 0xb3 0x14 0x92 0xc5 0x4c 0xbc 0x83 0x9f 0x24 0x68 0x23 0x43 0xb1 0xb6 0x6e 0x5b 0x38 0x54 0xfc 0xaf 0x5a 0xe8 0x72 0x5b 0xd3 0xe9 0x8d 0xfe 0x0d 0xa8 0x4d 0x48 0x6e 0x41 0xdc 0x3c 0xba 0xd1 0x64 0x28 0xd0 0x1f 0xbb 0x75 0xc7" OFFSET
    if TYPE == 0
        log NAME OFFSET SIZE
    elif TYPE == 4
        log NAME OFFSET SIZE
    elif TYPE == 5
        clog NAME OFFSET ZSIZE SIZE
    else
        print "Error: unknown compression type %TYPE%"
        cleanexit
    endif
    filerot ""
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "UWFPVF01"
get EXTS long
get DUMMY long
get FILES long
get BASE_OFF long
for i = 0 < EXTS
    getdstring EXT 4
    get XOFFSET long
    get XFILES long
    savepos TMP
    math OFFSET = XOFFSET
    math OFFSET *= 0x28
    math OFFSET += BASE_OFF
    goto OFFSET
    for j = 0 < XFILES
        getdstring NAME 0x20
        get OFFSET long
        get SIZE long
        string NAME += "."
        string NAME += EXT
        string NAME R= "_" "/"
        log NAME OFFSET SIZE
    next j
    goto TMP
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "APK"
get PACK_NUMBER byte
get INFO_OFFSET long
get CRYPT_INIT long

goto INFO_OFFSET
get INFO_SIZE asize
math INFO_SIZE -= INFO_OFFSET
log MEMORY_FILE INFO_OFFSET INFO_SIZE

set TMP_x10194eac long CRYPT_INIT
math TMP_x10194eac *= INFO_OFFSET
for i = 0 < INFO_SIZE
    set TMP long TMP_x10194eac
    math TMP >>= 16
    math TMP_x10194eac &= 0xffff
    math TMP_x10194eac *= 0x6054
    math TMP_x10194eac += TMP

    getvarchr CHR MEMORY_FILE i
    math CHR ^= TMP_x10194eac
    putvarchr MEMORY_FILE i CHR
next i

set OUT_INFO_SIZE long INFO_SIZE
math OUT_INFO_SIZE *= 8    # more than enough
clog MEMORY_FILE2 0 INFO_SIZE OUT_INFO_SIZE MEMORY_FILE

get TABLE_SIZE asize MEMORY_FILE2
for
    savepos TABLE_OFFSET MEMORY_FILE2   # regular
    if TABLE_OFFSET >= TABLE_SIZE
        cleanexit
    endif

    get NAME string MEMORY_FILE2
    get OFFSET long MEMORY_FILE2
    get ZSIZE long MEMORY_FILE2
    get XTYPE byte MEMORY_FILE2
    get SIZE long MEMORY_FILE2
    get CRYPT_INIT long MEMORY_FILE2
    get DUMMY long MEMORY_FILE2    # the DEMO does NOT use this field!!!

    log MEMORY_FILE OFFSET ZSIZE

    if XTYPE & 1
        set TMP_x10194eac long OFFSET
        math TMP_x10194eac *= SIZE
        math TMP_x10194eac ^= CRYPT_INIT
        for i = 0 < ZSIZE
            set TMP long TMP_x10194eac
            math TMP >>= 16
            math TMP_x10194eac &= 0xffff
            math TMP_x10194eac *= 0x6054
            math TMP_x10194eac += TMP

            getvarchr CHR MEMORY_FILE i
            math CHR ^= TMP_x10194eac
            putvarchr MEMORY_FILE i CHR
        next i
    endif

    if XTYPE & 2
        clog NAME 0 ZSIZE SIZE MEMORY_FILE
    else
        log NAME 0 SIZE MEMORY_FILE
    endif
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.4.6
putarray 0 0 "dh2005.exe;d3d.dll"   # Deer Hunter 2005
putarray 0 1 "d3dx.lib;ddraw.dll"   # Deer Hunter 2005 demo
putarray 0 2 "dh2005custom"         # Deer Hunter 2005 mods  (thanx bacter)
putarray 0 3 "winmm.lib!ddraw.lib"  # Deer Hunter Tournament (thanx bacter)
putarray 0 4 ""

idstring "APK"
get PACK_NUMBER byte
get INFO_OFFSET long
get CRYPT_INIT long
get CRYPT_INIT2 byte

# decryption key scanning
comtype zlib_noerror
math x = 0
do
    getarray CRYPT_STRING 0 x
    math x += 1
    if CRYPT_STRING == ""
        print "Error: unsupported archive encryption"
        cleanexit
    endif

    print "try encryption string: %CRYPT_STRING%"
    callfunction TABLE_DECRYPT 1

    set OUT_INFO_SIZE long CRYPT_INIT
    clog MEMORY_FILE2 0 INFO_SIZE OUT_INFO_SIZE MEMORY_FILE
    get TABLE_SIZE asize MEMORY_FILE2
while TABLE_SIZE <= 0
comtype zlib

goto 0 MEMORY_FILE2
get TABLE_SIZE asize MEMORY_FILE2
for
    savepos TABLE_OFFSET MEMORY_FILE2   # regular
    if TABLE_OFFSET >= TABLE_SIZE
        cleanexit
    endif

    get NAME string MEMORY_FILE2
    get OFFSET long MEMORY_FILE2
    get ZSIZE long MEMORY_FILE2
    get XTYPE byte MEMORY_FILE2
    get SIZE long MEMORY_FILE2
    get CRYPT_INIT long MEMORY_FILE2
    get DUMMY long MEMORY_FILE2

    log MEMORY_FILE OFFSET ZSIZE

    if XTYPE & 1
        set TMP_x10194eac long x10194eac
        math TMP_x10194eac ^= CRYPT_INIT
        math TMP_x10194eac ^= SIZE
        math TMP_x10194eac ^= OFFSET
        if CRYPT_INIT2 != 0
            set TMP long TMP_x10194eac
            math TMP >>= 16
            math TMP_x10194eac &= 0xffff
            math TMP_x10194eac *= 0x6054
            math TMP_x10194eac += TMP
        endif
        for i = 0 < ZSIZE
            set TMP long TMP_x10194eac
            math TMP >>= 16
            math TMP_x10194eac &= 0xffff
            math TMP_x10194eac *= 0x6054
            math TMP_x10194eac += TMP

            getvarchr CHR MEMORY_FILE i
            math CHR ^= TMP_x10194eac
            putvarchr MEMORY_FILE i CHR
        next i
    endif

    if XTYPE & 2
        clog NAME 0 ZSIZE SIZE MEMORY_FILE
    else
        log NAME 0 SIZE MEMORY_FILE
    endif
next

startfunction TABLE_DECRYPT
    set x10194eac long 1
    strlen CRYPT_STRING_LEN CRYPT_STRING
    for i = 0 < CRYPT_STRING_LEN
        getvarchr CHR CRYPT_STRING i

        set TMP string x10194eac
        math TMP &= 0xffff
        math TMP += CHR
        math TMP %= 0xfff1

        math x10194eac >>= 16
        math x10194eac += TMP
        math x10194eac %= 0xfff1
        math x10194eac <<= 16
        math x10194eac += TMP
    next i
    set TMP_x10194eac long x10194eac

    goto INFO_OFFSET
    get INFO_SIZE asize
    math INFO_SIZE -= INFO_OFFSET
    log MEMORY_FILE INFO_OFFSET INFO_SIZE

    math TMP_x10194eac ^= CRYPT_INIT
    math TMP_x10194eac ^= INFO_OFFSET
    if CRYPT_INIT2 != 0
        set TMP long TMP_x10194eac
        math TMP >>= 16
        math TMP_x10194eac &= 0xffff
        math TMP_x10194eac *= 0x6054
        math TMP_x10194eac += TMP
    endif
    for i = 0 < INFO_SIZE
        set TMP long TMP_x10194eac
        math TMP >>= 16
        math TMP_x10194eac &= 0xffff
        math TMP_x10194eac *= 0x6054
        math TMP_x10194eac += TMP

        getvarchr CHR MEMORY_FILE i
        math CHR ^= TMP_x10194eac
        putvarchr MEMORY_FILE i CHR
    next i
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get INPUT_NAME basename
string INPUT_NAME -= 4
string INPUT_NAME += "0"
string INPUT_NAME += "0"
string INPUT_NAME += "0"
string INPUT_NAME += "0"
set DGPNAME string INPUT_NAME
string DGPNAME += ".dgp"

open FDSE DGPNAME   # index file

get DGP_FILES short
get DUMMY short
if DUMMY != 0x4844  # Steam version
    goto 2
endif
for DGP = 1 <= DGP_FILES
    set DGPNAME string INPUT_NAME
    strlen TMP DGP
    string DGPNAME -= TMP
    string DGPNAME += DGP
    string DGPNAME += ".dgp"
    open FDSE DGPNAME 1

    get FILES short
    get DIRSZ long
    math DIRSZ *= 2
    getdstring DIR DIRSZ
    set DIR unicode DIR
    get DUMMY byte  # 1 or 0 doesn't matter
    get OFFSET long
    for i = 0 < FILES
        get NAMESZ long
        math NAMESZ *= 2
        getdstring NAME NAMESZ
        set NAME unicode NAME
        get SIZE long
        get TSTAMP longlong
        log NAME OFFSET SIZE 1
        math OFFSET += SIZE
    next i
next DGP


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.5.3
set HFS long 0
set BASE_OFF long 0

get SIGN long
if SIGN == 0x00534648   # " SFH"
    endian big
    set HFS long 1
elif SIGN == 0x48465300 # "HFS "
    endian little
    set HFS long 1
endif

if HFS != 0
    get DUMMY short
    get TYPE short
    if TYPE == 0
        set BASE_OFF long 0x20000
    else
        set BASE_OFF long 0x10
    endif
    goto BASE_OFF
    get SIGN long
endif

if SIGN == 0x00435241   # " CRA"
    endian little
elif SIGN == 0x41524300 # "ARC "
    endian big
else
    cleanexit
endif
get VERSION short
if VERSION == 4
    comtype unzip_dynamic   #zlib
elif VERSION == 8
    comtype unzip_dynamic   #deflate
elif VERSION == 0x11
    comtype XMemDecompress 0x8000   # yeah 0x8000 is the "magic" for RE5
else
    comtype unzip_dynamic   #zlib
    print "unknown version %VERSION%, I try zlib compression"
endif
get FILES short

for i = 0 < FILES
    getdstring NAME 0x40
    get TYPE long
    get ZSIZE long
    get SIZE long
    get OFFSET long

    if SIZE & 0x40000000
        math SIZE -= 0x40000000
    endif

    if HFS != 0 # used in RE5 PS3
        math ZSIZE += 32
        #math SIZE /= 8
        math TMP = OFFSET
        math TMP /= 0x20000
        math TMP *= 0x10
        math ZSIZE  += TMP
        math SIZE   += TMP
        math OFFSET += TMP
        math OFFSET += 2
    endif

    math OFFSET += BASE_OFF # needed for HFS header
    clog NAME OFFSET ZSIZE SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzo1x
getdstring SIGN 22
if SIGN == "Refractor2 FlatArchive"
    goto 28
else
    goto 0
endif
get OFFSET long
goto OFFSET
get FILES long

for i = 0 < FILES
    get NAMESZ long
    getdstring NAME NAMESZ
    get ZSIZE long
    get SIZE long
    get OFFSET long
    get DUMMY long
    get DUMMY long
    get DUMMY long

    if SIZE == ZSIZE
        log NAME OFFSET SIZE
    else
        callfunction UNPACK
    endif
next i

startfunction UNPACK
    log MEMORY_FILE OFFSET ZSIZE
    get CHUNKS long MEMORY_FILE
    math BASE_OFF = CHUNKS
    math BASE_OFF *= 12
    math BASE_OFF += 4
    putvarchr MEMORY_FILE2 SIZE 0       # pre-allocate
    log MEMORY_FILE2 0 0 MEMORY_FILE    # init
    append
    for j = 0 < CHUNKS
        get CHUNK_ZSIZE long MEMORY_FILE
        get CHUNK_SIZE long MEMORY_FILE
        get CHUNK_OFFSET long MEMORY_FILE
        math CHUNK_OFFSET += BASE_OFF
        if CHUNK_ZSIZE == CHUNK_SIZE
            log MEMORY_FILE2 CHUNK_OFFSET CHUNK_SIZE MEMORY_FILE
        else
            clog MEMORY_FILE2 CHUNK_OFFSET CHUNK_ZSIZE CHUNK_SIZE MEMORY_FILE
        endif
    next j
    append
    log NAME 0 SIZE MEMORY_FILE2
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype unmeng
idstring MENG
get DUMMY long
idstring PACK
goto 0x28
get FILES long
get INFO_OFF long
goto INFO_OFF
for i = 0 < FILES
    get DUMMY long
    getdstring NAME 4  # CODE,TEXT,MESH,...
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get SIZE long
    get ZSIZE long
    get OFFSET long

    string NAME += /
    string NAME += i
    string NAME += ".dat"

    if SIZE == ZSIZE
        log NAME OFFSET SIZE
    else
        math OFFSET += 4    # skip the crc
        math ZSIZE  -= 4
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype dk2
idstring "DWFB"
get VER long
goto 0x48
get FILES long
get NAMEOFF long
get NAMESZ long
get DUMMY long
for i = 0 < FILES
    get DUMMY long
    get NAMEOFF long
    get NAMESZ long
    get OFFSET long
    get ZSIZE long
    get TYPE long
    get SIZE long
    getdstring DUMMY 12

    savepos INFO_OFF
    goto NAMEOFF
    getdstring NAME NAMESZ
    goto INFO_OFF

    if TYPE == 0
        log NAME OFFSET ZSIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype COMP_DK2
endian big
idstring "BIG"
getdstring VER 1
get DUMMY long
get FILES long
get OFFSETX long
for i = 0 < FILES
    get OFFSET long
    get ZSIZE long
    get NAME string

    savepos TMP
    goto OFFSET
    get TYPE short
    get SIZE threebyte
    goto TMP

    if TYPE == 0x10fb
        clog NAME OFFSET ZSIZE SIZE
    else
        log NAME OFFSET ZSIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get FILES long
for i = 0 < FILES
    get SIZE long
    get NAMESZ long
    math NAMESZ += 1
    getdstring NAME NAMESZ
next i
savepos OFFSET
goto 4
for i = 0 < FILES
    get SIZE long
    get NAMESZ long
    math NAMESZ += 1
    getdstring NAME NAMESZ

    log NAME OFFSET SIZE
    math OFFSET += SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.4.8d
comtype unzip_dynamic
endian big
get OFFSET longlong
get FOLDER_SIZE longlong
log MEMORY_FILE OFFSET FOLDER_SIZE

callfunction GET_NAMESZ 1

set PATH string ""
set NAME string ""
set MYPOS long 0
goto MYPOS MEMORY_FILE
callfunction EXTRACT

startfunction EXTRACT
    string PATH += NAME
    string PATH += /
    math LIMIT = MYPOS
    math LIMIT += FOLDER_SIZE
    for
        savepos MYPOS MEMORY_FILE
        if MYPOS >= LIMIT
            break
        endif
        get OFFSET longlong MEMORY_FILE
        get SIZE longlong MEMORY_FILE
        get DUMMY longlong MEMORY_FILE
        get FOLDER_SIZE64 long MEMORY_FILE  # remember 0x80
        get FOLDER_SIZE long MEMORY_FILE
        getdstring NAME NAMESZ MEMORY_FILE
        if FOLDER_SIZE == 0
            set FNAME string PATH
            string FNAME += NAME
            clog FNAME OFFSET SIZE SIZE
        else
            callfunction EXTRACT
        endif
    next
endfunction

# NAMESZ guesser
startfunction GET_NAMESZ
    set NAMESZ long 0x20
        get DUMMY longlong MEMORY_FILE
        get DUMMY longlong MEMORY_FILE
        get DUMMY longlong MEMORY_FILE
        get DUMMY longlong MEMORY_FILE
        getdstring DUMMY NAMESZ MEMORY_FILE
        for
            get DUMMY longlong MEMORY_FILE
            if DUMMY != 0
                break
            endif
            getdstring DUMMY 0x1c MEMORY_FILE
            math NAMESZ += 0x20
        next
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "\x37\x75\x43\x23"
idstring "\x01\x00\x00\x00"
get SIZE asize
math SIZE -= 8
log MEMORY_FILE 8 SIZE

for extract = 0 < 2
    goto 0 MEMORY_FILE
    do
        set CM_SIZE long 1
        callfunction cakemania_decrypt
        get TYPE byte MEMORY_FILE2

        set break_extract long 0
        if TYPE & 0x80
            set break_extract long 1
        else
            set CM_SIZE long 1
            callfunction cakemania_decrypt
            get NAMESZ byte MEMORY_FILE2

            set CM_SIZE long NAMESZ
            callfunction cakemania_decrypt
            getdstring NAME NAMESZ MEMORY_FILE2

            set CM_SIZE long 4
            callfunction cakemania_decrypt
            get SIZE long MEMORY_FILE2

            set CM_SIZE long 8
            callfunction cakemania_decrypt
            get TIMESTAMP longlong MEMORY_FILE2

            if extract != 0
                savepos TMP_OFF MEMORY_FILE
                goto OFFSET MEMORY_FILE
                set CM_SIZE long SIZE
                callfunction cakemania_decrypt
                log NAME 0 SIZE MEMORY_FILE2
                math OFFSET += SIZE
                goto TMP_OFF MEMORY_FILE
            endif
        endif
    while break_extract == 0
    if extract == 0
        savepos OFFSET MEMORY_FILE
    endif
next extract

startfunction cakemania_decrypt
    savepos CM_OFFSET MEMORY_FILE
    math CM_SIZE += CM_OFFSET
    putvarchr MEMORY_FILE2 CM_SIZE 0    # pre-allocate

    set EAX0 long 0x0CC96103
    set EAX1 long 0x0312348A
    set EAX2 long 0x2604CC49
    set EAX3 long 0x18AEFF1C
    set ECX0 long 0x2eec
    set ECX1 long 0x8fcbca

    math y = 0
    for x = CM_OFFSET < CM_SIZE
        math EAX2 += ECX0       # eax[2] += ecx[0];
        math EAX3 += ECX1       # eax[3] += ecx[1];
        math EAX1 -= EAX3       # eax[1] -= eax[3];
        math TMP = EAX0         # t = (eax[0] + eax[2]);
        math TMP += EAX2
        math EAX0 = EAX1        # eax[0] = ((eax[1] ^ t) * t) >> 8;
        math EAX0 ^= TMP
        math EAX0 *= TMP
        math EAX0 >>= 8
        math EAX0 &= 0x00ffffff # sign stuff
        getvarchr BYTE MEMORY_FILE x    # data[i] ^= eax[0];
        math BYTE ^= EAX0
        putvarchr MEMORY_FILE2 y BYTE
        math y += 1
    next x

    goto x MEMORY_FILE
    goto 0 MEMORY_FILE2
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get ARCHIVE_NAME filename
string ARCHIVE_NAME |= _

set NAME string "filelist_"
string NAME += ARCHIVE_NAME
open FDSE NAME 0
set NAME string "white_"
string NAME += ARCHIVE_NAME
open FDSE NAME 1

get INFO_OFF long
get FILES_OFF long
get FILES long
savepos FILES_INFO_OFF

set EXTRACTED long 0
set CURR_PAK long 0
for MYOFF = INFO_OFF < FILES_OFF
    goto MYOFF
    get SIZE long
    get ZSIZE long
    get OFFSET long
    math OFFSET += FILES_OFF
    clog MEMORY_FILE OFFSET ZSIZE SIZE
    savepos MYOFF
    callfunction extract 1
next CURR_PAK

startfunction extract
    goto FILES_INFO_OFF
    goto 0 MEMORY_FILE
    for EXTRACTED = EXTRACTED < FILES
        get DUMMY1 short
        get DUMMY2 short
        get PAK_NUM short
        get OFFSET short
        if PAK_NUM != CURR_PAK
            break
        endif
        savepos FILES_INFO_OFF
        goto OFFSET MEMORY_FILE

        getct OFFSET string 0x3a MEMORY_FILE
        set TMP string "$"
        string TMP += OFFSET
        set OFFSET long TMP

        getct SIZE string 0x3a MEMORY_FILE
        set TMP string "$"
        string TMP += SIZE
        set SIZE long TMP

        getct ZSIZE string 0x3a MEMORY_FILE
        set TMP string "$"
        string TMP += ZSIZE
        set ZSIZE long TMP

        get NAME string MEMORY_FILE

        set SKIP_THIS_FILE long 0
        if NAME == "chr/npc/n039/bin/n039.ps3.trb"  # invalid in demo
            #set SKIP_THIS_FILE long 1              # uncomment if you have the demo
        endif

        if SKIP_THIS_FILE == 0
            math OFFSET *= 0x800
            if ZSIZE == SIZE
                log NAME OFFSET SIZE 1
            else
                clog NAME OFFSET ZSIZE SIZE 1
            endif
        endif
    next EXTRACTED
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype xmemdecompress
endian big
idstring "EB"
get DUMMY short
get FILES long
get DUMMY long
get NAME_OFF long
get NAME_SIZE long
get XNAMESZ byte
get XFOLDERSZ byte
get FOLDERS short

log MEMORY_FILE NAME_OFF NAME_SIZE
#math NAMESZ = NAME_SIZE
#math NAMESZ /= FILES
math NAMESZ = XNAMESZ
math FOLDER_OFF = FILES
math FOLDER_OFF *= NAMESZ
math FOLDER_OFF += NAME_OFF
math FOLDER_OFF x= 0x10
math FOLDER_SIZE = NAME_OFF
math FOLDER_SIZE += NAME_SIZE
math FOLDER_SIZE -= FOLDER_OFF
math NAMESZ -= 2

goto FOLDER_OFF
#math FOLDERSZ = FOLDER_SIZE
#math FOLDERSZ /= FOLDERS
math FOLDERSZ = XFOLDERSZ
for i = 0 < FOLDERS
    getdstring FOLDER FOLDERSZ
    putarray 0 i FOLDER
next i

goto 0x30
for i = 0 < FILES
    get OFFSET long
    get DUMMY long
    get SIZE long
    get CRC long
    get FOLDER short MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE
    math OFFSET *= 0x10

    math DO_LZX = 0
    if SIZE > 8
        savepos TMP
        goto OFFSET
        getdstring SIGN 8
        if SIGN == "chunklzx"
            math DO_LZX = 1
        endif
        goto TMP
    endif

    getarray FNAME 0 FOLDER
    string FNAME += /
    string FNAME += NAME

    if DO_LZX == 0
        log FNAME OFFSET SIZE
    else
        callfunction UNPACK
    endif
next i

startfunction UNPACK
    savepos TMP
    goto OFFSET
    idstring "chunklzx"
    get DUMMY long
    get FULLSIZE long
    get SIZE long
    get CHUNKS long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    log MEMORY_FILE3 0 0
    append
    savepos OFFSET
    for j = 0 < CHUNKS
        math OFFSET x= 0x8
        for # very lame, made on the fly
            math T = OFFSET
            math T %= 0x10
            if T == 8
                break
            endif
            math OFFSET += 8
        next
        goto OFFSET

        get ZSIZE long
        get ZIP long
        savepos OFFSET
        if ZIP == 3
            clog MEMORY_FILE3 OFFSET ZSIZE SIZE
        elif ZIP == 4
            log MEMORY_FILE3 OFFSET ZSIZE
        else
            print "unknown ZIP type %ZIP%, contact me!"
            cleanexit
        endif
        math OFFSET += ZSIZE
    next j
    append
    get MYSIZE asize MEMORY_FILE3
    if MYSIZE != FULLSIZE
        print "Alert: MEMORY_FILE3 %MYSIZE% != %FULLSIZE%"
    endif
    log FNAME 0 FULLSIZE MEMORY_FILE3
    goto TMP
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get FILES long
for EXTRACT = 0 < 2
    goto 4
    for i = 0 < FILES
        get NAMESZ long
        getdstring NAME NAMESZ
        get OFFSET long
        get SIZE long
        if EXTRACT != 0
            math OFFSET += BASE_OFF
            log NAME OFFSET SIZE
        endif
    next i
    get DUMMY long
    savepos BASE_OFF
next EXTRACT


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get EXTENSION extension
if EXTENSION != "WA"
    open FDDE WA 0
endif

open FDDE WH 1

goto 12 1
get WH_SIZE long 1
get FOLDERS short 1
for i = 0 < FOLDERS
    get FOLDERSZ short 1
    getdstring FOLDER FOLDERSZ 1
next i
savepos SIZE 1
math SIZE -= 18

log MEMORY_FILE 18 SIZE 0 0 1

comtype lzo1x

get FILES long 1
for i = 0 < FILES
    get DUMMY long 1
    get ZIP byte 1
    get SIZE long 1
    get ZSIZE long 1
    get FOLDER_NUM short 1
    get OFFSET long 1
    get NAMESZ short 1
    if NAMESZ == 0
        get DUMMY short 1
        get NAMESZ short 1
    endif
    getdstring NAME NAMESZ 1

    goto 0 MEMORY_FILE
    for j = 0 <= FOLDER_NUM
        get FOLDERSZ short MEMORY_FILE
        getdstring FOLDER FOLDERSZ MEMORY_FILE
    next j
    set FULLNAME FOLDER
    string FULLNAME += NAME

    if ZIP == 0
        log FULLNAME OFFSET SIZE
    else
        clog FULLNAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get FULLSIZE asize
math FULLSIZE -= 2
for OFFSET = 0 < FULLSIZE    
    set ARG1 long 0x89
    set ARG2 long 0x01
    set SIZE long 4
    callfunction FUN_CRYPT
            get SIGN long MEMORY_FILE
            if SIGN != 0x04034b50
                cleanexit
            endif

    get ARG1 byte
    get ARG2 byte

    set SIZE long 0x18
    callfunction FUN_CRYPT
            #get ver             short   MEMORY_FILE
            get flag            short   MEMORY_FILE
            get method          short   MEMORY_FILE
            get modtime         short   MEMORY_FILE
            get moddate         short   MEMORY_FILE
            get crc             long    MEMORY_FILE
            get comp_size       long    MEMORY_FILE
            get uncomp_size     long    MEMORY_FILE
            get name_len        short   MEMORY_FILE
            get extra_len       short   MEMORY_FILE

    set SIZE long name_len
    callfunction FUN_CRYPT
            getdstring name     name_len    MEMORY_FILE

    if extra_len > 0
        set SIZE long extra_len
        savepos OFFSET
        callfunction FUN_CRYPT
                getdstring extra    extra_len   MEMORY_FILE
    endif

    math comp_size += 2
    clog NAME OFFSET comp_size uncomp_size
    math OFFSET += comp_size
    goto OFFSET
next

startfunction FUN_CRYPT
    savepos OFFSET
    goto 0 MEMORY_FILE
    log MEMORY_FILE OFFSET SIZE
    for i = 0 < SIZE
        getvarchr T MEMORY_FILE i
        math T ^= ARG1
        math ARG1 += ARG2
        putvarchr MEMORY_FILE i T
    next i
    math OFFSET += SIZE
    goto OFFSET
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzss
endian big
idstring "WRS"
getdstring VER 1
get WRS_SIZE asize
set MYXOR binary "\x00\x00"
if VER <= "3"
    if VER == "2"
        set MYXOR binary "\xa5"
    elif VER == "3"
        set MYXOR binary "\xb5"
    else
        savepos TMP
        getdstring NAME 0x20
        goto TMP
        strlen TMP NAME
        math TMP -= 4   # ".ext"
        getvarchr TMP NAME TMP
        math TMP ^= 0x2e
        putvarchr MYXOR 0 TMP
    endif
    savepos OFFSET
    for OFFSET = OFFSET < WRS_SIZE
        getdstring NAME 0x20
        string NAME ^= MYXOR
        get ZSIZE long
        get SIZE long
        savepos OFFSET
        clog NAME OFFSET ZSIZE SIZE
        math OFFSET += ZSIZE
        goto OFFSET
    next
elif VER == "4"
    set MYXOR binary "\xaa"
    get INFO_OFF long
    savepos OFFSET
    goto INFO_OFF
    get INFO_ZSIZE long
    get INFO_SIZE long
    savepos INFO_OFF
    clog MEMORY_FILE INFO_OFF INFO_ZSIZE INFO_SIZE
    for INFO_OFF = 0 < INFO_SIZE
        getdstring NAME 0x20 MEMORY_FILE
        string NAME ^= MYXOR
        get ZSIZE long MEMORY_FILE
        get SIZE long MEMORY_FILE
        savepos INFO_OFF MEMORY_FILE
        clog NAME OFFSET ZSIZE SIZE
        math OFFSET += ZSIZE
    next
else
    print "unsupporter GameStudio version %VER%, contact me"
    cleanexit
endif


Source: http://aluigi.altervista.org/quickbms.htm
Script:
open FDDE "bin" 0

get CHR short
if CHR == 0
    endian big
endif
goto 0

get VER long
get BINSZ long
get FILES long
get DUMMY short
get PACKS short # + 1
get NAMES_OFF long
if NAMES_OFF != 0
    math NAMES_OFF += 0x10
endif

math CRYPT = -1

log MEMORY_FILE 0 0
for i = 0 < FILES
    set NAME string ""
    if NAMES_OFF != 0
        savepos MYOFF
        math TMP = i
        math TMP *= 4
        math TMP += NAMES_OFF
        goto TMP
        get OFFSET long
        math OFFSET += TMP
        goto OFFSET
        if CRYPT < 0
            math CRYPT = 0
            get CHR byte
            if CHR != 'x'
            if CHR != 0x00
                math CRYPT = 1
            endif
            endif
            goto OFFSET
        endif
        math j = 0
        do
            get CHR byte
            if CRYPT > 0
                math CL = 0x16
                math CL -= i
                math CL -= j
                math CHR += CL
                math CHR &= 0xff
            endif
            putvarchr MEMORY_FILE j CHR
            math j += 1
        while CHR != 0x00
        goto 0 MEMORY_FILE
        get NAME string MEMORY_FILE
        goto MYOFF
    endif
    putarray 0 i NAME
next i

for i = 0 < FILES
    get SIZE long
    get FLAGS1 long
    get FLAGS2 long
    get FLAGS3 long
    get FLAGS4 long
    get OFFSET long
    get EXT long
    for j = 1 < FLAGS4
        get DUMMY long
        get DUMMY long
    next j

    putarray 1 i OFFSET
    putarray 2 i SIZE
    putarray 3 i EXT
next i

set OLD_EXT long -1
for i = 0 < FILES
    getarray NAME   0 i
    getarray OFFSET 1 i
    getarray SIZE   2 i
    getarray EXT    3 i
    if EXT != OLD_EXT
        string TMP p= "%03d" EXT
        open FDDE TMP 1
        set OLD_EXT long EXT
    endif
    log NAME OFFSET SIZE 1
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "PK\x01\x09"
get INFO_OFF long
goto INFO_OFF

get PAKSIZE asize
for
    if INFO_OFF >= PAKSIZE
        cleanexit
    endif
    get DUMMY long
    get DUMMY long
    get ZIP byte
    get DUMMY long
    get NAMESZ short
    getdstring UNAME NAMESZ
    set NAME unicode UNAME
    get SIZE long
    get ZSIZE long
    get OFFSET long
    savepos INFO_OFF

    math OFFSET += 22
    if ZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzma86head
getdstring PACK_NAME 0x12
get FILES long
get HEAD_SIZE long
for i = 0 < FILES
    get OFFSET long
    get SIZE long
    get ZIP long
    get NAMESZ long
    getdstring NAME NAMESZ
    if ZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET SIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype xmemdecompress
filexor 0xff
get DUMMY short
get ENTRIES long
get ZSIZE long
get FILES long
filexor ""
math SIZE = ENTRIES
math SIZE *= 0x11c
savepos OFFSET
clog MEMORY_FILE OFFSET ZSIZE SIZE

math BASE_OFF = OFFSET
math BASE_OFF += ZSIZE
set PATH string ""
for i = 0 < ENTRIES
    getdstring NAME 0x104 MEMORY_FILE
    get FOLDER long MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get ZSIZE long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get ZIP long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    if FOLDER != 0
        if NAME == "."
        elif NAME == ".."
            set j strlen PATH
            for j -= 1 > 0
                math j -= 1
                getvarchr T PATH j
                if T == '/'
                    math j += 1
                    putvarchr PATH j 0
                    math j = 0  #break
                endif
            next
        else
            string PATH += NAME
            string PATH += /
        endif
    else
        set FNAME string PATH
        string FNAME += NAME
        math ZSIZE -= OFFSET
        math OFFSET += BASE_OFF
        if ZIP == 0
            log FNAME OFFSET SIZE
        else
            clog FNAME OFFSET ZSIZE SIZE
        endif
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get FILES long
goto 32
for i = 0 < FILES
    get OFFSET long
    get SIZE long
    getdstring DUMMY 8
    getdstring NAME 0x70
    if NAME != ""
        log NAME OFFSET SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "AZP"
get VER byte
get FILES long
get INFO_OFF long
get DUMMY long
get INFO_SIZE long
math INFO_OFF *= 8
math INFO_OFF += 0x40
goto INFO_OFF
for i = 0 < FILES
    get DUMMY long
    get DUMMY long
    get OFFSET long
    get DUMMY long
    get SIZE long
    padding 16
    getdstring NAME 32
    getdstring TYPE 32
    getdstring PATH 32
    set FULLNAME string PATH
    string FULLNAME += /
    string FULLNAME += NAME
    string FULLNAME += .
    string FULLNAME += TYPE
    log FULLNAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get FILES long
for i = 1 to FILES
    get DUMMY long
    get OFFSET long
    get FILESIZE long

    filexor 0xab
    log "" OFFSET FILESIZE
    filexor ""
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "SBPAK V 1.0\r\n\0\0\0"
get DUMMY long      # ever the same
get DUMMY long      # ever the same
get MYXOR long      # it's ever 0xffffffff so it can be used to autoguess the value
math MYXOR &= 0xff
math MYXOR ^= 0xff
filexor MYXOR
print "xor value %MYXOR%"

get DUMMY long      # ever 0x10000
get DUMMY long      # checksum
get FILES long
get DUMMY long
get BASE_OFFSET long
get TOTAL_SIZE long

savepos INFO_OFFSET
set NAMES_OFFSET long FILES
math NAMES_OFFSET *= 16
math NAMES_OFFSET += INFO_OFFSET
set NAMES_SIZE long BASE_OFFSET
math NAMES_SIZE -= NAMES_OFFSET

log MEMORY_FILE NAMES_OFFSET NAMES_SIZE

set XBYTE long NAMES_SIZE
for i = 0 < NAMES_SIZE
    getvarchr BYTE MEMORY_FILE i
    math BYTE ^= 0xc4

    # uncomment the following 5 lines if you get wrong filenames!
    #if XBYTE & 1
    #    math BYTE ^= 0x6e   # 'n'   you could modify these values setting your language
    #else
    #    math BYTE ^= 0x65   # 'e'   you could modify these values setting your language
    #endif

    math BYTE += XBYTE
    math XBYTE -= 1
    putvarchr MEMORY_FILE i BYTE
next i

goto INFO_OFFSET
for i = 0 < FILES
    filexor MYXOR
    get SIZE long
    get OFFSET long
    get NAMEOFF threebyte
    get DUMMY byte
    get DUMMY long

    math NAMEOFF += 2
    goto NAMEOFF MEMORY_FILE
    filexor ""

    get XNAME string MEMORY_FILE
    set NAME string XNAME
    strlen NAMELEN NAME
    set XNAMELEN long NAMELEN
    for j = 0 < NAMELEN
        getvarchr BYTE XNAME j
        math XNAMELEN -= 1
        putvarchr NAME XNAMELEN BYTE
    next j

    math OFFSET += BASE_OFFSET

    if NAME & ".bik"
        filexor ""
    else
        filexor MYXOR
    endif
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
open FDDE IDX 0

get crypt_size asize
log MEMORY_FILE 0 crypt_size
callfunction cryptDecrypt

open FDDE DAT 0

idstring MEMORY_FILE "nigh"
get DUMMY long MEMORY_FILE
get fileCount long MEMORY_FILE
get DUMMY long MEMORY_FILE
get stringCount long MEMORY_FILE
get stringTableSize long MEMORY_FILE
math stringData = 24
math stringInfo = stringData
math stringInfo += stringTableSize
math stringInfo += 4

    for i = 0 < stringCount
        goto stringInfo MEMORY_FILE
        get len short MEMORY_FILE
        math stringInfo += 6

        goto stringData MEMORY_FILE
        getdstring NAME len MEMORY_FILE
        putarray 0 i NAME

        math stringData += len
        math stringData += 1
    next i

math fileInfo = stringInfo
math fileInfo += 4

    goto fileInfo MEMORY_FILE
    for i = 0 < fileCount
        getdstring DUMMY 12 MEMORY_FILE
        get offset long MEMORY_FILE
        get DUMMY long MEMORY_FILE
        get ucSize long MEMORY_FILE
        get cSize long MEMORY_FILE
        get DUMMY long MEMORY_FILE
        get dirnameIdx long MEMORY_FILE
        get filenameIdx long MEMORY_FILE
        getdstring DUMMY 40 MEMORY_FILE

        getarray dirname 0 dirnameIdx
        getarray filename 0 filenameIdx
        set NAME string dirname
        string NAME += /
        string NAME += filename

        if cSize > 0
            clog NAME offset cSize ucSize
        else
            log NAME offset ucSize
        endif
    next i

startfunction cryptDecrypt
    math kNumberOfTheBeast = 666
    set crypt_table string "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
    math crypt_key1 = 0x10DCD
    math crypt_key2 = 0xF4559D5
    math crypt_blockSize = 32
    math crypt_blockIndex = 0xFFFFFFFF
    math crypt_offset = 0
    #crypt_data = indexBuffer
    get crypt_size asize MEMORY_FILE

    for x = 0 < crypt_size
        getvarchr BYTE MEMORY_FILE x

        math TMP = crypt_blockSize
        math TMP *= 4
        math value = crypt_offset
        math value /= TMP
        math value *= TMP
        if crypt_blockIndex != value
            math crypt_blockIndex = value
            math value += kNumberOfTheBeast
            for y = 0 < crypt_blockSize
                math value *= crypt_key1
                math value += crypt_key2
                math TMP = y
                math TMP *= 4
                putvarchr crypt_table TMP value long
            next y
        endif
        math value = crypt_offset
        math value -= crypt_blockIndex
        getvarchr cryptGetCryptByte crypt_table value

        math BYTE -= cryptGetCryptByte
        putvarchr MEMORY_FILE x BYTE
        math crypt_offset += 1
    next x
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get FILES long
set TYPE long 0
if FILES <= 2
    get FILES long
    set TYPE long 1
endif

for i = 1 to FILES
    savepos XOROFFSET
    get DUMMY byte
    goto XOROFFSET

    if DUMMY & 0x80
        filexor 0xcc
    endif
    getdstring NAME 0x50
    filexor ""

    get OFFSET long
    get ZSIZE long  # or SIZE here?
    if TYPE == 0
        math SIZE = ZSIZE
    else
        get SIZE long
    endif

    if SIZE == ZSIZE
        log NAME OFFSET SIZE
    else
        log NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get EXT extension
if EXT == "crypt"
    get VERSION short
    get SIZE long
    get PADDED_SIZE long
    savepos OFFSET
    encryption "aes" "xWurz3lPETER253z"
    log TEMPORARY_FILE OFFSET PADDED_SIZE
    encryption "" ""
    open "." TEMPORARY_FILE
endif

idstring "PKLE"
get VER long
get HEAD_SIZE longlong
get DUMMY longlong
for
    savepos OFFSET
    if OFFSET >= HEAD_SIZE
        cleanexit
    endif
    get LEVEL long
    get NAMESZ long
    get FILES longlong
    getdstring NAME NAMESZ
    set PATH string NAME
    for j = 0 < FILES
        get NAMESZ long
        get SIZE longlong
        get OFFSET longlong
        get CRC longlong
        getdstring NAME NAMESZ
        set FNAME string PATH
        string FNAME += NAME
        log FNAME OFFSET SIZE
    next j
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
open FDDE "tab" 0
open FDDE "arc" 1

set x360 long 0
get ARC_SIZE asize 1

get TAB_SIZE asize
get PAD_SIZE long   # 0x800
if PAD_SIZE >= 0x80000
    set x360 long 1
    endian big
    goto 0
    get PAD_SIZE long
endif
if PAD_SIZE != 0x800
    get PAD_SIZE long
    get DUMMY long
endif
for
    savepos CURR_OFF
    if CURR_OFF >= TAB_SIZE
        cleanexit
    endif
    get NAME_CRC long
    get OFFSET long
    get SIZE long
    if x360 != 0
        math OFFSET *= 0x800
    endif

    math TMP = OFFSET
    math TMP += SIZE
    if TMP u<= ARC_SIZE # unsigned comparison, work-around for x360
        callfunction COOL_DUMP
    endif
next

startfunction COOL_DUMP
    goto OFFSET 1
    getdstring SIGN 4 1
    goto OFFSET 1
    get SIGN1 byte 1
    goto OFFSET 1
    getdstring SIGN2 2 1
    goto OFFSET 1
    get SIGN4 long 1
    if SIGN == "DDS "
        set EXT string ".dds"
    elif SIGN == "WBND"
        set EXT string ".xwb"
    elif SIGN == "DNBW"
        set EXT string ".xwb"
    elif SIGN == "RIFF"
        set EXT string ".wav"
    elif SIGN == "FEV1"
        set EXT string ".fev"
    elif SIGN == "FSB4"
        set EXT string ".fsb"
    elif SIGN == "W��W"
        set EXT string ".WaaW"
    elif SIGN == "VER"
        set EXT string ".ver"
    elif SIGN4 == 4
        set EXT string ".sarc"
    elif SIGN4 == 5
        set EXT string ".rbmd"
    elif SIGN4 == 12
        set EXT string ".12"
    elif SIGN2 == "BM"
        set EXT string ".bmp"
    elif SIGN2 == "//"
        set EXT string ".psh"
    elif SIGN1 == 0x3c
        set EXT string ".xml"
    elif SIGN1 == 0x78
        set EXT string ".offzip"
    elif SIGN1 == 0x01
        set EXT string ".obj"
    else
        #set EXT string ".dat"
        set EXT string "."
        string EXT += SIGN
    endif

    set NAME string NAME_CRC
    string NAME += EXT
    log NAME OFFSET SIZE 1
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
set MAS_TYPE0 binary "GMOTORMAS10\0\0\0\0\0"
set MAS_TYPE1 binary "\xC8\xCF\xD2\xD8\xCE\xD8\xE6\xC9\xCA\xDD\xD8\xBE\xBB\xA6\xBF\x90"
set MAS_TYPE3 binary "CUBEMAS4.10\0\0\0\0\0"
set SRW_TYPE  binary "SRW0000"
set FILES_SIZE long 256

getdstring SIGN 16
if SIGN == MAS_TYPE0
    set MAS_TYPE long 0
elif SIGN == MAS_TYPE1
    set MAS_TYPE long 1
    get DUMMY long
elif SIGN == MAS_TYPE3
    set MAS_TYPE long 3
else
    goto 0
    getdstring SIGN 7
    if SIGN == SRW_TYPE
        print "use my simraceway.bms script on this archive\nthen use mas.bms on the obtained decrypted output file"
        cleanexit
    endif

    goto 0
    getdstring SIGN 3
    if SIGN == "IFD"
        get MAS_TYPE long   # ??? (tested with 1 only)
        get DUMMY long
    else
        set MAS_TYPE long 2
        set FILES_SIZE long 0x20
        goto 0
    endif
endif
print "set MAS_TYPE %MAS_TYPE%"

get FILES long
get DATA_SIZE long
math ZSIZE = 0
if SIGN == "IFD"
    get ZSIZE long
endif

savepos OFFSET
math BASE_OFF = FILES
math BASE_OFF *= FILES_SIZE
if ZSIZE == 0
    log MEMORY_FILE OFFSET BASE_OFF
else
    clog MEMORY_FILE OFFSET ZSIZE BASE_OFF
    math BASE_OFF = ZSIZE
endif
math BASE_OFF += OFFSET

for i = 0 < FILES
    if MAS_TYPE == 0
        get DUMMY long MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get ZSIZE long MEMORY_FILE
        getdstring NAME 240 MEMORY_FILE
    elif MAS_TYPE == 1
        get DUMMY long MEMORY_FILE
        getdstring NAME 236 MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get ZSIZE long MEMORY_FILE
        get DUMMY long MEMORY_FILE
    elif MAS_TYPE == 2
        getdstring NAME 0x10 MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get ZSIZE long MEMORY_FILE
        get DUMMY long MEMORY_FILE
    elif MAS_TYPE == 3
        get DUMMY long MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get ZSIZE long MEMORY_FILE
        get DUMMY long MEMORY_FILE
        getdstring NAME 236 MEMORY_FILE
    endif

    math OFFSET += BASE_OFF
    if ZSIZE == 0
        math ZSIZE = SIZE
    endif
    if SIZE == ZSIZE
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get JBR_SIZE asize
get FULLSIZE long
goto FULLSIZE

    callfunction GETNAME 1
    get OFFSET2 long
do
    set FNAME string NAME
    math OFFSET = OFFSET2
    savepos CURR
    if CURR < JBR_SIZE
        callfunction GETNAME 1
        get OFFSET2 long
    else
        math OFFSET2 = FULLSIZE
    endif
    math SIZE = OFFSET2
    math SIZE -= OFFSET
    set EXT extension FNAME
    if EXT == "xml"
        set CRYPT = 1
    elif EXT == "inc"
        set CRYPT = 1
    elif EXT == "txt"
        set CRYPT = 1
    else
        set CRYPT = 0
    endif
    if CRYPT != 0
        encryption xor "\xd1\xc7"
    endif
    log FNAME OFFSET SIZE
    encryption "" ""
while CURR < JBR_SIZE

startfunction GETNAME
    set NAME string ""
    for j = 0
        get T byte
        if T == 0
            break
        endif
        if j & 1
            math T ^= 0xc7
        else
            math T ^= 0xd1
        endif
        putvarchr NAME j T
    next j
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.5

get EXT extension
if EXT != "kcp"
    print "you must select the KCP file!"
    cleanexit
endif

# yes I know that this part is lame
set KCS_NAME string ""
get PATH file_folder
do
    scandir PATH NAME SIZE
    if NAME == ""
        break
    endif
    set EXT extension NAME
    if EXT == "kcs"
        set TMP filename NAME
        string TMP &= "0.kcs"
        if TMP == "0.kcs"
            set TMP basename NAME
            strlen TMPLEN TMP
            math TMPLEN -= 2
            getvarchr TMP TMP TMPLEN
            if TMP > 0x39   # kpp or packfile_
                set NAME basename NAME
                string NAME -= 1
                set KCS_NAME string NAME
                string KCS_NAME += "%d.KCS"
            endif
        endif
    endif
while KCS_NAME == ""
if KCS_NAME == ""
    set KCS_NAME string "KFClient_PackFile_%d.KCS"
endif
print "KCS_NAME format %KCS_NAME%"

# Fighter uses zlib, PangPang uses lzo
string NAME p= KCS_NAME 0
open FDSE NAME 1
get TMP byte 1
if TMP != 0x78
    comtype lzo1x
endif

get DUMMY long
get DUMMY long
get END_STUFF long
get DUMMY long
get DUMMY byte
math END_STUFF *= 0x10
get FULL_SIZE asize
math FULL_SIZE -= END_STUFF
set PATH string ""
savepos CURR_OFF
for CURR_OFF = CURR_OFF < FULL_SIZE
    get DUMMY long
    get TYPE long
    get NAMES long
    get PATHSZ long
    if PATHSZ u> 0xffff
        getdstring DUMMY 8
        get PACK long
        get NAMESZ short
        get SIZE long
        get ZSIZE long
        get OFFSET long
        getdstring NAME NAMESZ
        set FNAME string PATH
        string FNAME += /
        string FNAME += NAME

        string NAME p= KCS_NAME PACK
        open FDSE NAME 1
        clog FNAME OFFSET ZSIZE SIZE 1
    else
        get NAMESZ long
        math NAMESZ += PATHSZ
        getdstring NAME NAMESZ
        set PATH string NAME
        for j = 0 < NAMES
            get NAMESZ long
            getdstring NAME NAMESZ
        next j
    endif
    savepos CURR_OFF
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.3.12

# the following is the only addition in version 0.2.1 for handling single files
getdstring SIGN 23
if SIGN == "KingArthur Crypted File"
    set BASE_OFFSET long 0
    get SIZE asize
    get NAME filename
    callfunction quick_decrypt_unzip
    cleanexit
endif
goto 0

get DUMMY long
get INFO_SIZE long
savepos BASE_OFFSET
log MEMORY_FILE BASE_OFFSET INFO_SIZE
math BASE_OFFSET += INFO_SIZE

callfunction read_numbits 1
math FILES = NUM    # max is 0x7b301e?

for i = 0 < FILES
    callfunction read_numbits 1
    math NAMESZ = NUM
    math NAMESZ *= 8
    getbits NAME NAMESZ MEMORY_FILE

    callfunction read_numbits 1
    math SIZE = NUM

    callfunction read_numbits 1
    math DUMMY = NUM

    callfunction quick_decrypt_unzip
    math BASE_OFFSET += SIZE
next i

# boring reading, it's a mix of big and little endian... blah
startfunction read_numbits
    endian big
    getbits BITS 3 MEMORY_FILE
    math BITS += 1
    getbits BITSX 1 MEMORY_FILE
    if BITS == 1
        getbits NUM 8 MEMORY_FILE
    elif BITS == 2
        getbits NUM 16 MEMORY_FILE
        reverseshort NUM
    elif BITS == 4
        getbits NUM 32 MEMORY_FILE
        reverselong NUM
    elif BITS == 8
        getbits NUM 64 MEMORY_FILE
        reverselong NUM # not supported!
    else
        print "Error: wrong bit size %BITS%"
        cleanexit
    endif
endfunction

# yeah, do the job on the fly without using zip.bms!
startfunction quick_decrypt_unzip
    endian little
    goto BASE_OFFSET
    if SIZE >= 23
        getdstring SIGN 23
    endif
    if SIZE < 23
        log NAME BASE_OFFSET SIZE
    else if SIGN == "KingArthur Crypted File"
        math BASE_OFFSET += 23
        math SIZE -= 23
        encryption CryptDecrypt "3s  4 f^%I8le988( &&  5t3td&&D dv g3)&G 6k4788s6   s w y7R D2d 277 dSW2fe8r 8%*B3s&gw4fiHD3 w7it2&GW6 * 33+o* 7d5fu7  WH7k&h746 &W1l3gg9fG^D d*4 3%g&(8s h78eH& 2s534 * **4fev 4wJ W4 4g3g&U &1drryy G^H"
        log MEMORY_FILE2 BASE_OFFSET SIZE
        encryption "" ""
        get sign long MEMORY_FILE2
        if sign != 0x04034b50
            print "Error: wrong PKzip signature %sign%, contact me"
            cleanexit
        endif
        get ver short MEMORY_FILE2
        get flag short MEMORY_FILE2
        get method short MEMORY_FILE2
        get modtime short MEMORY_FILE2
        get moddate short MEMORY_FILE2
        get crc long MEMORY_FILE2
        get comp_size long MEMORY_FILE2
        get uncomp_size long MEMORY_FILE2
        get name_len short MEMORY_FILE2
        get extra_len short MEMORY_FILE2
        getdstring name_zip name_len MEMORY_FILE2   # use the original name!
        getdstring extra extra_len MEMORY_FILE2
        savepos offset MEMORY_FILE2
        # clog NAME OFFSET comp_size uncomp_size MEMORY_FILE2
        if method == 0
            Log name offset uncomp_size MEMORY_FILE2
        else
            if method == 8
                ComType deflate
            elif method == 1
                ComType unshrink
            elif method == 6
                ComType explode
            elif method == 9
                ComType deflate64
            elif method == 12
                ComType bzip2
            elif method == 14
                ComType lzmaefs
            elif method == 21
                ComType XMemDecompress
            elif method == 98
                ComType ppmd
            else
                print "unsupported compression method %method%"
                cleanexit
            endif
            CLog name offset comp_size uncomp_size MEMORY_FILE2
        endif
    else
        log NAME BASE_OFFSET SIZE
    endif
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.4.6a
idstring "KOG "
get SIGN string
set VER string SIGN
string VER &= "V."
string VER -= -5
string SIGN >>= " MASSFILE"
goto 0x34
get FILES long

if VER == "V.0.1"   # it's the same of 0.2
    set VER string "V.0.2"
endif

if SIGN == "THINCLIENT"
    if VER == "V.0.2"
        get DUMMY long
        get SIZE long
        get DUMMY long
        savepos OFFSET
        math OFFSET += SIZE
        for i = 0 < FILES
            get DUMMY long
        next i
    else
        print "Error: unsupported KOM version (%VER% / %SIGN%)"
        cleanexit
    endif

    for i = 0 < FILES
        get NAMESZ byte
        getdstring NAME NAMESZ
        get SIZE long
        get ZSIZE long
        get ZIP byte
        if ZIP == 0
            log NAME OFFSET SIZE
        else
            clog NAME OFFSET ZSIZE SIZE
        endif
        math OFFSET += ZSIZE
    next i
else
    if VER == "V.0.2"
        get DUMMY long
        savepos BASE_OFF
        math TMP = FILES
        math TMP *= 0x48
        math BASE_OFF += TMP
    elif VER == "V.0.3"
        get DUMMY long
        getdstring DUMMY 8
        get XMLSZ long
        savepos OFFSET
        log MEMORY_FILE OFFSET XMLSZ
        math OFFSET += XMLSZ
    elif VER == "V.0.4"
        get KEY long
        getdstring DUMMY 8
        get XMLSZ long
        savepos OFFSET
        if KEY == 0xb290207
            set KEY long 0x6e0acdeb # 64bit number (%lld)
        else
            print "Error: unkown relative key value (%KEY%)"
            cleanexit
        endif
        encryption sha1 ""
        string KEY E= KEY
        encryption bf_ecb QUICKBMS_HASH "" 0 20
        log MEMORY_FILE OFFSET XMLSZ
        encryption "" ""
        math OFFSET += XMLSZ
    else
        print "Error: unsupported KOM version (%VER% / %SIGN%)"
        cleanexit
    endif

    for i = 0 < FILES
        if VER == "V.0.2"
            getdstring NAME 0x3c
            get SIZE long
            get ZSIZE long
            get OFFSET long
            math OFFSET += BASE_OFF
            set ALGO long 0
        else
            findloc TMP string "Name=" MEMORY_FILE
            math TMP += 4
            goto TMP MEMORY_FILE
            for j = 0 < 6
                findloc TMP string "=" MEMORY_FILE
                math TMP += 2
                goto TMP MEMORY_FILE
                getct TMP string 0x22 MEMORY_FILE
                putarray 0 j TMP
            next j

            getarray NAME 0 0
            getarray SIZE 0 1
            getarray ZSIZE 0 2
            getarray ALGO 0 5
        endif

        if ALGO == 0
            clog NAME OFFSET ZSIZE SIZE
        else
            print "unknown algorithm %ALGO%, contact me"
            cleanexit
        endif
        math OFFSET += ZSIZE
    next i
endif


Source: http://aluigi.altervista.org/quickbms.htm
Script:
goto -4
get OFFSET long
goto OFFSET
get FILES long

for i = 0 < FILES
   get NAMELEN long
   getdstring NAME NAMELEN
   get OFFSET long
   get SIZE long

   log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring HEADER 127
get VERSION long
get OFFSET long
get SIZE long

set NAME string ""
set PATH string ""
callfunction EXTRACT

startfunction EXTRACT
    string PATH += NAME
    string PATH += /

    savepos OLD_OFF
    goto OFFSET
    math LIMIT = OFFSET
    math LIMIT += SIZE

    for POS = OFFSET < LIMIT
        get TYPE long
        if TYPE == 0    # file
            get OFFSET long
            get SIZE long
            get TSTAMP long
            get FILEID long

            getdstring DUMMY1 1 # in quickbms 0.4.6 it's enough string EXT r= EXT
            getdstring DUMMY2 1
            getdstring DUMMY3 1
            getdstring DUMMY4 1
            set EXT string DUMMY4
            string EXT += DUMMY3
            string EXT += DUMMY2
            string EXT += DUMMY1

            get ZERO long
            get NAME string
            get DUMMY string    # ???

            set FULLNAME string PATH
            string FULLNAME += NAME
            string FULLNAME += .
            string FULLNAME += EXT
            log FULLNAME OFFSET SIZE
        else            # folder
            get OFFSET long
            get SIZE long
            get TSTAMP long
            get NAME string

            callfunction EXTRACT
        endif
        savepos POS
    next

    goto OLD_OFF
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "KAPL"
get VERSION long
get TABLE_OFF long
get INFO_OFF long
get NAME_OFF long
get FILE_OFF long
get TABLE_SIZE long
get INFO_SIZE long
get NAME_SIZE long
get FILE_SIZE long
get PAK_SIZE long
get DUMMY long

log MEMORY_FILE NAME_OFF NAME_SIZE
comtype deflate
set FILES long INFO_SIZE
math FILES /= 32
goto INFO_OFF

set AUTO_TUNE long -1
for i = 0 < FILES
    get OFFSET long
    math OFFSET += FILE_OFF
    get NAMEOFF long
    get ZSIZE long
    get SIZE long
    get TYPE long
    if AUTO_TUNE < 0
        savepos TMP
        do
            math AUTO_TUNE += 1
            get DUMMY long
        while DUMMY != ZSIZE
        goto TMP
    endif
    for x = 0 < AUTO_TUNE
        get DUMMY long
    next x

    goto NAMEOFF MEMORY_FILE
    get NAME string MEMORY_FILE

    if TYPE == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.4
get SIGN long

get NAME basename
string NAME += ".pak"
string NAME l= NAME     # all tolower
get SIZE asize
log MEMORY_FILE 0 SIZE
if SIGN == 0x04034b50   # AES must be aligned to 16 bytes
    math SIZE += 15
    math SIZE &= 0xfffffff0
    putvarchr MEMORY_FILE SIZE 0
endif

strlen NAMESZ NAME
math MD5_SIZE = NAMESZ
math MD5_SIZE += 4
putvarchr MEMORY_FILE2 MD5_SIZE 0
goto 0 MEMORY_FILE2
putdstring NAME NAMESZ MEMORY_FILE2
put SIZE long MEMORY_FILE2
encryption md5 ""
log MEMORY_FILE2 0 MD5_SIZE MEMORY_FILE2
encryption "" ""

set MYKEY binary "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
# the following dll is the result of http://aluigi.org/papers/bms/majesty2_hash2key.c
set MEMORY_FILE3 binary "\x4d\x5a\x90\x00\x03\x00\x00\x00\x04\x00\x00\x00\xff\xff\x00\x00\xb8\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x0e\x1f\xba\x0e\x00\xb4\x09\xcd\x21\xb8\x01\x4c\xcd\x21\x54\x68\x69\x73\x20\x70\x72\x6f\x67\x72\x61\x6d\x20\x63\x61\x6e\x6e\x6f\x74\x20\x62\x65\x20\x72\x75\x6e\x20\x69\x6e\x20\x44\x4f\x53\x20\x6d\x6f\x64\x65\x2e\x0d\x0d\x0a\x24\x00\x00\x00\x00\x00\x00\x00\x50\x45\x00\x00\x4c\x01\x0a\x00\x91\x75\xc3\x4b\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x0e\x23\x0b\x01\x02\x38\x00\x0e\x00\x00\x00\x32\x00\x00\x00\x02\x00\x00\xc0\x10\x00\x00\x00\x10\x00\x00\x00\x20\x00\x00\x00\x00\x88\x64\x00\x10\x00\x00\x00\x02\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x00\x00\x00\x04\x00\x00\x63\xd2\x00\x00\x03\x00\x00\x00\x00\x00\x20\x00\x00\x10\x00\x00\x00\x00\x10\x00\x00\x10\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x70\x00\x00\xac\x01\x00\x00\x00\x80\x00\x00\x30\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0\x00\x00\x40\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa0\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x2e\x74\x65\x78\x74\x00\x00\x00\x10\x0d\x00\x00\x00\x10\x00\x00\x00\x0e\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x60\x00\x50\x60\x2e\x64\x61\x74\x61\x00\x00\x00\xe8\x13\x00\x00\x00\x20\x00\x00\x00\x14\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x60\xc0\x2e\x72\x64\x61\x74\x61\x00\x00\x50\x01\x00\x00\x00\x40\x00\x00\x00\x02\x00\x00\x00\x26\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x30\x40\x2e\x65\x68\x5f\x66\x72\x61\x6d\x04\x00\x00\x00\x00\x50\x00\x00\x00\x02\x00\x00\x00\x28\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x30\xc0\x2e\x62\x73\x73\x00\x00\x00\x00\x14\x01\x00\x00\x00\x60\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x40\xc0\x2e\x65\x64\x61\x74\x61\x00\x00\xac\x01\x00\x00\x00\x70\x00\x00\x00\x02\x00\x00\x00\x2a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x30\x40\x2e\x69\x64\x61\x74\x61\x00\x00\x30\x03\x00\x00\x00\x80\x00\x00\x00\x04\x00\x00\x00\x2c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x30\xc0\x2e\x43\x52\x54\x00\x00\x00\x00\x18\x00\x00\x00\x00\x90\x00\x00\x00\x02\x00\x00\x00\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x30\xc0\x2e\x74\x6c\x73\x00\x00\x00\x00\x20\x00\x00\x00\x00\xa0\x00\x00\x00\x02\x00\x00\x00\x32\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x30\xc0\x2e\x72\x65\x6c\x6f\x63\x00\x00\x40\x01\x00\x00\x00\xb0\x00\x00\x00\x02\x00\x00\x00\x34\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x30\x42\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x18\x8b\x45\x08\xc7\x44\x24\x08\x10\x60\x88\x64\xc7\x44\x24\x04\x00\x60\x88\x64\x89\x04\x24\xe8\xff\x0b\x00\x00\xc9\xc3\x8d\xb6\x00\x00\x00\x00\x8d\xbc\x27\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x18\x8b\x45\x08\xc7\x44\x24\x08\x10\x60\x88\x64\xc7\x44\x24\x04\x00\x60\x88\x64\x89\x04\x24\xe8\xcf\x0b\x00\x00\xc9\x83\xf8\x01\x19\xc0\xc3\x90\x8d\xb4\x26\x00\x00\x00\x00\x55\x89\xe5\x53\x83\xec\x14\x8b\x15\x00\x60\x88\x64\x85\xd2\x74\x34\x8b\x1d\x10\x60\x88\x64\x83\xeb\x04\x39\xda\x77\x15\x8b\x03\x85\xc0\x74\xf3\xff\xd0\x8b\x15\x00\x60\x88\x64\x83\xeb\x04\x39\xda\x76\xeb\x89\x14\x24\xe8\x8d\x0b\x00\x00\xc7\x05\x00\x60\x88\x64\x00\x00\x00\x00\xc7\x04\x24\x00\x00\x00\x00\xe8\x7f\x0b\x00\x00\x83\xc4\x14\x5b\x5d\xc3\x89\xf6\x8d\xbc\x27\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x38\x89\x5d\xf4\x8b\x5d\x0c\x89\x75\xf8\x8b\x75\x08\x89\x7d\xfc\x8b\x7d\x10\x83\xfb\x01\x74\x43\x89\x7c\x24\x08\x89\x5c\x24\x04\x89\x34\x24\xe8\x93\x03\x00\x00\x83\xec\x0c\x85\xdb\x75\x19\x8b\x15\x00\x60\x88\x64\x85\xd2\x0f\x84\x8e\x00\x00\x00\x89\x45\xe4\xe8\x56\xff\xff\xff\x8b\x45\xe4\x8b\x5d\xf4\x8b\x75\xf8\x8b\x7d\xfc\x89\xec\x5d\xc2\x0c\x00\x8d\x74\x26\x00\xc7\x04\x24\x80\x00\x00\x00\xe8\x0c\x0b\x00\x00\x85\xc0\xa3\x00\x60\x88\x64\x74\x62\xc7\x00\x00\x00\x00\x00\xa3\x10\x60\x88\x64\xa1\xa0\x40\x88\x64\x85\xc0\x74\x14\x89\x7c\x24\x08\xc7\x44\x24\x04\x02\x00\x00\x00\x89\x34\x24\xff\xd0\x83\xec\x0c\xe8\x4e\x06\x00\x00\xe8\x89\x08\x00\x00\x89\x7c\x24\x08\xc7\x44\x24\x04\x01\x00\x00\x00\x89\x34\x24\xe8\x05\x03\x00\x00\x83\xec\x0c\x85\xc0\x75\x8b\xe8\xd9\xfe\xff\xff\x31\xc0\xeb\x82\x90\x8d\x74\x26\x00\x31\xc0\xe9\x76\xff\xff\xff\xe8\xa4\x0a\x00\x00\xc7\x00\x0c\x00\x00\x00\x31\xc0\xe9\x64\xff\xff\xff\x90\x90\x90\x90\x90\x90\x90\x55\x89\xe5\x83\xec\x18\xc7\x04\x24\x00\x40\x88\x64\xe8\xae\x0a\x00\x00\x52\x85\xc0\x74\x65\xc7\x44\x24\x04\x13\x40\x88\x64\x89\x04\x24\xe8\xa1\x0a\x00\x00\x83\xec\x08\x85\xc0\x74\x11\xc7\x44\x24\x04\x20\x60\x88\x64\xc7\x04\x24\x00\x50\x88\x64\xff\xd0\x8b\x0d\xe4\x33\x88\x64\x85\xc9\x74\x31\xc7\x04\x24\x29\x40\x88\x64\xe8\x6b\x0a\x00\x00\x52\x85\xc0\x74\x2a\xc7\x44\x24\x04\x37\x40\x88\x64\x89\x04\x24\xe8\x5e\x0a\x00\x00\x83\xec\x08\x85\xc0\x74\x09\xc7\x04\x24\xe4\x33\x88\x64\xff\xd0\xc9\xc3\xb8\x00\x00\x00\x00\xeb\xa7\x90\xb8\x00\x00\x00\x00\xeb\xe2\x90\x55\x89\xe5\x83\xec\x18\xc7\x04\x24\x00\x40\x88\x64\xe8\x22\x0a\x00\x00\x51\x85\xc0\x74\x25\xc7\x44\x24\x04\x4b\x40\x88\x64\x89\x04\x24\xe8\x15\x0a\x00\x00\x83\xec\x08\x85\xc0\x74\x09\xc7\x04\x24\x00\x50\x88\x64\xff\xd0\xc9\xc3\x8d\x76\x00\xb8\x00\x00\x00\x00\xeb\xe7\x90\x55\x89\xe5\x83\xec\x18\x89\x75\xfc\x8b\x75\x0c\x89\x5d\xf8\xc7\x44\x24\x0c\x40\x00\x00\x00\xc7\x44\x24\x08\x00\x30\x00\x00\x8d\x86\xff\x0f\x00\x00\x25\x00\xf0\xff\xff\x89\x44\x24\x04\xc7\x04\x24\x00\x00\x00\x00\xe8\xc6\x09\x00\x00\x89\xc3\x8b\x45\x08\x83\xec\x10\x89\x74\x24\x08\x89\x1c\x24\x89\x44\x24\x04\xe8\x76\x09\x00\x00\x89\xd8\x8b\x75\xfc\x8b\x5d\xf8\x89\xec\x5d\xc2\x08\x00\x55\x89\xe5\x83\xec\x18\xa1\x38\x60\x88\x64\x85\xc0\x74\x16\xc7\x05\x3c\x60\x88\x64\x86\x06\x00\x00\xc7\x05\x40\x60\x88\x64\x00\x00\x00\x00\xc9\xc3\xc7\x44\x24\x04\xc9\x13\x00\x00\xc7\x04\x24\x00\x20\x88\x64\xe8\x67\xff\xff\xff\x8d\x50\x70\x83\xec\x08\xa3\x38\x60\x88\x64\x89\x90\x64\x03\x00\x00\x8d\x90\x81\x03\x00\x00\x89\x90\x6f\x03\x00\x00\x8d\x50\x10\xc7\x42\x04\x90\x90\x90\x90\xc7\x42\x08\x90\x90\x90\x90\xc6\x40\x10\xb8\xc7\x40\x11\x30\x9a\x5a\x9b\xc6\x80\x57\x02\x00\x00\x90\xc6\x80\x58\x02\x00\x00\xba\xc7\x80\x59\x02\x00\x00\x3c\x60\x88\x64\xa1\x38\x60\x88\x64\xe9\x7b\xff\xff\xff\x8d\xb6\x00\x00\x00\x00\x8d\xbf\x00\x00\x00\x00\x55\x31\xc0\x89\xe5\x57\x8b\x7d\x0c\x56\x8b\x55\x08\x53\x85\xff\x7e\x1b\x89\xc6\x8d\x58\x0f\x0f\xb6\x4c\x02\x01\x30\x0c\x02\x83\xc0\x01\x39\xc3\x75\xf1\x8d\x46\x10\x39\xc7\x7f\xe5\x5b\x5e\x5f\x5d\xc2\x08\x00\x8d\xb6\x00\x00\x00\x00\x8d\xbf\x00\x00\x00\x00\x55\x89\xe5\x56\x8b\x75\x0c\x53\x8b\x55\x08\x85\xf6\x7e\x1b\x31\xdb\x8d\x43\x0f\x0f\xb6\x4c\x02\xff\x30\x0c\x02\x83\xe8\x01\x39\xd8\x75\xf1\x83\xc3\x10\x39\xde\x7f\xe7\x5b\x5e\x5d\xc2\x08\x00\x55\x89\xe5\x8b\x45\x0c\x56\x8b\x55\x08\x53\x85\xc0\x7e\x2a\x83\xe8\x01\xbb\x10\x00\x00\x00\x83\xe0\xf0\x8d\x70\x20\x8d\x76\x00\x8d\x43\xf1\x0f\xb6\x4c\x02\xff\x30\x0c\x02\x83\xc0\x01\x39\xd8\x75\xf1\x83\xc3\x10\x39\xf3\x75\xe7\x5b\x5e\x5d\xc2\x08\x00\x90\x55\x89\xe5\x57\x8b\x7d\x0c\x56\x8b\x55\x08\x53\x85\xff\x7e\x2b\x83\xef\x01\xbe\x0e\x00\x00\x00\x83\xe7\xf0\x83\xc7\x1e\x66\x90\x89\xf0\x8d\x5e\xf1\x0f\xb6\x4c\x02\x01\x30\x0c\x02\x83\xe8\x01\x39\xd8\x75\xf1\x83\xc6\x10\x39\xfe\x75\xe5\x5b\x5e\x5f\x5d\xc2\x08\x00\x8d\xb4\x26\x00\x00\x00\x00\x8d\xbc\x27\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x18\x83\x7d\x0c\x01\x75\x0e\x8b\x45\x08\x89\x04\x24\xe8\xf1\x07\x00\x00\x83\xec\x04\xb8\x01\x00\x00\x00\xc9\xc2\x0c\x00\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x55\x31\xc0\x89\xe5\x5d\xc3\x89\xf6\x8d\xbc\x27\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x18\x8b\x45\x0c\x85\xc0\x75\x23\x8b\x55\x10\x89\x44\x24\x04\x89\x54\x24\x08\x8b\x45\x08\x89\x04\x24\xe8\xad\x05\x00\x00\xb8\x01\x00\x00\x00\xc9\xc2\x0c\x00\x8d\x74\x26\x00\x83\xf8\x03\x74\xd8\xb8\x01\x00\x00\x00\xc9\xc2\x0c\x00\x66\x90\x55\x89\xe5\x53\x83\xec\x14\x8b\x15\xf4\x80\x88\x64\x8b\x45\x0c\x83\x3a\x03\x76\x31\x83\x3d\x88\x60\x88\x64\x02\x74\x0a\xc7\x05\x88\x60\x88\x64\x02\x00\x00\x00\x83\xf8\x02\x0f\x84\x05\x01\x00\x00\x83\xf8\x01\x0f\x84\x9e\x00\x00\x00\xb8\x01\x00\x00\x00\x8b\x5d\xfc\xc9\xc2\x0c\x00\xc7\x05\xf4\x60\x88\x64\x01\x00\x00\x00\xc7\x04\x24\x64\x40\x88\x64\xe8\x34\x07\x00\x00\x83\xec\x04\x85\xc0\xa3\x58\x60\x88\x64\x0f\x84\xfa\x00\x00\x00\xc7\x44\x24\x04\x71\x40\x88\x64\x89\x04\x24\xe8\xfc\x06\x00\x00\x83\xec\x08\xa3\xe4\x60\x88\x64\xc7\x44\x24\x04\x8c\x40\x88\x64\xa1\x58\x60\x88\x64\x89\x04\x24\xe8\xdf\x06\x00\x00\xa3\xd4\x60\x88\x64\xa1\x58\x60\x88\x64\x83\xec\x08\x85\xc0\x0f\x84\xb8\x00\x00\x00\x8b\x0d\xe4\x60\x88\x64\x85\xc9\x74\x3f\x8b\x15\xd4\x60\x88\x64\x85\xd2\x74\x35\xc7\x05\x88\x60\x88\x64\x01\x00\x00\x00\xb8\x01\x00\x00\x00\x8b\x5d\xfc\xc9\xc2\x0c\x00\x8b\x45\x10\xc7\x44\x24\x04\x01\x00\x00\x00\x89\x44\x24\x08\x8b\x45\x08\x89\x04\x24\xe8\x9e\x04\x00\x00\xe9\x43\xff\xff\xff\xc7\x05\xd4\x60\x88\x64\x00\x00\x00\x00\xc7\x05\xe4\x60\x88\x64\x00\x00\x00\x00\x89\x04\x24\xe8\x85\x06\x00\x00\x83\xec\x04\xc7\x05\x58\x60\x88\x64\x00\x00\x00\x00\xb8\x01\x00\x00\x00\xc7\x05\x88\x60\x88\x64\x00\x00\x00\x00\x8b\x5d\xfc\xc9\xc2\x0c\x00\xbb\x14\x90\x88\x64\x81\xfb\x14\x90\x88\x64\x0f\x84\xf3\xfe\xff\xff\x8b\x03\x85\xc0\x74\x02\xff\xd0\x83\xc3\x04\x81\xfb\x14\x90\x88\x64\x75\xed\xb8\x01\x00\x00\x00\x8b\x5d\xfc\xc9\xc2\x0c\x00\xc7\x05\xd4\x60\x88\x64\x00\x00\x00\x00\xc7\x05\xe4\x60\x88\x64\x00\x00\x00\x00\xeb\x9a\x90\x90\x90\x90\x55\x89\xe5\x83\xec\x18\x89\x5d\xf8\x8b\x1d\xf0\x80\x88\x64\x89\x75\xfc\x8d\x75\x0c\xc7\x44\x24\x08\x17\x00\x00\x00\xc7\x44\x24\x04\x01\x00\x00\x00\x83\xc3\x40\x89\x5c\x24\x0c\xc7\x04\x24\xa4\x40\x88\x64\xe8\x98\x05\x00\x00\x8b\x45\x08\x89\x74\x24\x08\x89\x1c\x24\x89\x44\x24\x04\xe8\x8d\x05\x00\x00\xe8\x90\x05\x00\x00\x55\x89\xe5\x83\xec\x48\x85\xc9\x89\x5d\xf4\x89\xc3\x89\x75\xf8\x89\xd6\x89\x7d\xfc\x89\xcf\x75\x0d\x8b\x5d\xf4\x8b\x75\xf8\x8b\x7d\xfc\x89\xec\x5d\xc3\x8d\x45\xc8\xc7\x44\x24\x08\x1c\x00\x00\x00\x89\x44\x24\x04\x89\x1c\x24\xe8\x93\x05\x00\x00\x83\xec\x0c\x85\xc0\x74\x76\x8b\x45\xdc\x83\xf8\x04\x74\x29\x83\xf8\x40\x74\x24\x8d\x45\xe4\x89\x44\x24\x0c\x8b\x45\xd4\xc7\x44\x24\x08\x40\x00\x00\x00\x89\x44\x24\x04\x8b\x45\xc8\x89\x04\x24\xe8\x66\x05\x00\x00\x83\xec\x10\x89\x7c\x24\x08\x89\x74\x24\x04\x89\x1c\x24\xe8\xf3\x04\x00\x00\x8b\x45\xdc\x83\xf8\x04\x74\x8c\x83\xf8\x40\x74\x87\x8d\x45\xe4\x89\x44\x24\x0c\x8b\x45\xe4\x89\x44\x24\x08\x8b\x45\xd4\x89\x44\x24\x04\x8b\x45\xc8\x89\x04\x24\xe8\x26\x05\x00\x00\x83\xec\x10\xe9\x5f\xff\xff\xff\x89\x5c\x24\x08\xc7\x44\x24\x04\x1c\x00\x00\x00\xc7\x04\x24\xbc\x40\x88\x64\xe8\xde\xfe\xff\xff\x8d\xb4\x26\x00\x00\x00\x00\x8d\xbc\x27\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x38\xa1\x68\x60\x88\x64\x89\x5d\xf4\x89\x75\xf8\x89\x7d\xfc\x85\xc0\x74\x0d\x8b\x5d\xf4\x8b\x75\xf8\x8b\x7d\xfc\x89\xec\x5d\xc3\xb8\x50\x41\x88\x64\x2d\x50\x41\x88\x64\x83\xf8\x07\xc7\x05\x68\x60\x88\x64\x01\x00\x00\x00\x7e\xda\x83\xf8\x0b\xbb\x50\x41\x88\x64\x7e\x28\x8b\x3d\x50\x41\x88\x64\x85\xff\x75\x1e\x8b\x35\x54\x41\x88\x64\x85\xf6\x75\x14\x8b\x0d\x58\x41\x88\x64\x85\xc9\x75\x0a\xbb\x5c\x41\x88\x64\x90\x8d\x74\x26\x00\x8b\x13\x85\xd2\x75\x5c\x8b\x43\x04\x85\xc0\x75\x55\x8b\x43\x08\x83\xf8\x01\x0f\x85\x0d\x01\x00\x00\x83\xc3\x0c\x81\xfb\x50\x41\x88\x64\x73\x84\xbe\x00\x00\x88\x64\x8b\x43\x04\x8b\x0b\x0f\xb6\x53\x08\x01\xf0\x01\xf1\x83\xfa\x10\x8b\x39\x74\x63\x83\xfa\x20\x0f\x84\x9a\x00\x00\x00\x83\xfa\x08\x74\x75\xc7\x45\xe4\x00\x00\x00\x00\x89\x54\x24\x04\xc7\x04\x24\x24\x41\x88\x64\xe8\xfe\xfd\xff\xff\x81\xfb\x50\x41\x88\x64\x0f\x83\x3a\xff\xff\xff\xbe\x00\x00\x88\x64\x8d\x7d\xe0\x8b\x43\x04\xb9\x04\x00\x00\x00\x01\xf0\x8b\x10\x03\x13\x83\xc3\x08\x89\x55\xe0\x89\xfa\xe8\x1f\xfe\xff\xff\x81\xfb\x50\x41\x88\x64\x72\xdd\xe9\x0a\xff\xff\xff\x66\x90\x0f\xb7\x10\x66\x85\xd2\x78\x6f\x29\xca\x8d\x3c\x3a\x89\x7d\xe4\xb9\x02\x00\x00\x00\x8d\x55\xe4\xe8\xf3\xfd\xff\xff\xeb\x35\x90\x0f\xb6\x10\x84\xd2\x78\x41\x29\xca\x8d\x3c\x3a\x89\x7d\xe4\xb9\x01\x00\x00\x00\x8d\x55\xe4\xe8\xd4\xfd\xff\xff\xeb\x16\x66\x90\x03\x38\x8d\x55\xe4\x29\xcf\xb9\x04\x00\x00\x00\x89\x7d\xe4\xe8\xbc\xfd\xff\xff\x83\xc3\x0c\x81\xfb\x50\x41\x88\x64\x0f\x82\x26\xff\xff\xff\xe9\xa0\xfe\xff\xff\x81\xca\x00\xff\xff\xff\x29\xca\x01\xfa\x89\x55\xe4\xeb\xb8\x81\xca\x00\x00\xff\xff\x29\xca\x01\xfa\x89\x55\xe4\xeb\x8a\x89\x44\x24\x04\xc7\x04\x24\xf0\x40\x88\x64\xe8\x2a\xfd\xff\xff\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x55\x89\xe5\x83\xec\x08\xa1\xe0\x33\x88\x64\x8b\x00\x85\xc0\x74\x17\xff\xd0\xa1\xe0\x33\x88\x64\x8d\x50\x04\x8b\x40\x04\x89\x15\xe0\x33\x88\x64\x85\xc0\x75\xe9\xc9\xc3\x8d\xb6\x00\x00\x00\x00\x55\x89\xe5\x56\x53\x83\xec\x10\x8b\x1d\xfc\x1c\x88\x64\x83\xfb\xff\x74\x2d\x85\xdb\x74\x13\x8d\x34\x9d\xfc\x1c\x88\x64\x66\x90\xff\x16\x83\xee\x04\x83\xeb\x01\x75\xf6\xc7\x04\x24\x60\x19\x88\x64\xe8\x6a\xf6\xff\xff\x83\xc4\x10\x5b\x5e\x5d\xc3\x8d\x76\x00\x31\xdb\xeb\x02\x89\xc3\x8d\x43\x01\x8b\x14\x85\xfc\x1c\x88\x64\x85\xd2\x75\xf0\xeb\xbd\x8d\x76\x00\x8d\xbc\x27\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x08\x8b\x0d\x78\x60\x88\x64\x85\xc9\x74\x02\xc9\xc3\xc7\x05\x78\x60\x88\x64\x01\x00\x00\x00\xc9\xeb\x81\x90\x55\x89\xe5\x56\x53\x83\xec\x10\xa1\x90\x60\x88\x64\x85\xc0\x75\x07\x8d\x65\xf8\x5b\x5e\x5d\xc3\xc7\x04\x24\xa0\x60\x88\x64\xe8\x9c\x02\x00\x00\x8b\x1d\xc0\x60\x88\x64\x83\xec\x04\x85\xdb\x74\x2b\x8b\x03\x89\x04\x24\xe8\x65\x02\x00\x00\x83\xec\x04\x89\xc6\xe8\x63\x02\x00\x00\x85\xc0\x75\x0c\x85\xf6\x74\x08\x8b\x43\x04\x89\x34\x24\xff\xd0\x8b\x5b\x08\x85\xdb\x75\xd5\xc7\x04\x24\xa0\x60\x88\x64\xe8\x60\x02\x00\x00\x83\xec\x04\x8d\x65\xf8\x5b\x5e\x5d\xc3\x8d\xb4\x26\x00\x00\x00\x00\x8d\xbc\x27\x00\x00\x00\x00\x55\x89\xe5\x83\xec\x18\x8b\x45\x0c\x83\xf8\x01\x74\x42\x72\x11\x83\xf8\x03\x75\x05\xe8\x66\xff\xff\xff\xb8\x01\x00\x00\x00\xc9\xc3\xe8\x5a\xff\xff\xff\xa1\x90\x60\x88\x64\x83\xf8\x01\x75\xea\xc7\x05\x90\x60\x88\x64\x00\x00\x00\x00\xc7\x04\x24\xa0\x60\x88\x64\xe8\xea\x01\x00\x00\x83\xec\x04\xeb\xcf\x90\x8d\x74\x26\x00\xa1\x90\x60\x88\x64\x85\xc0\x74\x17\xc7\x05\x90\x60\x88\x64\x01\x00\x00\x00\xb8\x01\x00\x00\x00\xc9\xc3\x8d\xb6\x00\x00\x00\x00\xc7\x04\x24\xa0\x60\x88\x64\xe8\xbc\x01\x00\x00\x83\xec\x04\xeb\xd8\xeb\x0d\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x55\x89\xe5\x53\x83\xec\x14\xa1\x90\x60\x88\x64\x8b\x5d\x08\x85\xc0\x75\x0d\x31\xc0\x8b\x5d\xfc\xc9\xc3\x8d\xb6\x00\x00\x00\x00\xc7\x04\x24\xa0\x60\x88\x64\xe8\x84\x01\x00\x00\xa1\xc0\x60\x88\x64\x83\xec\x04\x85\xc0\x74\x17\x8b\x10\x39\xda\x75\x08\xeb\x44\x8b\x10\x39\xda\x74\x1f\x89\xc1\x8b\x40\x08\x85\xc0\x75\xf1\xc7\x04\x24\xa0\x60\x88\x64\xe8\x5d\x01\x00\x00\x83\xec\x04\x31\xc0\x8b\x5d\xfc\xc9\xc3\x8b\x50\x08\x89\x51\x08\x89\x04\x24\xe8\x95\x00\x00\x00\xc7\x04\x24\xa0\x60\x88\x64\xe8\x39\x01\x00\x00\x83\xec\x04\xeb\xda\x8b\x50\x08\x89\x15\xc0\x60\x88\x64\xeb\xdc\x90\x55\x89\xe5\x53\x83\xec\x14\xa1\x90\x60\x88\x64\x85\xc0\x75\x05\x8b\x5d\xfc\xc9\xc3\xc7\x44\x24\x04\x0c\x00\x00\x00\xc7\x04\x24\x01\x00\x00\x00\xe8\x8f\x00\x00\x00\x89\xc3\xb8\xff\xff\xff\xff\x85\xdb\x74\xdc\x8b\x45\x08\xc7\x04\x24\xa0\x60\x88\x64\x89\x03\x8b\x45\x0c\x89\x43\x04\xe8\xd5\x00\x00\x00\xa1\xc0\x60\x88\x64\x89\x1d\xc0\x60\x88\x64\x89\x43\x08\x83\xec\x04\xc7\x04\x24\xa0\x60\x88\x64\xe8\xc0\x00\x00\x00\x31\xc0\x83\xec\x04\xeb\xa1\x90\xff\x25\xe8\x80\x88\x64\x90\x90\xff\x25\x04\x81\x88\x64\x90\x90\xff\x25\x00\x81\x88\x64\x90\x90\xff\x25\x0c\x81\x88\x64\x90\x90\xff\x25\xec\x80\x88\x64\x90\x90\xff\x25\x10\x81\x88\x64\x90\x90\xff\x25\x08\x81\x88\x64\x90\x90\xff\x25\x14\x81\x88\x64\x90\x90\xff\x25\xf8\x80\x88\x64\x90\x90\xff\x25\xfc\x80\x88\x64\x90\x90\xff\x25\xc0\x80\x88\x64\x90\x90\xff\x25\xc4\x80\x88\x64\x90\x90\xff\x25\xd8\x80\x88\x64\x90\x90\xff\x25\xb0\x80\x88\x64\x90\x90\xff\x25\xd0\x80\x88\x64\x90\x90\xff\x25\xb8\x80\x88\x64\x90\x90\xff\x25\xe0\x80\x88\x64\x90\x90\xff\x25\xdc\x80\x88\x64\x90\x90\xff\x25\xd4\x80\x88\x64\x90\x90\xff\x25\xbc\x80\x88\x64\x90\x90\xff\x25\xac\x80\x88\x64\x90\x90\xff\x25\xc8\x80\x88\x64\x90\x90\xff\x25\xb4\x80\x88\x64\x90\x90\xff\x25\xcc\x80\x88\x64\x90\x90\x55\x89\xe5\x83\xec\x18\xe8\xc5\xf4\xff\xff\xc7\x04\x24\x3c\x12\x88\x64\xe8\x39\xf3\xff\xff\xc9\xc3\x90\x90\x90\xff\xff\xff\xff\xe0\x1c\x88\x64\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x55\x8b\xec\x81\xec\x60\x04\x00\x00\x53\x89\x8d\xbc\xfb\xff\xff\xe8\x0b\x15\x00\x00\x8b\xc8\xe8\xc4\xff\xff\xff\x89\x45\xec\x8b\x45\x08\x8b\x08\x33\x4d\xec\x89\x4d\xf0\x8b\x55\x08\x8b\x42\x04\x33\x45\xec\x89\x45\xf4\x8b\x4d\x08\x8b\x51\x08\x33\x55\xec\x89\x55\xf8\x8b\x45\x08\x8b\x48\x0c\x33\x4d\xec\x89\x4d\xfc\xc7\x85\xd8\xfb\xff\xff\x00\x00\x00\x00\xc7\x85\xdc\xfb\xff\xff\x82\x00\x00\x00\xc7\x45\xe4\x00\x00\x00\x00\xc7\x45\xe8\x00\x00\x00\x00\x83\xbd\xd8\xfb\xff\xff\x00\x0f\x84\xc7\x01\x00\x00\xc7\x85\xb8\xfb\xff\xff\x10\x00\x00\x00\x8d\x55\xf0\x89\x95\xb4\xfb\xff\xff\x8b\x85\xd8\xfb\xff\xff\x89\x85\xb0\xfb\xff\xff\xeb\x27\x8b\x8d\xb4\xfb\xff\xff\x8b\x11\x8b\x85\xb0\xfb\xff\xff\x39\x10\x75\x2b\x83\xad\xb8\xfb\xff\xff\x04\x83\x85\xb4\xfb\xff\xff\x04\x83\x85\xb0\xfb\xff\xff\x04\x83\xbd\xb8\xfb\xff\xff\x04\x73\xd0\x83\xbd\xb8\xfb\xff\xff\x00\x0f\x84\xd6\x00\x00\x00\x8b\x8d\xb4\xfb\xff\xff\x0f\xb6\x11\x8b\x85\xb0\xfb\xff\xff\x0f\xb6\x08\x2b\xca\x89\x8d\xac\xfb\xff\xff\x0f\x85\xc2\x00\x00\x00\x83\xad\xb8\xfb\xff\xff\x01\x83\x85\xb4\xfb\xff\xff\x01\x83\x85\xb0\xfb\xff\xff\x01\x83\xbd\xb8\xfb\xff\xff\x00\x0f\x84\x94\x00\x00\x00\x8b\x95\xb4\xfb\xff\xff\x0f\xb6\x02\x8b\x8d\xb0\xfb\xff\xff\x0f\xb6\x11\x2b\xd0\x89\x95\xac\xfb\xff\xff\x0f\x85\x80\x00\x00\x00\x83\xad\xb8\xfb\xff\xff\x01\x83\x85\xb4\xfb\xff\xff\x01\x83\x85\xb0\xfb\xff\xff\x01\x83\xbd\xb8\xfb\xff\xff\x00\x74\x56\x8b\x85\xb4\xfb\xff\xff\x0f\xb6\x08\x8b\x95\xb0\xfb\xff\xff\x0f\xb6\x02\x2b\xc1\x89\x85\xac\xfb\xff\xff\x75\x46\x83\xad\xb8\xfb\xff\xff\x01\x83\x85\xb4\xfb\xff\xff\x01\x83\x85\xb0\xfb\xff\xff\x01\x83\xbd\xb8\xfb\xff\xff\x00\x74\x1c\x8b\x8d\xb4\xfb\xff\xff\x0f\xb6\x11\x8b\x85\xb0\xfb\xff\xff\x0f\xb6\x08\x2b\xca\x89\x8d\xac\xfb\xff\xff\x75\x0c\xc7\x85\xa8\xfb\xff\xff\x00\x00\x00\x00\xeb\x1d\xc7\x85\xa8\xfb\xff\xff\x01\x00\x00\x00\x83\xbd\xac\xfb\xff\xff\x00\x7f\x0a\xc7\x85\xa8\xfb\xff\xff\xff\xff\xff\xff\x8b\x95\xa8\xfb\xff\xff\x89\x95\xa4\xfb\xff\xff\x83\xbd\xa4\xfb\xff\xff\x00\x75\x55\x8b\x85\xd8\xfb\xff\xff\x83\xc0\x10\x89\x85\xd4\xfb\xff\xff\x8b\x8d\xd4\xfb\xff\xff\x8b\x11\x33\x55\xec\x8b\x45\x0c\x89\x10\x8b\x8d\xd4\xfb\xff\xff\x8b\x51\x04\x33\x55\xec\x8b\x45\x0c\x89\x50\x04\x8b\x8d\xd4\xfb\xff\xff\x8b\x51\x08\x33\x55\xec\x8b\x45\x0c\x89\x50\x08\x8b\x8d\xd4\xfb\xff\xff\x8b\x51\x0c\x33\x55\xec\x8b\x45\x0c\x89\x50\x0c\x83\x7d\xe8\xff\x0f\x84\x73\x11\x00\x00\x8b\x4d\xe4\x83\xc1\x01\x89\x4d\xe4\x8b\x15\x7c\xd0\x87\x00\x89\x95\xc0\xfb\xff\xff\xb8\x20\x00\x00\x00\x85\xc0\x74\x59\x8b\x8d\xc0\xfb\xff\xff\x8b\x51\x04\x83\xc2\x01\x8b\x85\xc0\xfb\xff\xff\x89\x50\x04\x8b\x8d\xc0\xfb\xff\xff\x8b\x11\x69\xd2\xed\xa3\xf8\x7f\x81\xc2\x31\x1d\xa0\x2a\x8b\x85\xc0\xfb\xff\xff\x89\x10\x8b\x8d\xc0\xfb\xff\xff\x8b\x11\xc1\xea\x08\x89\x95\xc4\xfb\xff\xff\x8b\x85\xc4\xfb\xff\xff\x33\xd2\xb9\x20\x00\x00\x00\xf7\xf1\x89\x95\xa0\xfb\xff\xff\xeb\x0a\xc7\x85\xa0\xfb\xff\xff\x00\x00\x00\x00\x8b\x95\xa0\xfb\xff\xff\x89\x95\xd0\xfb\xff\xff\x81\x7d\xe4\xe8\x03\x00\x00\x7e\x44\xc7\x85\xc8\xfb\xff\xff\x00\x00\x00\x00\xeb\x0f\x8b\x85\xc8\xfb\xff\xff\x83\xc0\x01\x89\x85\xc8\xfb\xff\xff\x83\xbd\xc8\xfb\xff\xff\x20\x7d\x20\x8b\x55\xe8\x8b\x8d\xc8\xfb\xff\xff\xd3\xfa\x83\xe2\x01\x75\x0e\x8b\x85\xc8\xfb\xff\xff\x89\x85\xd0\xfb\xff\xff\xeb\x02\xeb\xc8\xba\x01\x00\x00\x00\x8b\x8d\xd0\xfb\xff\xff\xd3\xe2\x0b\x55\xe8\x89\x55\xe8\x8b\x85\xd0\xfb\xff\xff\x69\xc0\x82\x00\x00\x00\x89\x85\xcc\xfb\xff\xff\x8b\x8d\xd0\xfb\xff\xff\xc1\xe1\x04\x8d\x94\x4d\xe0\xfb\xff\xff\x89\x95\xd8\xfb\xff\xff\x68\x90\x9c\x72\x00\x8b\x9d\xd8\xfb\xff\xff\xba\xa1\x9f\x72\x00\x03\x95\xcc\xfb\xff\xff\x42\x4a\x52\xf9\x73\x01\xc3\xff\xc6\x03\x18\x43\xc6\x03\xd2\x43\xc6\x03\x54\x43\xc6\x03\xd1\x43\xc6\x03\xe7\x43\xc6\x03\x08\x43\xc6\x03\x64\x43\xc6\x03\x8d\x43\xc6\x03\x7d\x43\xc6\x03\x75\x43\xc6\x03\x53\x43\xc6\x03\x98\x43\xc6\x03\xb1\x43\xc6\x03\x04\x43\xc6\x03\xdc\x43\xc6\x03\x37\x43\xc6\x03\xa0\x43\xc6\x03\x42\x43\xc6\x03\x24\x43\xc6\x03\x6c\x43\xc6\x03\x69\x43\xc6\x03\x9c\x43\xc6\x03\x65\x43\xc6\x03\x95\x43\xc6\x03\x8f\x43\xc6\x03\xf3\x43\xc6\x03\xe5\x43\xc6\x03\x8e\x43\xc6\x03\x00\x43\xc6\x03\x19\x43\xc6\x03\xe3\x43\xc6\x03\x4d\xc3\xff\xff\xc6\x03\x78\x43\xc6\x03\x60\x43\xc6\x03\x11\x43\xc6\x03\xea\x43\xc6\x03\xb1\x43\xc6\x03\x01\x43\xc6\x03\x65\x43\xc6\x03\xf0\x43\xc6\x03\xe1\x43\xc6\x03\x35\x43\xc6\x03\xb1\x43\xc6\x03\xf5\x43\xc6\x03\x20\x43\xc6\x03\x31\x43\xc6\x03\xd4\x43\xc6\x03\x70\x43\xc6\x03\x01\x43\xc6\x03\x43\x43\xc6\x03\x1f\x43\xc6\x03\xec\x43\xc6\x03\x3f\x43\xc6\x03\x26\x43\xc6\x03\xe6\x43\xc6\x03\xd1\x43\xc6\x03\x72\x43\xc6\x03\x44\x43\xc6\x03\x94\x43\xc6\x03\x3b\x43\xc6\x03\xb9\x43\xc6\x03\x51\x43\xc6\x03\xc8\x43\xc6\x03\x3d\xc3\xff\xff\xc6\x03\x2f\x43\xc6\x03\xec\x43\xc6\x03\xae\x43\xc6\x03\xc8\x43\xc6\x03\xac\x43\xc6\x03\xfd\x43\xc6\x03\x49\x43\xc6\x03\x9a\x43\xc6\x03\x44\x43\xc6\x03\xad\x43\xc6\x03\xc8\x43\xc6\x03\x86\x43\xc6\x03\x74\x43\xc6\x03\xb2\x43\xc6\x03\xdd\x43\xc6\x03\x92\x43\xc6\x03\x69\x43\xc6\x03\x02\x43\xc6\x03\xf1\x43\xc6\x03\xe3\x43\xc6\x03\x2c\x43\xc6\x03\x18\x43\xc6\x03\x3d\x43\xc6\x03\xce\x43\xc6\x03\xc9\x43\xc6\x03\x77\x43\xc6\x03\x30\x43\xc6\x03\xb5\x43\xc6\x03\x9d\x43\xc6\x03\x4e\x43\xc6\x03\xd2\x43\xc6\x03\xcf\xc3\xff\xff\xc6\x03\x17\x43\xc6\x03\xe3\x43\xc6\x03\xd8\x43\xc6\x03\x2d\x43\xc6\x03\x08\x43\xc6\x03\xe9\x43\xc6\x03\x92\x43\xc6\x03\xc1\x43\xc6\x03\xbb\x43\xc6\x03\x8e\x43\xc6\x03\x85\x43\xc6\x03\x32\x43\xc6\x03\x0c\x43\xc6\x03\x7d\x43\xc6\x03\xeb\x43\xc6\x03\x0c\x43\xc6\x03\x97\x43\xc6\x03\x24\x43\xc6\x03\xc1\x43\xc6\x03\x9a\x43\xc6\x03\xb7\x43\xc6\x03\xad\x43\xc6\x03\xc3\x43\xc6\x03\xe9\x43\xc6\x03\x89\x43\xc6\x03\x05\x43\xc6\x03\x6c\x43\xc6\x03\xc5\x43\xc6\x03\xe9\x43\xc6\x03\xd8\x43\xc6\x03\xfa\x43\xc6\x03\xb9\xc3\xff\xff\xc6\x03\x1c\x43\xc6\x03\x66\x43\xc6\x03\x6e\x43\xc6\x03\x2b\x43\xc6\x03\xc3\x43\xc6\x03\x16\x43\xc6\x03\xa7\x43\xc6\x03\x53\x43\xc6\x03\x4b\x43\xc6\x03\xb6\x43\xc6\x03\x8b\x43\xc6\x03\xe1\x43\xc6\x03\x7e\x43\xc6\x03\x11\x43\xc6\x03\xbd\x43\xc6\x03\xbd\x43\xc6\x03\xd7\x43\xc6\x03\xf3\x43\xc6\x03\x95\x43\xc6\x03\x43\x43\xc6\x03\xa9\x43\xc6\x03\xb7\x43\xc6\x03\x3e\x43\xc6\x03\x10\x43\xc6\x03\x22\x43\xc6\x03\xe9\x43\xc6\x03\xa0\x43\xc6\x03\x29\x43\xc6\x03\xb5\x43\xc6\x03\xd0\x43\xc6\x03\xb2\x43\xc6\x03\x4c\xc3\xff\xff\xc6\x03\x7b\x43\xc6\x03\xfe\x43\xc6\x03\x54\x43\xc6\x03\x6d\x43\xc6\x03\xc6\x43\xc6\x03\x56\x43\xc6\x03\xf9\x43\xc6\x03\xa3\x43\xc6\x03\x73\x43\xc6\x03\x6d\x43\xc6\x03\x76\x43\xc6\x03\xd6\x43\xc6\x03\x5e\x43\xc6\x03\xef\x43\xc6\x03\x06\x43\xc6\x03\x92\x43\xc6\x03\x23\x43\xc6\x03\x47\x43\xc6\x03\xa6\x43\xc6\x03\x22\x43\xc6\x03\x1d\x43\xc6\x03\xa2\x43\xc6\x03\x11\x43\xc6\x03\x93\x43\xc6\x03\x69\x43\xc6\x03\xec\x43\xc6\x03\xc5\x43\xc6\x03\xb1\x43\xc6\x03\xe3\x43\xc6\x03\xd1\x43\xc6\x03\xfc\x43\xc6\x03\x07\xc3\xff\xff\xc6\x03\x73\x43\xc6\x03\x91\x43\xc6\x03\x67\x43\xc6\x03\x13\x43\xc6\x03\x82\x43\xc6\x03\x5d\x43\xc6\x03\x6f\x43\xc6\x03\xdd\x43\xc6\x03\x33\x43\xc6\x03\x28\x43\xc6\x03\x90\x43\xc6\x03\xe3\x43\xc6\x03\x62\x43\xc6\x03\x9e\x43\xc6\x03\x04\x43\xc6\x03\xb3\x43\xc6\x03\xab\x43\xc6\x03\x2a\x43\xc6\x03\xc8\x43\xc6\x03\x97\x43\xc6\x03\x69\x43\xc6\x03\xf9\x43\xc6\x03\x98\x43\xc6\x03\x9c\x43\xc6\x03\xb9\x43\xc6\x03\xf7\x43\xc6\x03\xef\x43\xc6\x03\x8e\x43\xc6\x03\x77\x43\xc6\x03\xd0\x43\xc6\x03\x0a\x43\xc6\x03\xf9\xc3\xff\xff\xc6\x03\xca\x43\xc6\x03\x17\x43\xc6\x03\x70\x43\xc6\x03\x63\x43\xc6\x03\x8d\x43\xc6\x03\x88\x43\xc6\x03\x4d\x43\xc6\x03\x71\x43\xc6\x03\x33\x43\xc6\x03\x36\x43\xc6\x03\x81\x43\xc6\x03\xfc\x43\xc6\x03\x95\x43\xc6\x03\xd0\x43\xc6\x03\x49\x43\xc6\x03\x8f\x43\xc6\x03\x52\x43\xc6\x03\xc1\x43\xc6\x03\xa1\x43\xc6\x03\x78\x43\xc6\x03\xc4\x43\xc6\x03\x34\x43\xc6\x03\x45\x43\xc6\x03\xc1\x43\xc6\x03\x09\x43\xc6\x03\x16\x43\xc6\x03\xb0\x43\xc6\x03\x36\x43\xc6\x03\xfa\x43\xc6\x03\x12\x43\xc6\x03\x20\x43\xc6\x03\x65\xc3\xff\xff\xc6\x03\x42\x43\xc6\x03\x2b\x43\xc6\x03\x02\x43\xc6\x03\x88\x43\xc6\x03\xca\x43\xc6\x03\x0f\x43\xc6\x03\x43\x43\xc6\x03\x2a\x43\xc6\x03\x73\x43\xc6\x03\x72\x43\xc6\x03\x1b\x43\xc6\x03\x89\x43\xc6\x03\x1a\x43\xc6\x03\xff\x43\xc6\x03\xc8\x43\xc6\x03\x30\x43\xc6\x03\x5a\x43\xc6\x03\x24\x43\xc6\x03\x43\x43\xc6\x03\x6d\x43\xc6\x03\x91\x43\xc6\x03\x0b\x43\xc6\x03\x4b\x43\xc6\x03\x4a\x43\xc6\x03\xd9\x43\xc6\x03\xa1\x43\xc6\x03\x5b\x43\xc6\x03\x94\x43\xc6\x03\x0f\x43\xc6\x03\x92\x43\xc6\x03\xae\x43\xc6\x03\xd6\xc3\xff\xff\xc6\x03\x89\x43\xc6\x03\xd0\x43\xc6\x03\x3a\x43\xc6\x03\x68\x43\xc6\x03\xd6\x43\xc6\x03\x9e\x43\xc6\x03\xa1\x43\xc6\x03\x98\x43\xc6\x03\xca\x43\xc6\x03\x5b\x43\xc6\x03\x36\x43\xc6\x03\x1a\x43\xc6\x03\x43\x43\xc6\x03\x53\x43\xc6\x03\x37\x43\xc6\x03\xbd\x43\xc6\x03\xb5\x43\xc6\x03\xc3\x43\xc6\x03\xe0\x43\xc6\x03\x98\x43\xc6\x03\xbf\x43\xc6\x03\x56\x43\xc6\x03\x0e\x43\xc6\x03\x48\x43\xc6\x03\xa8\x43\xc6\x03\xf5\x43\xc6\x03\x3c\x43\xc6\x03\x17\x43\xc6\x03\x92\x43\xc6\x03\x88\x43\xc6\x03\xee\x43\xc6\x03\x08\xc3\xff\xff\xc6\x03\x20\x43\xc6\x03\x3c\x43\xc6\x03\x2e\x43\xc6\x03\xbd\x43\xc6\x03\x5d\x43\xc6\x03\x9f\x43\xc6\x03\x15\x43\xc6\x03\x0d\x43\xc6\x03\x1c\x43\xc6\x03\x60\x43\xc6\x03\xf4\x43\xc6\x03\xfa\x43\xc6\x03\x39\x43\xc6\x03\x2b\x43\xc6\x03\x06\x43\xc6\x03\x0f\x43\xc6\x03\x50\x43\xc6\x03\x6e\x43\xc6\x03\x48\x43\xc6\x03\x9a\x43\xc6\x03\xbc\x43\xc6\x03\x53\x43\xc6\x03\x76\x43\xc6\x03\xa5\x43\xc6\x03\x9a\x43\xc6\x03\xc7\x43\xc6\x03\x0b\x43\xc6\x03\xfc\x43\xc6\x03\xc6\x43\xc6\x03\x75\x43\xc6\x03\x44\x43\xc6\x03\x2d\xc3\xff\xff\xc6\x03\x26\x43\xc6\x03\xbc\x43\xc6\x03\xb3\x43\xc6\x03\xe3\x43\xc6\x03\x90\x43\xc6\x03\xda\x43\xc6\x03\xa6\x43\xc6\x03\x4f\x43\xc6\x03\x3b\x43\xc6\x03\x17\x43\xc6\x03\x50\x43\xc6\x03\x18\x43\xc6\x03\x04\x43\xc6\x03\x1f\x43\xc6\x03\xef\x43\xc6\x03\xc9\x43\xc6\x03\x86\x43\xc6\x03\x5d\x43\xc6\x03\x7d\x43\xc6\x03\xaf\x43\xc6\x03\x1f\x43\xc6\x03\xff\x43\xc6\x03\xb6\x43\xc6\x03\xd6\x43\xc6\x03\xe9\x43\xc6\x03\xee\x43\xc6\x03\x18\x43\xc6\x03\x0a\x43\xc6\x03\xc1\x43\xc6\x03\xd9\x43\xc6\x03\xdd\x43\xc6\x03\xd7\xc3\xff\xff\xc6\x03\x7c\x43\xc6\x03\xb5\x43\xc6\x03\xe4\x43\xc6\x03\xa2\x43\xc6\x03\x17\x43\xc6\x03\xbd\x43\xc6\x03\xa2\x43\xc6\x03\x73\x43\xc6\x03\x7b\x43\xc6\x03\xd7\x43\xc6\x03\x52\x43\xc6\x03\xbc\x43\xc6\x03\x2d\x43\xc6\x03\x02\x43\xc6\x03\xeb\x43\xc6\x03\xab\x43\xc6\x03\x29\x43\xc6\x03\xf9\x43\xc6\x03\x46\x43\xc6\x03\x6f\x43\xc6\x03\x4a\x43\xc6\x03\xc1\x43\xc6\x03\x03\x43\xc6\x03\xf3\x43\xc6\x03\x88\x43\xc6\x03\xa6\x43\xc6\x03\x3b\x43\xc6\x03\xf4\x43\xc6\x03\x9a\x43\xc6\x03\xf4\x43\xc6\x03\x50\x43\xc6\x03\x16\xc3\xff\xff\xc6\x03\xac\x43\xc6\x03\xfd\x43\xc6\x03\x83\x43\xc6\x03\x29\x43\xc6\x03\x82\x43\xc6\x03\xbc\x43\xc6\x03\x03\x43\xc6\x03\x3a\x43\xc6\x03\x24\x43\xc6\x03\xa8\x43\xc6\x03\xa9\x43\xc6\x03\x10\x43\xc6\x03\x1e\x43\xc6\x03\x0c\x43\xc6\x03\x55\x43\xc6\x03\xde\x43\xc6\x03\x9d\x43\xc6\x03\x57\x43\xc6\x03\x62\x43\xc6\x03\x2b\x43\xc6\x03\xdd\x43\xc6\x03\xe3\x43\xc6\x03\xec\x43\xc6\x03\xa4\x43\xc6\x03\x6c\x43\xc6\x03\x96\x43\xc6\x03\xe4\x43\xc6\x03\x9d\x43\xc6\x03\x7b\x43\xc6\x03\x05\x43\xc6\x03\xa8\x43\xc6\x03\x4b\xc3\xff\xff\xc6\x03\x2b\x43\xc6\x03\xe4\x43\xc6\x03\x39\x43\xc6\x03\x78\x43\xc6\x03\xfe\x43\xc6\x03\x25\x43\xc6\x03\xa6\x43\xc6\x03\xd6\x43\xc6\x03\xb4\x43\xc6\x03\xa3\x43\xc6\x03\x6a\x43\xc6\x03\xb1\x43\xc6\x03\x26\x43\xc6\x03\x0d\x43\xc6\x03\xc2\x43\xc6\x03\x94\x43\xc6\x03\xf3\x43\xc6\x03\xce\x43\xc6\x03\xaa\x43\xc6\x03\xcd\x43\xc6\x03\x75\x43\xc6\x03\x11\x43\xc6\x03\xde\x43\xc6\x03\x66\x43\xc6\x03\xca\x43\xc6\x03\xc3\x43\xc6\x03\xd9\x43\xc6\x03\x2b\x43\xc6\x03\xcb\x43\xc6\x03\x8f\x43\xc6\x03\xd9\x43\xc6\x03\xaa\xc3\xff\xff\xc6\x03\xf8\x43\xc6\x03\x30\x43\xc6\x03\x21\x43\xc6\x03\xc2\x43\xc6\x03\xf9\x43\xc6\x03\x06\x43\xc6\x03\x6b\x43\xc6\x03\xa6\x43\xc6\x03\xbc\x43\xc6\x03\x7b\x43\xc6\x03\xee\x43\xc6\x03\x67\x43\xc6\x03\x1d\x43\xc6\x03\x3a\x43\xc6\x03\xe4\x43\xc6\x03\x91\x43\xc6\x03\xb8\x43\xc6\x03\xb1\x43\xc6\x03\x4a\x43\xc6\x03\x6f\x43\xc6\x03\xe8\x43\xc6\x03\x0a\x43\xc6\x03\xdc\x43\xc6\x03\x0e\x43\xc6\x03\xca\x43\xc6\x03\x32\x43\xc6\x03\x15\x43\xc6\x03\x3a\x43\xc6\x03\x3a\x43\xc6\x03\xd5\x43\xc6\x03\x33\x43\xc6\x03\x7e\xc3\xff\xff\xc6\x03\x3f\x43\xc6\x03\xef\x43\xc6\x03\xe5\x43\xc6\x03\x28\x43\xc6\x03\x6c\x43\xc6\x03\x82\x43\xc6\x03\x3c\x43\xc6\x03\x28\x43\xc6\x03\x1b\x43\xc6\x03\x73\x43\xc6\x03\x8b\x43\xc6\x03\xc5\x43\xc6\x03\x28\x43\xc6\x03\x6e\x43\xc6\x03\x0d\x43\xc6\x03\x8a\x43\xc6\x03\x2f\x43\xc6\x03\xe1\x43\xc6\x03\xbf\x43\xc6\x03\xc5\x43\xc6\x03\x8b\x43\xc6\x03\xf6\x43\xc6\x03\x5d\x43\xc6\x03\x80\x43\xc6\x03\x59\x43\xc6\x03\x9a\x43\xc6\x03\x62\x43\xc6\x03\x87\x43\xc6\x03\x75\x43\xc6\x03\x78\x43\xc6\x03\x0b\x43\xc6\x03\x68\xc3\xff\xff\xc6\x03\x27\x43\xc6\x03\xd0\x43\xc6\x03\x4f\x43\xc6\x03\xdc\x43\xc6\x03\x84\x43\xc6\x03\x14\x43\xc6\x03\x5d\x43\xc6\x03\xff\x43\xc6\x03\x5b\x43\xc6\x03\x10\x43\xc6\x03\x8d\x43\xc6\x03\xe5\x43\xc6\x03\x38\x43\xc6\x03\x2a\x43\xc6\x03\x2a\x43\xc6\x03\xd9\x43\xc6\x03\xc5\x43\xc6\x03\x53\x43\xc6\x03\x92\x43\xc6\x03\xc0\x43\xc6\x03\x99\x43\xc6\x03\x5f\x43\xc6\x03\x37\x43\xc6\x03\x47\x43\xc6\x03\x6f\x43\xc6\x03\xf4\x43\xc6\x03\x3f\x43\xc6\x03\x20\x43\xc6\x03\xb3\x43\xc6\x03\x35\x43\xc6\x03\xa4\x43\xc6\x03\xa3\xc3\xff\xff\xc6\x03\x07\x43\xc6\x03\x09\x43\xc6\x03\xfc\x43\xc6\x03\x78\x43\xc6\x03\x81\x43\xc6\x03\xf7\x43\xc6\x03\x7f\x43\xc6\x03\x34\x43\xc6\x03\x3c\x43\xc6\x03\x04\x43\xc6\x03\xb9\x43\xc6\x03\x4d\x43\xc6\x03\x15\x43\xc6\x03\xdc\x43\xc6\x03\xe8\x43\xc6\x03\x4e\x43\xc6\x03\xa7\x43\xc6\x03\xea\x43\xc6\x03\x06\x43\xc6\x03\x84\x43\xc6\x03\x50\x43\xc6\x03\x5c\x43\xc6\x03\xcf\x43\xc6\x03\xfb\x43\xc6\x03\x2a\x43\xc6\x03\x1b\x43\xc6\x03\xc1\x43\xc6\x03\x7f\x43\xc6\x03\x12\x43\xc6\x03\xd6\x43\xc6\x03\x16\x43\xc6\x03\x9c\xc3\xff\xff\xc6\x03\xd4\x43\xc6\x03\x5e\x43\xc6\x03\x30\x43\xc6\x03\x28\x43\xc6\x03\xf3\x43\xc6\x03\xfa\x43\xc6\x03\xc8\x43\xc6\x03\x42\x43\xc6\x03\xb4\x43\xc6\x03\x95\x43\xc6\x03\x79\x43\xc6\x03\x98\x43\xc6\x03\xf3\x43\xc6\x03\xdb\x43\xc6\x03\x7d\x43\xc6\x03\xb8\x43\xc6\x03\x4c\x43\xc6\x03\x37\x43\xc6\x03\xd1\x43\xc6\x03\xec\x43\xc6\x03\x1a\x43\xc6\x03\xd6\x43\xc6\x03\x31\x43\xc6\x03\x41\x43\xc6\x03\x7a\x43\xc6\x03\xa4\x43\xc6\x03\x18\x43\xc6\x03\x83\x43\xc6\x03\x48\x43\xc6\x03\x4d\x43\xc6\x03\xc3\x43\xc6\x03\x3e\xc3\xff\xff\xc6\x03\xe8\x43\xc6\x03\xcf\x43\xc6\x03\x27\x43\xc6\x03\x3d\x43\xc6\x03\xe5\x43\xc6\x03\xa1\x43\xc6\x03\x3c\x43\xc6\x03\x62\x43\xc6\x03\xd3\x43\xc6\x03\x16\x43\xc6\x03\xaa\x43\xc6\x03\x0e\x43\xc6\x03\x2e\x43\xc6\x03\xa6\x43\xc6\x03\x00\x43\xc6\x03\x33\x43\xc6\x03\x88\x43\xc6\x03\xdf\x43\xc6\x03\xff\x43\xc6\x03\x36\x43\xc6\x03\x6f\x43\xc6\x03\x28\x43\xc6\x03\x5d\x43\xc6\x03\x49\x43\xc6\x03\xf6\x43\xc6\x03\xaf\x43\xc6\x03\xc4\x43\xc6\x03\x66\x43\xc6\x03\x0c\x43\xc6\x03\xa3\x43\xc6\x03\xb9\x43\xc6\x03\x01\xc3\xff\xff\xc6\x03\xdc\x43\xc6\x03\xcb\x43\xc6\x03\x1d\x43\xc6\x03\x82\x43\xc6\x03\x37\x43\xc6\x03\xf3\x43\xc6\x03\x52\x43\xc6\x03\x08\x43\xc6\x03\xf4\x43\xc6\x03\xda\x43\xc6\x03\x5f\x43\xc6\x03\x8b\x43\xc6\x03\xef\x43\xc6\x03\x2c\x43\xc6\x03\x7f\x43\xc6\x03\x97\x43\xc6\x03\xc4\x43\xc6\x03\x54\x43\xc6\x03\xaf\x43\xc6\x03\x77\x43\xc6\x03\xce\x43\xc6\x03\x7f\x43\xc6\x03\xaa\x43\xc6\x03\x38\x43\xc6\x03\x2a\x43\xc6\x03\x99\x43\xc6\x03\xee\x43\xc6\x03\xa6\x43\xc6\x03\xb4\x43\xc6\x03\x4e\x43\xc6\x03\xb5\x43\xc6\x03\x4c\xc3\xff\xff\xc6\x03\xaf\x43\xc6\x03\x96\x43\xc6\x03\x8a\x43\xc6\x03\xf2\x43\xc6\x03\x65\x43\xc6\x03\x10\x43\xc6\x03\xa9\x43\xc6\x03\x1b\x43\xc6\x03\x1c\x43\xc6\x03\x69\x43\xc6\x03\x3f\x43\xc6\x03\x5f\x43\xc6\x03\xb1\x43\xc6\x03\x4d\x43\xc6\x03\x89\x43\xc6\x03\x4d\x43\xc6\x03\xbf\x43\xc6\x03\x27\x43\xc6\x03\x83\x43\xc6\x03\x2f\x43\xc6\x03\xa4\x43\xc6\x03\x24\x43\xc6\x03\xe9\x43\xc6\x03\x12\x43\xc6\x03\x7a\x43\xc6\x03\x30\x43\xc6\x03\x37\x43\xc6\x03\xc2\x43\xc6\x03\x1d\x43\xc6\x03\xf7\x43\xc6\x03\xa8\x43\xc6\x03\xcb\xc3\xff\xff\xc6\x03\x39\x43\xc6\x03\xc4\x43\xc6\x03\x6c\x43\xc6\x03\x28\x43\xc6\x03\xa9\x43\xc6\x03\x09\x43\xc6\x03\x9f\x43\xc6\x03\x59\x43\xc6\x03\xa2\x43\xc6\x03\xa8\x43\xc6\x03\xfe\x43\xc6\x03\x8c\x43\xc6\x03\x3f\x43\xc6\x03\xcc\x43\xc6\x03\xd6\x43\xc6\x03\x02\x43\xc6\x03\x15\x43\xc6\x03\x15\x43\xc6\x03\x32\x43\xc6\x03\x75\x43\xc6\x03\x42\x43\xc6\x03\x52\x43\xc6\x03\x0e\x43\xc6\x03\x94\x43\xc6\x03\x93\x43\xc6\x03\x93\x43\xc6\x03\xbe\x43\xc6\x03\xfe\x43\xc6\x03\x71\x43\xc6\x03\x3f\x43\xc6\x03\xb6\x43\xc6\x03\x22\xc3\xff\xff\xc6\x03\xce\x43\xc6\x03\x49\x43\xc6\x03\x41\x43\xc6\x03\x5d\x43\xc6\x03\x74\x43\xc6\x03\xf3\x43\xc6\x03\xd0\x43\xc6\x03\x36\x43\xc6\x03\x1b\x43\xc6\x03\x7c\x43\xc6\x03\xd6\x43\xc6\x03\x2a\x43\xc6\x03\xa0\x43\xc6\x03\x90\x43\xc6\x03\x90\x43\xc6\x03\xc8\x43\xc6\x03\x9e\x43\xc6\x03\x9a\x43\xc6\x03\xfa\x43\xc6\x03\x5a\x43\xc6\x03\x73\x43\xc6\x03\xc7\x43\xc6\x03\xd0\x43\xc6\x03\xed\x43\xc6\x03\x39\x43\xc6\x03\x03\x43\xc6\x03\x8e\x43\xc6\x03\x4d\x43\xc6\x03\xcc\x43\xc6\x03\xfa\x43\xc6\x03\x6f\x43\xc6\x03\x06\xc3\xff\xff\xc6\x03\xef\x43\xc6\x03\x6c\x43\xc6\x03\x2b\x43\xc6\x03\xe0\x43\xc6\x03\x11\x43\xc6\x03\x3f\x43\xc6\x03\x14\x43\xc6\x03\x83\x43\xc6\x03\xc5\x43\xc6\x03\xc7\x43\xc6\x03\x93\x43\xc6\x03\x49\x43\xc6\x03\x50\x43\xc6\x03\xa4\x43\xc6\x03\xab\x43\xc6\x03\xaf\x43\xc6\x03\xc2\x43\xc6\x03\xcd\x43\xc6\x03\xf4\x43\xc6\x03\xf8\x43\xc6\x03\x54\x43\xc6\x03\x01\x43\xc6\x03\x95\x43\xc6\x03\xa3\x43\xc6\x03\xbe\x43\xc6\x03\xfd\x43\xc6\x03\x05\x43\xc6\x03\x59\x43\xc6\x03\x84\x43\xc6\x03\xbe\x43\xc6\x03\xab\x43\xc6\x03\x3d\xc3\xff\xff\xc6\x03\x38\x43\xc6\x03\xf2\x43\xc6\x03\x89\x43\xc6\x03\x59\x43\xc6\x03\xa1\x43\xc6\x03\x16\x43\xc6\x03\xba\x43\xc6\x03\xb1\x43\xc6\x03\x14\x43\xc6\x03\x6b\x43\xc6\x03\xfb\x43\xc6\x03\x69\x43\xc6\x03\xd5\x43\xc6\x03\xdd\x43\xc6\x03\xd4\x43\xc6\x03\xdf\x43\xc6\x03\x3f\x43\xc6\x03\x43\x43\xc6\x03\x77\x43\xc6\x03\x75\x43\xc6\x03\xa3\x43\xc6\x03\xcd\x43\xc6\x03\xf6\x43\xc6\x03\xe2\x43\xc6\x03\xee\x43\xc6\x03\xb2\x43\xc6\x03\xe4\x43\xc6\x03\x11\x43\xc6\x03\x0b\x43\xc6\x03\x05\x43\xc6\x03\x4c\x43\xc6\x03\xf4\xc3\xff\xff\xc6\x03\x45\x43\xc6\x03\xaa\x43\xc6\x03\x53\x43\xc6\x03\x31\x43\xc6\x03\xd9\x43\xc6\x03\xde\x43\xc6\x03\x53\x43\xc6\x03\xc4\x43\xc6\x03\xf1\x43\xc6\x03\x2a\x43\xc6\x03\xe4\x43\xc6\x03\xdc\x43\xc6\x03\x52\x43\xc6\x03\xa3\x43\xc6\x03\xc2\x43\xc6\x03\xae\x43\xc6\x03\x77\x43\xc6\x03\x53\x43\xc6\x03\x0c\x43\xc6\x03\x86\x43\xc6\x03\x94\x43\xc6\x03\xfd\x43\xc6\x03\x30\x43\xc6\x03\x83\x43\xc6\x03\xdf\x43\xc6\x03\x52\x43\xc6\x03\x63\x43\xc6\x03\x8a\x43\xc6\x03\x8a\x43\xc6\x03\xe3\x43\xc6\x03\x20\x43\xc6\x03\x8c\xc3\xff\xff\xc6\x03\x58\x43\xc6\x03\xf6\x43\xc6\x03\x4c\x43\xc6\x03\x8f\x43\xc6\x03\x83\x43\xc6\x03\xb7\x43\xc6\x03\xf3\x43\xc6\x03\xa0\x43\xc6\x03\xa3\x43\xc6\x03\x98\x43\xc6\x03\xd2\x43\xc6\x03\xf5\x43\xc6\x03\x96\x43\xc6\x03\xcf\x43\xc6\x03\x85\x43\xc6\x03\xd9\x43\xc6\x03\x88\x43\xc6\x03\x9f\x43\xc6\x03\x0f\x43\xc6\x03\xd9\x43\xc6\x03\x89\x43\xc6\x03\xc8\x43\xc6\x03\x7c\x43\xc6\x03\x9b\x43\xc6\x03\x0b\x43\xc6\x03\x9a\x43\xc6\x03\x56\x43\xc6\x03\x06\x43\xc6\x03\x0e\x43\xc6\x03\x6e\x43\xc6\x03\x2c\x43\xc6\x03\xbb\xc3\xff\xff\xc6\x03\xc9\x43\xc6\x03\xcd\x43\xc6\x03\x50\x43\xc6\x03\xfa\x43\xc6\x03\x67\x43\xc6\x03\x40\x43\xc6\x03\xcb\x43\xc6\x03\x9c\x43\xc6\x03\xab\x43\xc6\x03\x3c\x43\xc6\x03\x5e\x43\xc6\x03\x56\x43\xc6\x03\x24\x43\xc6\x03\xeb\x43\xc6\x03\x7c\x43\xc6\x03\x70\x43\xc6\x03\x74\x43\xc6\x03\x20\x43\xc6\x03\x86\x43\xc6\x03\x54\x43\xc6\x03\x92\x43\xc6\x03\x90\x43\xc6\x03\xb3\x43\xc6\x03\x9b\x43\xc6\x03\x46\x43\xc6\x03\xff\x43\xc6\x03\xc6\x43\xc6\x03\xab\x43\xc6\x03\x92\x43\xc6\x03\x00\x43\xc6\x03\xec\x43\xc6\x03\x74\xc3\xff\xff\xc6\x03\xf5\x43\xc6\x03\x97\x43\xc6\x03\x00\x43\xc6\x03\x95\x43\xc6\x03\xc0\x43\xc6\x03\xa0\x43\xc6\x03\x73\x43\xc6\x03\x5f\x43\xc6\x03\x8a\x43\xc6\x03\xc9\x43\xc6\x03\x5b\x43\xc6\x03\x4a\x43\xc6\x03\xda\x43\xc6\x03\x13\x43\xc6\x03\x93\x43\xc6\x03\x76\x43\xc6\x03\xc3\x43\xc6\x03\xab\x43\xc6\x03\xbc\x43\xc6\x03\x9b\x43\xc6\x03\x76\x43\xc6\x03\x80\x43\xc6\x03\x63\x43\xc6\x03\xc0\x43\xc6\x03\x08\x43\xc6\x03\xfb\x43\xc6\x03\x3d\x43\xc6\x03\x11\x43\xc6\x03\xf4\x43\xc6\x03\x24\x43\xc6\x03\xfb\x43\xc6\x03\xf5\xc3\xff\xff\xc6\x03\xa3\x43\xc6\x03\xf8\x43\xc6\x03\xcb\x43\xc6\x03\x9d\x43\xc6\x03\x3b\x43\xc6\x03\xac\x43\xc6\x03\x9c\x43\xc6\x03\x8f\x43\xc6\x03\xf4\x43\xc6\x03\xdf\x43\xc6\x03\x04\x43\xc6\x03\x3e\x43\xc6\x03\xab\x43\xc6\x03\x3c\x43\xc6\x03\x41\x43\xc6\x03\x35\x43\xc6\x03\xfb\x43\xc6\x03\x31\x43\xc6\x03\x4c\x43\xc6\x03\xc2\x43\xc6\x03\x42\x43\xc6\x03\xe8\x43\xc6\x03\xe4\x43\xc6\x03\xef\x43\xc6\x03\x9a\x43\xc6\x03\x4e\x43\xc6\x03\x84\x43\xc6\x03\x89\x43\xc6\x03\xe0\x43\xc6\x03\x0f\x43\xc6\x03\x67\x43\xc6\x03\x1b\xc3\xff\xff\x5b\x8b\xe5\x5d\xc2\x08\x00\xcc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\x1d\x88\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x6c\x69\x62\x67\x63\x63\x5f\x73\x5f\x64\x77\x32\x2d\x31\x2e\x64\x6c\x6c\x00\x5f\x5f\x72\x65\x67\x69\x73\x74\x65\x72\x5f\x66\x72\x61\x6d\x65\x5f\x69\x6e\x66\x6f\x00\x6c\x69\x62\x67\x63\x6a\x2d\x31\x31\x2e\x64\x6c\x6c\x00\x5f\x4a\x76\x5f\x52\x65\x67\x69\x73\x74\x65\x72\x43\x6c\x61\x73\x73\x65\x73\x00\x5f\x5f\x64\x65\x72\x65\x67\x69\x73\x74\x65\x72\x5f\x66\x72\x61\x6d\x65\x5f\x69\x6e\x66\x6f\x00\x00\x6d\x69\x6e\x67\x77\x6d\x31\x30\x2e\x64\x6c\x6c\x00\x5f\x5f\x6d\x69\x6e\x67\x77\x74\x68\x72\x5f\x72\x65\x6d\x6f\x76\x65\x5f\x6b\x65\x79\x5f\x64\x74\x6f\x72\x00\x5f\x5f\x6d\x69\x6e\x67\x77\x74\x68\x72\x5f\x6b\x65\x79\x5f\x64\x74\x6f\x72\x00\x00\x15\x88\x64\x4d\x69\x6e\x67\x77\x20\x72\x75\x6e\x74\x69\x6d\x65\x20\x66\x61\x69\x6c\x75\x72\x65\x3a\x0a\x00\x20\x20\x56\x69\x72\x74\x75\x61\x6c\x51\x75\x65\x72\x79\x20\x66\x61\x69\x6c\x65\x64\x20\x66\x6f\x72\x20\x25\x64\x20\x62\x79\x74\x65\x73\x20\x61\x74\x20\x61\x64\x64\x72\x65\x73\x73\x20\x25\x70\x00\x00\x00\x00\x20\x20\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x70\x73\x65\x75\x64\x6f\x20\x72\x65\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x70\x72\x6f\x74\x6f\x63\x6f\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x20\x25\x64\x2e\x0a\x00\x00\x00\x20\x20\x55\x6e\x6b\x6e\x6f\x77\x6e\x20\x70\x73\x65\x75\x64\x6f\x20\x72\x65\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x62\x69\x74\x20\x73\x69\x7a\x65\x20\x25\x64\x2e\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x91\x75\xc3\x4b\x00\x00\x00\x00\xaa\x70\x00\x00\x01\x00\x00\x00\x0d\x00\x00\x00\x0d\x00\x00\x00\x28\x70\x00\x00\x5c\x70\x00\x00\x90\x70\x00\x00\x38\x60\x00\x00\x80\x12\x00\x00\x80\x12\x00\x00\xe0\x12\x00\x00\xe0\x12\x00\x00\x80\x13\x00\x00\x80\x13\x00\x00\xc0\x13\x00\x00\xc0\x13\x00\x00\xf0\x13\x00\x00\xf0\x13\x00\x00\x30\x14\x00\x00\x30\x14\x00\x00\xc0\x70\x00\x00\xd2\x70\x00\x00\xea\x70\x00\x00\x04\x71\x00\x00\x1b\x71\x00\x00\x34\x71\x00\x00\x42\x71\x00\x00\x52\x71\x00\x00\x60\x71\x00\x00\x70\x71\x00\x00\x7e\x71\x00\x00\x8e\x71\x00\x00\x9c\x71\x00\x00\x00\x00\x01\x00\x02\x00\x03\x00\x04\x00\x05\x00\x06\x00\x07\x00\x08\x00\x09\x00\x0a\x00\x0b\x00\x0c\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x68\x61\x73\x68\x32\x6b\x65\x79\x2e\x64\x6c\x6c\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x68\x61\x73\x68\x32\x6b\x65\x79\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x68\x61\x73\x68\x32\x6b\x65\x79\x5f\x61\x6c\x6c\x6f\x63\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x68\x61\x73\x68\x32\x6b\x65\x79\x5f\x61\x6c\x6c\x6f\x63\x40\x38\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x68\x61\x73\x68\x32\x6b\x65\x79\x5f\x69\x6e\x69\x74\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x68\x61\x73\x68\x32\x6b\x65\x79\x5f\x69\x6e\x69\x74\x40\x30\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x31\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x31\x40\x38\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x32\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x32\x40\x38\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x33\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x33\x40\x38\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x34\x00\x6d\x61\x6a\x65\x73\x74\x79\x32\x5f\x78\x6f\x72\x34\x40\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe4\x82\x00\x00\xac\x80\x00\x00\x78\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x24\x83\x00\x00\xe8\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x81\x00\x00\x34\x81\x00\x00\x50\x81\x00\x00\x68\x81\x00\x00\x76\x81\x00\x00\x86\x81\x00\x00\x9a\x81\x00\x00\xac\x81\x00\x00\xc8\x81\x00\x00\xe0\x81\x00\x00\xf0\x81\x00\x00\xfe\x81\x00\x00\x0e\x82\x00\x00\x20\x82\x00\x00\x00\x00\x00\x00\x30\x82\x00\x00\x3e\x82\x00\x00\x48\x82\x00\x00\x50\x82\x00\x00\x5c\x82\x00\x00\x64\x82\x00\x00\x6e\x82\x00\x00\x78\x82\x00\x00\x80\x82\x00\x00\x8a\x82\x00\x00\x94\x82\x00\x00\x9e\x82\x00\x00\x00\x00\x00\x00\x1c\x81\x00\x00\x34\x81\x00\x00\x50\x81\x00\x00\x68\x81\x00\x00\x76\x81\x00\x00\x86\x81\x00\x00\x9a\x81\x00\x00\xac\x81\x00\x00\xc8\x81\x00\x00\xe0\x81\x00\x00\xf0\x81\x00\x00\xfe\x81\x00\x00\x0e\x82\x00\x00\x20\x82\x00\x00\x00\x00\x00\x00\x30\x82\x00\x00\x3e\x82\x00\x00\x48\x82\x00\x00\x50\x82\x00\x00\x5c\x82\x00\x00\x64\x82\x00\x00\x6e\x82\x00\x00\x78\x82\x00\x00\x80\x82\x00\x00\x8a\x82\x00\x00\x94\x82\x00\x00\x9e\x82\x00\x00\x00\x00\x00\x00\x6b\x00\x44\x65\x6c\x65\x74\x65\x43\x72\x69\x74\x69\x63\x61\x6c\x53\x65\x63\x74\x69\x6f\x6e\x00\x75\x00\x44\x69\x73\x61\x62\x6c\x65\x54\x68\x72\x65\x61\x64\x4c\x69\x62\x72\x61\x72\x79\x43\x61\x6c\x6c\x73\x00\x7e\x00\x45\x6e\x74\x65\x72\x43\x72\x69\x74\x69\x63\x61\x6c\x53\x65\x63\x74\x69\x6f\x6e\x00\x00\xd6\x00\x46\x72\x65\x65\x4c\x69\x62\x72\x61\x72\x79\x00\x45\x01\x47\x65\x74\x4c\x61\x73\x74\x45\x72\x72\x6f\x72\x00\x00\x51\x01\x47\x65\x74\x4d\x6f\x64\x75\x6c\x65\x48\x61\x6e\x64\x6c\x65\x41\x00\x00\x6c\x01\x47\x65\x74\x50\x72\x6f\x63\x41\x64\x64\x72\x65\x73\x73\x00\x00\xec\x01\x49\x6e\x69\x74\x69\x61\x6c\x69\x7a\x65\x43\x72\x69\x74\x69\x63\x61\x6c\x53\x65\x63\x74\x69\x6f\x6e\x00\x0b\x02\x4c\x65\x61\x76\x65\x43\x72\x69\x74\x69\x63\x61\x6c\x53\x65\x63\x74\x69\x6f\x6e\x00\x00\x0c\x02\x4c\x6f\x61\x64\x4c\x69\x62\x72\x61\x72\x79\x41\x00\x00\xfd\x02\x54\x6c\x73\x47\x65\x74\x56\x61\x6c\x75\x65\x00\x16\x03\x56\x69\x72\x74\x75\x61\x6c\x41\x6c\x6c\x6f\x63\x00\x00\x1e\x03\x56\x69\x72\x74\x75\x61\x6c\x50\x72\x6f\x74\x65\x63\x74\x00\x00\x21\x03\x56\x69\x72\x74\x75\x61\x6c\x51\x75\x65\x72\x79\x00\x00\x34\x00\x5f\x5f\x64\x6c\x6c\x6f\x6e\x65\x78\x69\x74\x00\xb6\x00\x5f\x65\x72\x72\x6e\x6f\x00\x00\x0a\x01\x5f\x69\x6f\x62\x00\x00\x1a\x02\x5f\x77\x69\x6e\x6d\x61\x6a\x6f\x72\x00\x47\x02\x61\x62\x6f\x72\x74\x00\x53\x02\x63\x61\x6c\x6c\x6f\x63\x00\x00\x62\x02\x66\x66\x6c\x75\x73\x68\x00\x00\x71\x02\x66\x72\x65\x65\x00\x00\x79\x02\x66\x77\x72\x69\x74\x65\x00\x00\xa4\x02\x6d\x61\x6c\x6c\x6f\x63\x00\x00\xaa\x02\x6d\x65\x6d\x63\x70\x79\x00\x00\xec\x02\x76\x66\x70\x72\x69\x6e\x74\x66\x00\x00\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x4b\x45\x52\x4e\x45\x4c\x33\x32\x2e\x64\x6c\x6c\x00\x00\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x14\x80\x00\x00\x6d\x73\x76\x63\x72\x74\x2e\x64\x6c\x6c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x15\x88\x64\xc0\x14\x88\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\xa0\x88\x64\x1c\xa0\x88\x64\x48\x60\x88\x64\x04\x90\x88\x64\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x0c\x01\x00\x00\x0d\x30\x15\x30\x3d\x30\x45\x30\x69\x30\x73\x30\x88\x30\x9d\x30\xf6\x30\x2f\x31\x3c\x31\x41\x31\xb9\x31\xcb\x31\xe2\x31\xe9\x31\xf1\x31\xfc\x31\x0e\x32\x24\x32\x45\x32\x57\x32\x6d\x32\xe7\x32\xf1\x32\xfb\x32\x10\x33\x20\x33\x66\x33\x6b\x33\x09\x35\x17\x35\x20\x35\x48\x35\x53\x35\x62\x35\x70\x35\x80\x35\x88\x35\x8d\x35\x9a\x35\x9f\x35\xb0\x35\xba\x35\xc4\x35\xf9\x35\x03\x36\x18\x36\x27\x36\x37\x36\x3d\x36\x54\x36\x68\x36\x72\x36\x8b\x36\xaf\x36\x99\x37\xb7\x37\xd6\x37\xdb\x37\xe4\x37\xf2\x37\xfa\x37\x04\x38\x0e\x38\x17\x38\x3e\x38\x45\x38\x79\x38\x84\x38\x8f\x38\xb3\x38\x19\x39\x4d\x39\x67\x39\x74\x39\x80\x39\x9a\x39\xaa\x39\xbd\x39\xdc\x39\xf8\x39\x04\x3a\x19\x3a\x2b\x3a\x36\x3a\x6f\x3a\xb7\x3a\xc2\x3a\xcd\x3a\xe1\x3a\xeb\x3a\x03\x3b\x28\x3b\x43\x3b\x4d\x3b\x72\x3b\x96\x3b\xa9\x3b\xb8\x3b\xea\x3b\xfc\x3b\x02\x3c\x0f\x3c\x22\x3c\x2a\x3c\x32\x3c\x3a\x3c\x42\x3c\x4a\x3c\x52\x3c\x5a\x3c\x62\x3c\x6a\x3c\x72\x3c\x7a\x3c\x82\x3c\x8a\x3c\x92\x3c\x9a\x3c\xa2\x3c\xaa\x3c\xb2\x3c\xba\x3c\xc2\x3c\xca\x3c\xd2\x3c\xda\x3c\xee\x3c\x00\x3d\x00\x30\x00\x00\x0c\x00\x00\x00\xe0\x33\x00\x00\x00\x40\x00\x00\x0c\x00\x00\x00\xa0\x30\x00\x00\x00\x90\x00\x00\x0c\x00\x00\x00\x04\x30\x08\x30\x00\xa0\x00\x00\x10\x00\x00\x00\x00\x30\x04\x30\x08\x30\x0c\x30\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
calldll MEMORY_FILE3 majesty2_hash2key_init stdcall majesty2_hash2key_function
calldll MEMORY_FILE3 majesty2_hash2key_function stdcall "" QUICKBMS_HASH MYKEY

math CRC = 0
for i = 0 < 16
    getvarchr TMP MYKEY i
    math i += 1
    getvarchr TMP2 MYKEY i
    math i += 1
    math TMP2 <<= 8
    math TMP |= TMP2
    math CRC ^= TMP
next
math CRC &= 0xffff
if CRC == 0
    print "Error: the file can't be decrypted/encrypted (CRC 0 as stated by the game, so it's ok)"
    cleanexit
endif

get NAME basename
if SIGN == 0x04034b50
    # ZIP->PAK encryption
    calldll MEMORY_FILE3 majesty2_xor3 stdcall "" MEMORY_FILE SIZE

    encryption aes MYKEY "" 1 16
    log MEMORY_FILE 0 SIZE MEMORY_FILE
    encryption "" ""

    calldll MEMORY_FILE3 majesty2_xor4 stdcall "" MEMORY_FILE SIZE

    string NAME += ".pak"
else
    # PAK->ZIP decryption
    calldll MEMORY_FILE3 majesty2_xor1 stdcall "" MEMORY_FILE SIZE

    encryption aes MYKEY "" 0 16
    log MEMORY_FILE 0 SIZE MEMORY_FILE
    encryption "" ""

    calldll MEMORY_FILE3 majesty2_xor2 stdcall "" MEMORY_FILE SIZE

    string NAME += ".zip"
endif
log NAME 0 SIZE MEMOR


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring XDAT
get DUMMY long
get DUMMY short
get VER short
get DUMMY long

set NAMESZ long 0x30
if VER > 3
    set NAMESZ long 0x40
endif

for
    getdstring NAME NAMESZ
    get TYPE long
    if TYPE == 0xffffffff
        cleanexit
    endif
    get OFFSET long
    get SIZE long

    log NAME OFFSET SIZE
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.3.14c
idstring "MOPA"
get VERSION long
get INFO_SIZE long
putarray 0 0 "NONE"
for i = 1 <= 3
    getdstring CODEC 4
    putarray 0 i CODEC
next i

log MEMORY_FILE 0x18 INFO_SIZE
get DUMMY long MEMORY_FILE
get FILES long MEMORY_FILE

for i = 0 < FILES
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get NAME_OFF long MEMORY_FILE
    get ZSIZE long MEMORY_FILE

    math CODEC = NAME_OFF
    math CODEC >>= 29
    math NAME_OFF &= 0x1fffffff

    savepos TMP MEMORY_FILE
    goto NAME_OFF MEMORY_FILE
    get NAME string MEMORY_FILE
    goto TMP MEMORY_FILE

    getarray CODEC 0 CODEC
    if CODEC == "NONE"
        log NAME OFFSET SIZE
    elif CODEC == "LZSS"
        comtype mohlzss
        clog NAME OFFSET ZSIZE SIZE
    elif CODEC == "RLE "
        comtype mohrle
        clog NAME OFFSET ZSIZE SIZE
    else
        print "Error: unknown codec (%CODEC%)"
        cleanexit
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype deflate

idstring "FFCS"
get DUMMY long
get DUMMY long
set INDX_ENTRIES long 0
for i = 0 < 5
    getdstring TYPE_NAME 4
    get TYPE_OFFSET long
    get TYPE_ENTRIES long
    if TYPE_NAME == "INDX"
        set INDX_OFFSET long TYPE_OFFSET
        set INDX_ENTRIES long TYPE_ENTRIES
    elif TYPE_NAME == "PTHS"
        set PTHS_OFFSET long TYPE_OFFSET
        set PTHS_ENTRIES long TYPE_ENTRIES
    endif
next i

goto PTHS_OFFSET
for i = 0 < PTHS_ENTRIES
    get NAME string
    putarray 0 i NAME
next i

goto INDX_OFFSET
for i = 0 < INDX_ENTRIES
    get OFFSET long
    get DUMMY long
    get SIZE long
    getarray NAME 0 i

    math OFFSET *= 0x8000
    math SIZE &= 0xffff # ???
    math SIZE *= 0x8000

    #log NAME OFFSET SIZE
    callfunction unpack_block
next i

startfunction unpack_block
    savepos RET_OFF
    goto OFFSET
    getdstring SIGN 4
    if SIGN != "sges"
        log NAME OFFSET SIZE
    else
        get DUMMY short # possible comtype?
        get CHUNKS short
        get TOTAL_SIZE long
        get TOTAL_ZSIZE long
        savepos TMP_OFF
        math CHUNKS -= 1

        putvarchr MEMORY_FILE TOTAL_SIZE 0
        log MEMORY_FILE 0 0
        append
        for x = 0 <= CHUNKS
            if x < CHUNKS
                get CHUNK_ZSIZE long
                set CHUNK_SIZE long 0x10000
                get CHUNK_OFFSET long
            else
                get CHUNK_ZSIZE short
                get CHUNK_SIZE short
                get CHUNK_OFFSET long
            endif
            math CHUNK_OFFSET -= 1
            math CHUNK_OFFSET += OFFSET
            if CHUNK_ZSIZE == CHUNK_SIZE
                log MEMORY_FILE CHUNK_OFFSET CHUNK_SIZE
            else
                clog MEMORY_FILE CHUNK_OFFSET CHUNK_ZSIZE CHUNK_SIZE
            endif
        next x
        append
        #get SIZE asize MEMORY_FILE
        #log NAME 0 SIZE MEMORY_FILE
        callfunction dump_ucfx
    endif
    goto RET_OFF
endfunction

startfunction dump_ucfx
    set BCK_NAME string NAME
    goto 0 MEMORY_FILE
    get SUB_FILES long MEMORY_FILE
    math SUB_FILES &= 0xff  # blocks\VZ\text_effect_P000_Q3.block
    set SUB_OFFSET long SUB_FILES
    math SUB_OFFSET *= 16
    math SUB_OFFSET += 4
    for x = 0 < SUB_FILES
        get DUMMY long MEMORY_FILE
        get DUMMY long MEMORY_FILE
        get ZERO long MEMORY_FILE
        get SUB_SIZE long MEMORY_FILE
        log NAME SUB_OFFSET SUB_SIZE MEMORY_FILE
        math SUB_OFFSET += SUB_SIZE
        set NAME string BCK_NAME
        string NAME += "_"
        string NAME += x
    next x
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring GAME 0x20
get FILES long
goto 0x40
for i = 0 < FILES
    getdstring NAME 0x68
    set EXT extension NAME
    get OFFSET long
    get SIZE long
    getdstring DUMMY 0x10
    if EXT == "txt"
        log MEMORY_FILE OFFSET SIZE
        callfunction DECRYPT 1
        log NAME 0 SIZE MEMORY_FILE
    else
        log NAME OFFSET SIZE
    endif
next i

startfunction DECRYPT
    math ESI = 0x1234
    for j = 0 < SIZE
        getvarchr T MEMORY_FILE j
        math T ^= ESI
        math T2 = T
        math T <<= 1
        math T3 = T
        math T2 >>= 1
        math T2 ^= T3
        math T2 &= 0x55
        math T ^= T2
        math ESI *= 3
        math ESI += 2
        putvarchr MEMORY_FILE j T
    next j
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
endian big
get SIGN long
if SIGN != 0x9e2a83c1
    print "the input file doesn't seem a MK9 archive"
endif
goto 0x14
get NAMESZ long
getdstring NAME NAMESZ
getdstring DUMMY 0x40
get FILES long
savepos TMP_OFF
math NAME_OFF = FILES
math NAME_OFF *= 0x10
math NAME_OFF += TMP_OFF
math NAME_OFF += 0x20
for i = 0 < FILES
    get DUMMY long
    get DUMMY long
    get OFFSET long
    get SIZE long
    savepos TMP_OFF
    goto NAME_OFF
    get NAMESZ long
    getdstring NAME NAMESZ
    getdstring DUMMY 0x10
    savepos NAME_OFF
    callfunction EXTRACT
    goto TMP_OFF
next i

startfunction EXTRACT
    goto OFFSET
    get SIGN long
    if SIGN == 0x9e2a83c1
        get CHUNK_SIZE long
        get FILE_ZSIZE long
        get FILE_SIZE long
        putvarchr MEMORY_FILE FILE_SIZE 0
        log MEMORY_FILE 0 0
        math CHUNKS = FILE_SIZE
        math TMP = 0
        if CHUNKS % CHUNK_SIZE
            math TMP = 1
        endif
        math CHUNKS /= CHUNK_SIZE
        math CHUNKS += TMP
        math OFFSET += SIZE
        math OFFSET -= FILE_ZSIZE
        append
        for j = 0 < CHUNKS
            get CHUNK_ZSIZE long
            get CHUNK_SIZE long
            clog MEMORY_FILE OFFSET CHUNK_ZSIZE CHUNK_SIZE
            math OFFSET += CHUNK_ZSIZE
        next j
        append
        log NAME 0 FILE_SIZE MEMORY_FILE
    else
        log NAME OFFSET SIZE
    endif
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "MJZ0"
get VER long
get FILES long
get DUMMY long
for i = 0 < FILES
    if VER == 0
        getdstring NAME 0x80
    endif
    get TYPE long
    get OFFSET long
    get SIZE long
    get ZSIZE long
    if VER > 0
        get NAMESZ byte
        getdstring NAME NAMESZ
    endif

    if TYPE == 0
        # no compression
    elif TYPE == 10
        comtype unzip_dynamic #zlib no!
    elif TYPE == 6
        comtype lzma86head
    elif TYPE == 1
        # folder
    else
        print "unknown TYPE %TYPE%, contact me"
        cleanexit
    endif
    if TYPE == 0
        log NAME OFFSET SIZE
    elif TYPE != 1  # skip folders
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
endian big
idstring "filE"
goto 0x1c
get ARCHIVES long
get FILES long
get FOLDERS long
get NAMES_SIZE long

get NAMES_OFF asize
math NAMES_OFF -= NAMES_SIZE

for i = 0 < ARCHIVES
    get NAME_OFF long
    get DUMMY long
    savepos TMP
    math NAME_OFF += NAMES_OFF
    goto NAME_OFF
    get NAME string
    goto TMP
    set j strlen NAME
    for j -= 1 > 0
        math j -= 1
        getvarchr TMP NAME j
        if TMP == '\\'
            math j += 1
            string NAME <= j
            math j = 0
        endif
    next
    putarray 0 i NAME
next i

math OLD_NUM = -1
for i = 0 < FILES
    get DUMMY3 long
    get FOLDER_OFF long
    get NAME_OFF long
    get SIZE long
    get DUMMY6 long
    get DUMMY7 long
    get OFFSET long
    get ARCHIVE_NUM byte
    get DUMMY1 byte
    get DUMMY2 short
    if OFFSET != -1
        savepos TMP
        math NAME_OFF += NAMES_OFF
        goto NAME_OFF
        get NAME string
        math FOLDER_OFF += NAMES_OFF
        goto FOLDER_OFF
        get FNAME string
        goto TMP
        string FNAME += NAME
        if ARCHIVE_NUM != OLD_NUM
            getarray ARCHIVE_NAME 0 ARCHIVE_NUM
            open FDSE ARCHIVE_NAME 1
            math OLD_NUM = ARCHIVE_NUM
        endif
        log FNAME OFFSET SIZE 1
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "\xde\x8c\x45\x3d"
get FILES long
for i = 0 < FILES
    get ENTRYSZ long
    get OFFSET long
    get ZSIZE long
    get SIZE long
    get NAMESZ long
    getdstring NAME NAMESZ
    if SIZE == 0
        log NAME OFFSET SIZE
    else if SIZE == ZSIZE
        log NAME OFFSET ZSIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get UNZIP byte
get OFFSET long
goto OFFSET
get FILES long

for i = 0 < FILES
    get N long
    getdstring NAME N

    set D long N
    math D %= 5
    for j = 0 < N
        getvarchr CHR NAME j
        set TMP N
        math TMP += j
        math TMP <<= 1
        math TMP += D
        math TMP += i
        math CHR ^= TMP
        putvarchr NAME j CHR
    next j

    get OFFSET long
    get SIZE long
    get ZSIZE long

    if UNZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
endian big
idstring "PAK " # automatic endian
goto 0
getdstring PAK_SIGN 4
get VERSION long
math VERSION &= 0xff
get FILES long

goto 0x118
get X118 long
goto 0x120
get X120 long
math X120 -= 0x308
goto 0x12d
get X12d byte

if X12d == 1
    print "X12d equal to %X12d% has not been tested, contact me"
    cleanexit
endif

set PCARS_NUM long 0
if VERSION == 4
    # lame scanner for Project Cars, sorry...
    if PAK_SIGN == "PAK "
        math TMP_OFF = 0x8
    else
        math TMP_OFF = 0xc
    endif
    for PCARS_NUM = 0 < 0x16
        callfunction X12dset 1
        log MEMORY_FILE 0x130 0x10
        getvarchr ZERO MEMORY_FILE TMP_OFF long
        if ZERO == 0
            break
        endif
    next PCARS_NUM
endif

callfunction X12dset 1
log MEMORY_FILE 0x130 X118

if VERSION == 4 # Project Cars
    # names are not supported because they use a boring
    # and chaotic obfuscation method (no rc4), if one
    # day I will have time and desire maybe I will look
    # at them
    set X120OFFSET long 0
else
    callfunction X12dset 1
    set X120OFFSET long 0x438
    math X120OFFSET += X118
    log MEMORY_FILE2 X120OFFSET X120
endif

goto 0 MEMORY_FILE
for i = 0 < FILES
    encryption "" ""    # reset here instead to do it after each *log

    get DUMMY   long MEMORY_FILE
    get DUMMY   long MEMORY_FILE
    get OFFSET  longlong MEMORY_FILE
    get ZSIZE   long MEMORY_FILE
    get SIZE    long MEMORY_FILE
    get DUMMY   long MEMORY_FILE
    get DUMMY   long MEMORY_FILE
    get TYPE    byte MEMORY_FILE
    get DUMMY   byte MEMORY_FILE
    get CRC     long MEMORY_FILE
    get FILEEXT long MEMORY_FILE

    if X120OFFSET != 0
        get NAMEOFF longlong MEMORY_FILE2
        get DUMMY   long MEMORY_FILE2
        get DUMMY   long MEMORY_FILE2
        savepos TMP MEMORY_FILE2
        math NAMEOFF -= X120OFFSET
        goto NAMEOFF MEMORY_FILE2
        get NAMESZ  byte MEMORY_FILE2
        getdstring  NAME NAMESZ MEMORY_FILE2
        goto TMP MEMORY_FILE2
    else
        set EXT string ""
        putvarchr EXT 0 FILEEXT byte
        math FILEEXT >>= 8
        putvarchr EXT 1 FILEEXT byte
        math FILEEXT >>= 8
        putvarchr EXT 2 FILEEXT byte
        math FILEEXT >>= 8
        putvarchr EXT 3 FILEEXT byte
        string NAME p= "%08x.%s" OFFSET EXT
    endif

    callfunction X12dset 1
    if TYPE == 0
        log NAME OFFSET SIZE
    elif TYPE == 1
        comtype zlib
        clog NAME OFFSET ZSIZE SIZE
    elif TYPE == 2
        comtype XMemDecompress
        clog NAME OFFSET ZSIZE SIZE
    else
        print "TYPE equal to %TYPE% has not been tested, contact me"
        cleanexit
    endif
next i

startfunction X12dset
    if X12d == 1    # ignored at the moment
        math TMPSZ += 0xf
        math TMPSZ &= 0xfffffff0
    endif
    if X12d == 2
        encryption rc4 "@lLy0urRaC3ar3bE"
    endif
    if VERSION == 4 # Project Cars
        callfunction PROJECTCARS_KEY 1
    endif
endfunction

startfunction PROJECTCARS_KEY
    math PCARS_OFF = PCARS_NUM
    math PCARS_OFF *= 0x1b
    #set MEMORY_FILE3 binary "\xfe\xb5\xaa\xe7\x8b\xe2\xcc\xb1\xd8\x9e\xa3\xe0\xde\xbf\xbf\x87\x00\x57\x4f\x66\x59\x34\x71\x53\x30\x4b\x00\x99\xaf\xda\x8f\x92\xcd\xf1\xa2\xdc\x94\x9b\xaa\x94\xf2\xce\xca\xed\xf2\xe4\x00\x65\x39\x45\x51\x2b\x3f\x00\xf6\x9a\xd1\x9f\xad\xe0\x87\xe3\xbd\xd1\x86\xfc\xed\x84\xf9\xdf\xb4\xba\xe1\xa8\xe5\xd8\xf2\xff\x00\x70\x00\x9d\x8f\xca\x9e\x85\xea\xdc\xf6\xaa\xe2\x9c\xc6\xce\x97\xae\x91\x96\xf5\xda\xf2\xa4\x84\x00\x65\x32\x72\x00\xc0\x93\xd8\xd7\xf0\xa2\xc5\xec\xa3\xc2\xe4\xb2\xce\xec\xdf\xc1\x8a\x00\x51\x41\x2b\x65\x70\x65\x74\x3f\x00\xe5\x89\xe7\xfd\x86\xdc\xc3\xa2\xc9\xe8\xb2\xd1\xeb\xbb\xb9\x84\x89\xa5\xd8\x00\x35\x73\x50\x41\x2a\x75\x00\xd8\x9d\xa7\xcb\x81\xaa\x84\xe0\xfd\x9c\xb5\xcf\x84\xaa\xe0\x99\x85\x00\x72\x65\x4a\x65\x73\x35\x45\x53\x00\xde\xef\xce\xef\x82\xa6\x94\xf3\xdc\x94\xe4\xe4\xd1\xbf\xd1\x93\x00\x68\x75\x57\x52\x75\x6b\x45\x64\x72\x00\xef\x8d\xe3\xf6\xf4\xc9\xeb\x9c\xbe\xf3\xb2\xa0\xda\x88\xf3\xde\x95\xbc\xe6\x9f\x00\x75\x21\x65\x52\x65\x00\xd2\x91\xeb\xe3\x96\xc0\xd6\xb1\xe9\xfe\xa8\xe3\xe1\xaa\xab\xf0\x97\xd1\xda\xa9\xd0\xe3\xe9\xbc\xec\x00\x00\x9b\xb5\xe8\xd8\xf7\xf1\xc3\x8c\xd3\x98\xb5\xc0\xd4\xb7\xe6\xf5\x8a\xf4\x92\xf4\xe9\xc3\xaa\x00\x2a\x33\x00\xd4\x80\xb2\x86\xe0\xbe\xe3\xf5\xe8\xcc\xbf\xc7\xdf\xf8\xf5\xfd\x96\xbd\x8b\x83\xf3\x00\x74\x68\x65\x3f\x00\x89\x82\xc4\xdb\xab\xb2\xc1\xf0\xcf\x92\xfd\xa2\xed\x93\xc9\xeb\xfe\xf1\xe8\xef\xa2\x00\x55\x70\x2b\x73\x00\x92\x89\xfa\xcd\x91\xd4\xd1\xb7\xec\x87\xbf\xec\xcf\x9e\xcd\xfc\xf4\x00\x42\x72\x45\x5a\x65\x6a\x61\x77\x00\xdf\xaf\xfe\xfb\x8f\xa5\x9d\xec\xf6\xe9\xa1\xc6\xc6\x8d\xeb\xd5\x00\x53\x57\x65\x70\x52\x65\x64\x72\x65\x00\xd6\xb4\xbf\xf1\x85\xe3\xf9\xa9\xaf\xcc\xe9\xa0\xe3\x95\xd8\x85\xbb\xaa\xe7\xee\x00\x23\x55\x70\x23\x53\x00\xd7\xa8\xd5\xea\xeb\xa6\xe6\x8f\xae\xf2\x91\xac\xdd\xf4\xa0\x82\xb9\xb5\x87\x8d\xab\x9d\xea\xd8\x9b\x00\x00\x88\xb1\xc8\xfa\xfe\xf3\xcf\xbd\xc0\xe0\xa3\xda\xd7\xec\xe9\xd0\xb3\xd0\xe5\xa0\xfb\xe1\xf1\xfd\x99\x00\x00"  # before 197
    set MEMORY_FILE3 binary "\xE8\xEC\xF0\xFF\xF2\xA9\xC4\x87\xA2\xE5\xA1\xEA\x8B\xAF\xD4\xEE\x00\x57\x4F\x66\x59\x34\x71\x53\x30\x4B\x00\xEB\xF3\xBC\xEF\xFD\xE1\xC5\x97\xB0\xE5\x9A\xAC\xC6\xB4\xBB\xD7\xB2\xBD\x9D\x89\xD5\x80\xFC\xE2\xEB\x00\x00\xCC\xEC\xA9\xE1\x83\xD4\xEA\x90\xE4\xC9\xFA\xA0\x94\x88\xBA\xCB\xF0\xEF\x80\xAE\xAC\x00\x75\x39\x61\x70\x00\xCC\x8A\xE1\x8D\xE9\xBF\x88\xB0\xC2\xD9\xA7\xA0\xEB\xE2\xF3\x99\x87\xD9\xCF\xB3\xAE\xDC\xA9\xF5\xDC\x00\x00\xC6\xF6\xB5\xC2\xED\xF3\xEC\x91\xC2\xC3\x81\xCA\x89\xF1\xA1\xDB\x92\xC6\xEF\xE9\xF9\xD6\xBD\x00\x74\x3F\x00\x94\x8E\xD0\xD4\x8C\xA8\x96\xBA\xB9\x87\xE9\xFE\xE4\xF1\xD1\x86\x94\xC7\x00\x67\x35\x73\x50\x41\x2A\x75\x00\x88\x93\xAE\x8D\xE6\xB8\xEA\x89\xDE\x95\x92\xD6\xD0\xB0\xB2\xD7\xA6\xDD\x9B\xF7\xF5\x00\x73\x35\x45\x53\x00\xF8\x8F\xF9\xC6\xB9\xAC\xC6\xA4\xF4\xED\xB0\xDE\x81\xF3\xC7\xED\x8D\xAB\xE3\xB4\x00\x75\x6B\x45\x64\x72\x00\xFA\xA0\xA6\xF5\x93\xCF\xCA\xFA\xDF\xDA\x81\xB9\xDA\x87\xFA\xD4\xA8\xD0\x00\x66\x3F\x75\x21\x65\x52\x65\x00\xD1\xF1\xA3\xCF\xAE\xFC\x93\xE3\xAC\xF2\xA5\xEA\x82\xAD\xDA\xF6\xA5\xF4\x84\xBF\xBC\xCC\x00\x2D\x61\x66\x00\xEF\x8E\xAB\xFC\xF6\xC1\xC4\x98\xE1\x89\xFD\xA0\xCC\x91\xEF\x95\xF0\xFE\x84\xFF\xFB\xE6\x91\xB2\xDE\x91\x00\xDD\xA6\xAC\xDC\xF4\xC7\xFE\x81\xDD\xD7\xBD\xF8\xDB\xFA\xA7\xD5\xF8\xC4\xF7\xF1\xF1\xDE\xA0\x00\x65\x3F\x00\xFB\x98\xDF\xE4\xA5\xDD\xFB\x80\xC8\xF3\xBB\xA4\xD8\x86\xB9\xED\xE2\xCE\x82\xAF\xC8\x88\xA3\xFD\x00\x73\x00\xE2\xEB\xD4\xFF\xF8\xF3\x89\xE2\xFC\xD4\xBB\xB5\xD7\xE6\xCA\xF6\x8A\xFD\xCC\xAC\xA1\xF6\x00\x6A\x61\x77\x00\xE0\xF4\xFD\xCF\xB9\xED\xF1\x86\xF0\x97\x81\xEC\xC1\xF3\xD3\x82\x95\xD9\xF1\xEC\x00\x52\x65\x64\x72\x65\x00\xE3\xA2\xC0\xCD\xED\xA3\xDF\xAB\xFA\xF2\x92\xE8\x9C\xB6\xFE\xC5\xB2\xE1\x82\xBD\xD5\x00\x55\x70\x23\x53\x00\xD2\x8B\xF3\xFD\xE6\xC9\xFF\xF4\xEC\x88\x97\xA1\x93\xB2\xE0\xF5\x8E\xCB\x99\x88\xAB\xCE\x99\xB8\x00\x61\x00\xED\xEB\xC4\xDC\xEF\xC7\xCF\x81\xE8\x8F\xA1\xFB\xC4\xE4\xBB\xCF\x9C\xB2\xEC\x95\xBB\xC8\xF0\xCB\x86\x00\x00"  # 197

    goto PCARS_OFF MEMORY_FILE3
    getdstring PCARS_KEY 0x1b MEMORY_FILE3
    strlen PCARS_KEYSZ PCARS_KEY

    # xor 0x1b and 3 are multiples so no need of byte per byte xor
    encryption xor "\xac\xc7\x91"
    get TMP asize MEMORY_FILE3
    log MEMORY_FILE3 0 TMP MEMORY_FILE3

    # reverse short
    math j = PCARS_OFF
    for x = PCARS_KEYSZ > 1
        getvarchr TMP MEMORY_FILE3 j short
        reverseshort TMP
        putvarchr MEMORY_FILE3 j TMP short
        math j += 2
        math x -= 2
    next

    # get key
    goto PCARS_OFF MEMORY_FILE3
    getdstring PCARS_KEY PCARS_KEYSZ MEMORY_FILE3

    # encryption key
    encryption rc4 PCARS_KEY "" 0 PCARS_KEYSZ

    #other pre-built keys used somewhere else:
    #encryption rc4 "QgT~(x/x}yON{0Db02,M?_1g_W+FuI}kGE[sZ"
    #encryption rc4 "4!spu3eyEpED?+ud6E4etHe=7?!fa"
    #encryption rc4 "9TEXU+u#U*h+D=efUcRudach$&"
    #encryption rc4 "jetracR--acr_t-tr*7*dadrab"
    #encryption rc4 "j@yutranemuwece9Azatra?wa*"
    #encryption rc4 "pUphe-apru=UWraBRu7@SW-xa#"
    #encryption rc4 "d+!ugapH=stephacUchucresUC"
    #encryption rc4 "we$r8truSpaT7aT7Edasw7sPap"
    #encryption rc4 "+h5@u7!a7h9w8aCaqeya&rutac"
    #encryption rc4 "PrEthAk$ke5RaxudrEKunAVabE"
    #encryption rc4 "quwa?7@tew8era!EcRE@uf+FRu"
    #encryption rc4 "j*qabaqu#7ufr7y=trUb!P@afe"
    #encryption rc4 "B5u3AS6eQUwruY&?!u-rA4*te6"
    #encryption rc4 "sPE32u2aS!ezEyakawuKE7uhes"
    #encryption rc4 "fr2BaPujuwekasa$e5ap*te2ax"
    #encryption rc4 "tuth6&r=swexe6uCedabr#vefa"
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get DUMMY long
idstring "PFF3"
get FILES long
get DUMMY long
get INFO_OFF long
goto INFO_OFF
for i = 0 < FILES
    get DUMMY long
    get OFFSET long
    get SIZE long
    get DUMMY long
    getdstring NAME 16
    get DUMMY long
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring SIGN 8
if SIGN == "NovaPack"
    get DUMMY long
else
    goto 0
    getdstring SIGN 12  # we need SIGN!
    if SIGN != "NovaHackPack"
        cleanexit
    endif
endif
get OFFSET long
goto OFFSET
if SIGN == "NovaPack"
    idstring "DictStart"
else
    idstring "DictionaryBegin"
endif
get FILES long
for i = 0 < FILES
    if SIGN == "NovaPack"
        get NAMESZ long
    else
        get NAMESZ short
    endif
    getdstring NAME NAMESZ
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype bzip2
set PATH string ""
set NAME string ""
get XFOLDERS long
get XFILES long
callfunction EXTRACT

startfunction EXTRACT
    string PATH += NAME
    string PATH += /
    math FILES = XFILES
    for i = 0 < FILES
        get NAMESZ long
        getdstring NAME NAMESZ
        get TYPE byte
        get OFFSET long
        get XFOLDERS long
        get XFILES long
        get SIZE long
        get ZSIZE long
        if TYPE == 0
            set FNAME string PATH
            string FNAME += NAME
            if ZSIZE == 0
                log FNAME OFFSET SIZE
            else
                clog FNAME OFFSET ZSIZE SIZE
            endif
        else
            callfunction EXTRACT
        endif
    next i
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver "0.4.6"

set TYPE long 0
getdstring SIGN 34
set SIGN unicode SIGN
if SIGN != "PKG_FILE_VERSION:"
    cleanexit
endif
getdstring VER 8
set VER unicode VER
set VER long VER

if VER == 4
    goto -8
    savepos MAX_OFFSET
    get INFO_SIZE long
    get INFO_OFF long
else if VER == 5
    goto -12
    savepos MAX_OFFSET
    get INFO_SIZE long
    get INFO_OFF long
    get TYPE long
else
    print "unknown PKG version %VER%, contact me!"
    cleanexit
endif

if INFO_SIZE u> MAX_OFFSET
    math INFO_SIZE = MAX_OFFSET
    math INFO_SIZE -= INFO_OFF
    # cleanexit
endif

set ENCRYPTED long 0
if TYPE & 0x100
    set ENCRYPTED long 1
endif

log MEMORY_FILE INFO_OFF INFO_SIZE

for
    savepos INFO_OFF MEMORY_FILE
    if INFO_OFF >= INFO_SIZE
        cleanexit
    endif
    get ENTRY_SIZE long MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get CRC long MEMORY_FILE
    math ENTRY_SIZE -= 16
    getdstring NAME ENTRY_SIZE MEMORY_FILE
    set NAME unicode NAME

    if OFFSET != -1
        if ENCRYPTED != 0
            filexor "0x5c 0x7b 0xe3 0xea 0xec 0xac 0x5e 0xb8 0x6d 0x0b 0xd4 0xcd 0xce 0x85 0x34 0xea 0x80 0x56 0x52 0x86 0x23 0x68 0x6a 0x83 0x24 0x0b 0xeb 0xee 0x4e 0xcf 0x15 0x0f 0x38 0xbc 0x15 0x09 0x79 0xb9 0x76 0xa3 0x9c 0x85 0xc6 0xe1 0xdd 0x9c 0xfb 0x4d 0xb6 0xc3" OFFSET
        endif
        log NAME OFFSET SIZE
        filexor ""
    endif
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring SBPK
get FILES long

savepos NAMES_OFFSET
for i = 1 to FILES
    get FNAMESZ long
    getdstring  FNAME FNAMESZ
    get OFFSET  long
    get SIZE    long
next i

savepos FILES_OFFSET
goto NAMES_OFFSET
for i = 1 to FILES
    get FNAMESZ long
    getdstring  FNAME FNAMESZ
    get OFFSET  long
    get SIZE    long
    math OFFSET += FILES_OFFSET

    filexor 0xcc
    log FNAME OFFSET SIZE
    filexor 0
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype yakuza
endian big
idstring "PARC"
get hdr_unknownA long
get hdr_unknownB long
get hdr_unknownC long
get hdr_numFolders long
get hdr_foldersOfs long
get hdr_numFiles long
get hdr_filesOfs long

math foldNames = 32
math fileNames = hdr_numFolders
math fileNames *= 64
math fileNames += foldNames
math foldInfos = hdr_foldersOfs
math fileInfos = hdr_filesOfs

for i = 0 < hdr_numFolders
    goto foldInfos
    get foi_unknownA long
    get foi_unknownB long
    get foi_numFiles long
    get foi_fileOfs long
    get foi_unknownE long
    get foi_unknownF long
    get foi_unknownG long
    get foi_unknownH long
    savepos foldInfos

    goto foldNames
    getdstring foiName 64
    savepos foldNames

    for j = 0 < foi_numFiles
        math TMP = foi_fileOfs
        math TMP += j
        math TMP *= 32
        math TMP += fileInfos
        goto TMP
        get fi_comprFlags long
        get fi_fileSize long
        get fi_fileSizeComp long
        get fi_fileOfs long
        get fi_unknownE long
        get fi_unknownF long
        get fi_unknownG long
        get fi_chkSum long

        math TMP = foi_fileOfs
        math TMP += j
        math TMP *= 64
        math TMP += fileNames
        goto TMP
        getdstring fiName 64

        set fn string foiName
        string fn += /
        string fn += fiName
        if fi_comprFlags & 0x80000000
            math fi_fileOfs += 0x10
            math fi_fileSizeComp -= 0x10
            clog fn fi_fileOfs fi_fileSizeComp fi_fileSize
        else
            log fn fi_fileOfs fi_fileSize
        endif       
    next j
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.3.14b
set vbs_diff_key long 0
set pbo_folder string "."
set pbo_encryption long 0
set MYIVEC binary "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
get PBO_SIZE asize

for extract = 0 < 2
    goto 0
    do
        savepos ANTI_ANTI   # work-around for anti-extractors?

        set break_extract long 0

        if pbo_encryption <= 0
            get filename string
            get PackingMethod long
            get OriginalSize long
            get Reserved long
            get TimeStamp long
            get DataSize long
        else
            get filename string MEMORY_FILE
            get PackingMethod long MEMORY_FILE
            get OriginalSize long MEMORY_FILE
            get Reserved long MEMORY_FILE
            get TimeStamp long MEMORY_FILE
            get DataSize long MEMORY_FILE
        endif

        if PackingMethod == 0x56657273
            do
                if pbo_encryption <= 0
                    get filename string
                else
                    get filename string MEMORY_FILE
                endif
                if pbo_encryption < 0
                    if filename == "vbs1"
                        print "Error: vbs1 encryption is not implemented yet"
                        cleanexit
                    elif filename == "xor"      # exists?
                        print "Error: xor encryption is not implemented yet"
                        cleanexit
                    elif filename == "xor1024"  # exists?
                        print "Error: xor1024 encryption is not implemented yet"
                        cleanexit
                    elif filename == "vbs2"
                        set break_extract long 1    # the offset is known
                        if vbs_diff_key == 0    # vbs2_lite
                            set MYKEY binary "\x2D\xE5\x7A\x9F\xA0\xE0\x3B\x4D\xC8\xEB\xBB\x3C\x17\x2B\x04\x7E"
                            set MYXOR binary "\x76\x3F\x7D\x6E\x53\x27\x46\x4E\x32\x3D\x63\x22\x6C\x69\x4F\x2D"
                            #set MYKEY binary "\x5B\xDA\x07\xF1\xF3\xC7\x7D\x03\xFA\xD6\xD8\x1E\x7B\x42\x4B\x53" (result of the xor)
                        elif vbs_diff_key == 1  # vbs2_lite_us
                            set MYKEY binary "\x45\x86\xc6\x4e\x2c\x7b\x8a\xff\xcb\xa8\x36\x91\xab\xde\x7f\xaa"
                            set MYXOR binary "\xab\x86\x5d\x2b\x6f\xbc\xd4\xf1\xcc\x8d\x2b\x13\x9e\x6a\x27\x3c"
                            #set MYKEY binary "\xee\x00\x9b\x65\x43\xc7\x5e\x0e\x07\x25\x1d\x82\x35\xb4\x58\x96" (result of the xor)
                        else
                            print "Error: unsupported vbs2 encryption keys, contact me"
                            cleanexit
                        endif
                        callfunction xor_MYKEY 1
                    elif filename == "vbs2m"
                        set break_extract long 1    # the offset is known
                        if vbs_diff_key == 0    # vbs2_lite
                            set MYKEY binary "\x2D\xE5\x7A\x9F\xA0\xE0\x3B\x4D\xC8\xEB\xBB\x3C\x17\x2B\x04\x7E"
                            set MYXOR binary "\xb6\x94\x9e\xc7\x66\x8f\x32\xe8\x08\x47\x5d\x57\x92\x27\xac\xcc"
                            #set MYKEY binary "\x9b\x71\xe4\x58\xc6\x6f\x09\xa5\xc0\xac\xe6\x6b\x85\x0c\xa8\xb2" (result of the xor)
                        elif vbs_diff_key == 1  # vbs2_lite_us
                            set MYKEY binary "\x45\x86\xc6\x4e\x2c\x7b\x8a\xff\xcb\xa8\x36\x91\xab\xde\x7f\xaa"
                            set MYXOR binary "\x78\x2f\x1b\x6b\xcf\xaa\xf3\x70\x53\xab\x43\x79\x92\x46\xcc\x21"
                            #set MYKEY binary "\x3d\xa9\xdd\x25\xe3\xd1\x79\x8f\x98\x03\x75\xe8\x39\x98\xb3\x8b" (result of the xor)
                        else
                            print "Error: unsupported vbs2m encryption keys, contact me"
                            cleanexit
                        endif
                        callfunction xor_MYKEY 1
                    endif
                endif
                if pbo_folder == ""
                    set pbo_folder string filename
                endif
                if filename == "encryption"
                    set pbo_encryption long -1
                endif
                if filename == "prefix"
                    set pbo_folder string ""
                endif
            while filename != ""
            if pbo_encryption < 0
                if break_extract == 0
                    print "Error: unsupported PBO encryption, contact me"
                    cleanexit
                endif
                set pbo_encryption long 1
            endif
        endif

        if filename == "" # work-around for anti-extractors?
            if ANTI_ANTI > 0
                set break_extract long 1
            endif
        endif

        if extract != 0
            if filename != ""
                set fullname string pbo_folder
                string fullname += /
                string fullname += filename
                if PackingMethod == 0x456e6372
                    putvarchr MYIVEC 0  OriginalSize long
                    putvarchr MYIVEC 4  OriginalSize long
                    putvarchr MYIVEC 8  OriginalSize long
                    putvarchr MYIVEC 12 OriginalSize long
                    callfunction aes_workaround 1   # keep the 1 or the key will be modified!!!
                endif
                if PackingMethod == 0x43707273
                    comtype lzss
                    math OriginalSize -= 4  # checksum?
                    clog fullname OFFSET DataSize OriginalSize
                else
                    if PackingMethod == 0x456e6372
                        comtype copy
                        clog fullname OFFSET DataSize OriginalSize
                    else
                        log fullname OFFSET DataSize
                    endif
                endif
                math OFFSET += DataSize
                if PackingMethod == 0x456e6372
                    encryption "" ""
                endif
            endif
        endif
    while break_extract == 0

    if extract == 0
        if pbo_encryption == 0
            savepos OFFSET
        else
            get OriginalSize long
            get DataSize long
            savepos OFFSET
            math TMP = OFFSET
            math TMP += DataSize
            goto TMP
            getdstring MYIVEC 16
            #encryption aes MYKEY MYIVEC # ivec are the 16 bytes after the encrypted block ("\x4B\x64\x6B\x41\x4C\x40\x61\x4F\x6F\x79\x30\x3A\x7B\x65\x20\x6C" does nothing)
            callfunction aes_workaround 1
            log MEMORY_FILE OFFSET DataSize
            encryption "" ""
            math OFFSET = TMP
            goto OriginalSize MEMORY_FILE
            put "" string MEMORY_FILE
            put 0 long MEMORY_FILE
            put 0 long MEMORY_FILE
            put 0 long MEMORY_FILE
            put 0 long MEMORY_FILE
            put 0 long MEMORY_FILE
            goto 0 MEMORY_FILE
            callfunction lame_vbs_diff_key_check 1
        endif
    endif
next extract

startfunction xor_MYKEY
    for x = 0 < 16
        getvarchr TMP1 MYKEY x
        getvarchr TMP2 MYXOR x
        math TMP1 ^= TMP2
        putvarchr MYKEY x TMP1
    next x
endfunction

# explanation:
# there is NOTHING that can be used to calculate a difference between the xbo
# files of vbs2_lite and vbs2_lite_us so the only way is using a lame or
# heuristic check over the data... that's the only "solution"
startfunction lame_vbs_diff_key_check
    set TMP2 long OriginalSize
    goto 0 MEMORY_FILE
            get filename string MEMORY_FILE
            get PackingMethod long MEMORY_FILE
            get OriginalSize long MEMORY_FILE
            get Reserved long MEMORY_FILE
            get TimeStamp long MEMORY_FILE
            get DataSize long MEMORY_FILE
    savepos TMP MEMORY_FILE
    set TMP_OK long 0
    if TMP <= TMP2              # ok
    if OriginalSize <= PBO_SIZE # ok
    if DataSize <= PBO_SIZE     # ok
        set TMP_OK long 1
    endif
    endif
    endif
    strlen TMP filename # lame check on the filename
    for x = 0 < TMP
        getvarchr TMP2 filename x
        if TMP2 < 0x20
            set TMP_OK long 0
        endif
    next x
    if TMP_OK == 0
        math extract -= 1
        set pbo_encryption long 0   # reset!
        math vbs_diff_key += 1
    endif
    print "vbs_diff_key %vbs_diff_key%"
    goto 0 MEMORY_FILE
endfunction

startfunction aes_workaround
    strlen MYKEYLEN MYKEY
    if MYKEYLEN < 16
        # explanation:
        # QuickBMS doesn't have problems to use keys with zeroes in them, but in this case this is
        # different because the key comes from a variable and so it can be only NULL delimited,
        # for the moment I have opted for this "lame" work-around and maybe I will find another
        # solution in future depending if there will be other particular situations like this one
        encryption aes "\xee\x00\x9b\x65\x43\xc7\x5e\x0e\x07\x25\x1d\x82\x35\xb4\x58\x96" MYIVEC
    else
        encryption aes MYKEY MYIVEC
    endif
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get NAME filename
string NAME += ".txt"
get SIZE asize
encryption "xor" "mymyapsk!"
log MEMORY_FILE 0 SIZE
encryption "incremental xor" 0x00 0x07
log NAME 0 SIZE MEMORY_FILE


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get DUMMY long
get DUMMY long
get BASE_OFF long
get NAMES long
get FILES long
get SIZE long
for i = 0 < NAMES
    get NAMESZ short
    getdstring NAME NAMESZ
    putarray 0 i NAME
next i
for i = 0 < FILES
    get ZERO short
    get CRC long
    get NUM long
    get SIZE long
    get OFFSET long
    get NAME_NUM short
    getarray NAME 0 NAME_NUM
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring PFPK
get FILES long
for i = 0 < FILES
    get NAMESZ byte
    getdstring NAME NAMESZ
    get OFFSET long
    get SIZE long

    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.5.1
idstring "ARCPACK\0"
get DUMMY long
get FILESIZE long
get FILES long
get INFO_SIZE long
getdstring DUMMY 0x28
get DUMMY long
get DUMMY long
get DUMMY long
savepos OFFSET

set MEMORY_FILE3 binary "\x55\x8b\xec\x83\xec\x08\x53\x56\x57\x33\xff\x89\x39\x89\x79\x04\x33\xc0\x8d\x51\x08\x89\x02\x83\xc0\x01\x83\xc2\x04\x3d\x00\x01\x00\x00\x7c\xf1\x8b\x55\x0c\x33\xc0\xc7\x45\xf8\x00\x01\x00\x00\x8d\x71\x0c\xc7\x45\xfc\x40\x00\x00\x00\x8d\x9b\x00\x00\x00\x00\x8b\x5e\xfc\x89\x5d\x0c\x8b\x5d\x08\x0f\xb6\x1c\x18\x03\x5d\x0c\x83\xc0\x01\x03\xdf\x81\xe3\xff\x00\x00\x00\x3b\xc2\x8b\xfb\x8b\x5c\xb9\x08\x89\x5e\xfc\x8b\x5d\x0c\x89\x5c\xb9\x08\x7c\x02\x33\xc0\x8b\x1e\x89\x5d\x0c\x8b\x5d\x08\x0f\xb6\x1c\x18\x03\x5d\x0c\x83\xc0\x01\x03\xdf\x81\xe3\xff\x00\x00\x00\x3b\xc2\x8b\xfb\x8b\x5c\xb9\x08\x89\x1e\x8b\x5d\x0c\x89\x5c\xb9\x08\x7c\x02\x33\xc0\x8b\x5e\x04\x89\x5d\x0c\x8b\x5d\x08\x0f\xb6\x1c\x18\x03\x5d\x0c\x83\xc0\x01\x03\xdf\x81\xe3\xff\x00\x00\x00\x3b\xc2\x8b\xfb\x8b\x5c\xb9\x08\x89\x5e\x04\x8b\x5d\x0c\x89\x5c\xb9\x08\x7c\x02\x33\xc0\x8b\x5e\x08\x89\x5d\x0c\x8b\x5d\x08\x0f\xb6\x1c\x18\x03\x5d\x0c\x83\xc0\x01\x03\xdf\x81\xe3\xff\x00\x00\x00\x3b\xc2\x8b\xfb\x8b\x5c\xb9\x08\x89\x5e\x08\x8b\x5d\x0c\x89\x5c\xb9\x08\x7c\x02\x33\xc0\x83\xc6\x10\x83\x6d\xfc\x01\x0f\x85\x31\xff\xff\xff\x83\x6d\xf8\x01\x0f\x85\x17\xff\xff\xff\x8b\x7d\x10\x85\xff\x76\x32\x8b\x01\x8b\x51\x04\x83\xc0\x01\x25\xff\x00\x00\x00\x89\x01\x8b\x74\x81\x08\x03\xd6\x81\xe2\xff\x00\x00\x00\x83\xef\x01\x89\x51\x04\x8b\x54\x91\x08\x89\x54\x81\x08\x8b\x41\x04\x89\x74\x81\x08\x75\xce\x5f\x5e\x5b\x8b\xe5\x5d\xc2\x0c\x00\xcc\xcc\xcc\xcc\xcc\x55\x8b\xec\x56\x33\xf6\x39\x75\x0c\x76\x4b\x53\x8b\x5d\x08\x57\x8b\x01\x8b\x51\x04\x83\xc0\x01\x25\xff\x00\x00\x00\x89\x01\x8b\x7c\x81\x08\x03\xd7\x81\xe2\xff\x00\x00\x00\x89\x51\x04\x8b\x54\x91\x08\x89\x54\x81\x08\x8b\x41\x04\x03\xd7\x81\xe2\xff\x00\x00\x00\x89\x7c\x81\x08\x8a\x54\x91\x08\x30\x14\x1e\x83\xc6\x01\x3b\x75\x0c\x72\xbc\x5f\x5b\x5e\x5d\xc2\x08\x00"
putvarchr MEMORY_FILE3 1032 0
calldll MEMORY_FILE3 0 thiscall "" MEMORY_FILE3 "786!N21.422525E39.826212@PiracyIsASin" 0x25 0xff

log MEMORY_FILE OFFSET INFO_SIZE
calldll MEMORY_FILE3 0x160 thiscall "" MEMORY_FILE3 MEMORY_FILE INFO_SIZE

for i = 0 < FILES
    get NAMESZ long MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE   long MEMORY_FILE
    get ZSIZE  long MEMORY_FILE
    log MEMORY_FILE2 OFFSET ZSIZE
    math TMP = ZSIZE
    math TMP &= 0xfff
    math TMP += 0xff
    calldll MEMORY_FILE3 0 thiscall "" MEMORY_FILE3 "786!N21.422525E39.826212@PiracyIsASin" 0x25 TMP
    calldll MEMORY_FILE3 0x160 thiscall "" MEMORY_FILE3 MEMORY_FILE2 ZSIZE
    clog NAME 0 ZSIZE SIZE MEMORY_FILE2
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "Pile"
goto -0x18
idstring "Pile"
get DUMMY short
get DUMMY short
get FILES long
get NAMES_OFF long
get NAMES_SIZE long
log MEMORY_FILE NAMES_OFF NAMES_SIZE
get OFFSET long
goto OFFSET
for i = 0 < FILES
    get ZSIZE long
    get SIZE long
    get OFFSET long
    get ZIP long
    get NAME_OFF long
    get CRC long
    goto NAME_OFF MEMORY_FILE
    get NAME string MEMORY_FILE
    if ZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring ILFF
get FILESIZE long
set OFFSET 20

for
    if OFFSET >= FILESIZE
        cleanexit
    endif

    goto OFFSET
    get CHUNK long
    get CHUNKSZ long
    get FOUR long
    get XCHUNKSZ long
    savepos OFFSET

    if CHUNK == 0x454d414e  # NAME
        getdstring NAME CHUNKSZ
        string NAME -= "LOCAL:"

    else    # leaving this "else" allows to dump everything (not good with messages)
    #endif
    #if CHUNK == 0x59444f42  # BODY (only phisical files and not CSTR and other things)

        log NAME OFFSET CHUNKSZ
    endif

    math OFFSET += CHUNKSZ
    do                      # boring padding
        if OFFSET & 3
            math OFFSET += 1
        endif
    while OFFSET & 3
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get NAME basename
get SIZE asize
log MEMORY_FILE 0 SIZE

set ADDNUM long 7
set MEMORY_FILE2 binary "This file is (C) Codemasters Software Company ltd. It took a lot of time and effort to produce. Leave it alone."

set j long 0
for i = 0 < SIZE
    getvarchr BYTE MEMORY_FILE i
    getvarchr BYTE2 MEMORY_FILE2 j
    math BYTE += BYTE2
    math j += 1
    if j >= 0x6f
        set j long 0
    endif
    math BYTE += ADDNUM
    math ADDNUM *= 0x5b
    math ADDNUM &= 0xff
    putvarchr MEMORY_FILE i BYTE
next i

string NAME += ".big"
log NAME 0 SIZE MEMORY_FILE


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype sfl_block
idstring "AR01"
goto -4
savepos MAX_OFF
get INFO_OFF long
for INFO_OFF = INFO_OFF < MAX_OFF
    goto INFO_OFF
    get NAME string
    get OFFSET long
    get SIZE long
    savepos INFO_OFF

    if SIZE == 0xffffffff
        # do nothing
    else
        do
            goto OFFSET
            get TYPE byte
            savepos OFFSET
            if TYPE != 0x44
                get LEN long
                math OFFSET += LEN
            endif
        while TYPE != 0x44

        putvarchr MEMORY_FILE SIZE 0    # pre-allocate
        log MEMORY_FILE 0 0
        append
        for mysize = 0 < SIZE
            goto OFFSET
            get ZSIZE short
            savepos OFFSET
            clog MEMORY_FILE OFFSET ZSIZE 0xffff
            math OFFSET += ZSIZE
            get mysize asize MEMORY_FILE
        next
        append

        log NAME 0 SIZE MEMORY_FILE
    endif
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "bbzf"
get DATE long
get FILES long
savepos OFFSET

math SIZE = FILES
math SIZE *= 0x35

set MEMORY_FILE2 binary "\x8b\xc2\x69\x80\x46\x42\x18\x25\x80\x5d\xaa\x02\x6d\x49\x11\x94\xa8\x01\xe7\x58\xcb\x8d\xa6\x30\x3e\x83\x1b\x09\x4c\xce\x18\xbb\x7c\xae\x6a\x30\x1e\x00\x0a\xc9\x24\xc0\x98\xfd\x33\xcc\x04\x44\xfa\xea\x8f\x33\xc3\x0d\xf2\xe8\x47\xd4\xdc\xa8\xc7\x54\xa2\xc7\x58\x17\x32\xc8\x7f\x64\x4a\xc6\xfd\xc1\xe7\x13\xec\xb7\xff\x1e\x0b\xd5\x72\x9a\x57\xf8\x3f\xdc\xdb\xc9\xf3\x85\xc8\x86\x68\x62\xc8\x06\xab\x90\x90\xf7\x3e\xe4\xb4\x6b\x80\x89\xc0\x93\x69\xeb\x84\xc9\x7a\xd4\xaf\xd4\xf4\xd5\xa0\x68\x49\xe8\x78\xed\xd0\x53\x74\x81\xbc\xd0\x7a\x40\x4f\xea\xf1\xc3\x4b\xaa\xd6\xe6\xaa\x73\x0c\xcf\x8e\x2b\xf4\x2c\x7b\x9b\x3e\xbb\xc4\x19\xff\x10\x43\x64\x03\x93\x4d\xcf\x64\xc8\xe5\xa2\x5b\xd3\x30\xbd\x57\x3b\x2a\x7e\x4c\xee\x96\xe5\x4e\x85\x3b\xf6\x5e\xca\x4d\x5f\x84\x77\x2a\x5b\x1e\x41\x47\xd6\x77\x15\x69\xd2\x9b\xa2\x18\x09\x6a\x17\x50\xd4\xec\x2e\x7b\x4b\xe4\x69\x9c\xae\xa8\x9b\xcd\x04\x2f\xab\xeb\x01\x6c\x95\x90\x2d\xda\xb1\x41\x43\x59\x38\xe9\xd7\x38\x04\x86\x3c\x93\x97\x23\xa5\xdf\x5f\x06\x8a\xc3\x39\x2a\x4e\x29\x33\xf0\x1e"

encryption xor MEMORY_FILE2
log MEMORY_FILE OFFSET SIZE
encryption "" ""

for i = 0 < FILES
    get TYPE byte MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get ZSIZE long MEMORY_FILE
    getdstring NAME 0x28 MEMORY_FILE

    # in the patch has been introduced an header of 43 bytes
    math SIZE += 100    # in case of other updates

    encryption xor MEMORY_FILE2
    if TYPE == 0
        log NAME OFFSET SIZE
    elif TYPE == 1
        clog NAME OFFSET ZSIZE SIZE
    else
        print "Error: unknown TYPE %TYPE%"
        cleanexit
    endif
    encryption "" ""
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype deflate
get archive_size asize
set offset long 0
for
    if offset >= archive_size
        cleanexit
    endif
    set CL long 0x89
    set DL long 0x01
    set fun_size long 4
    log MEMORY_FILE offset 6
    callfunction DECRYPT
    math offset += 6

    idstring MEMORY_FILE "PK\x03\x04"

    getvarchr CL MEMORY_FILE 4
    getvarchr DL MEMORY_FILE 5

    set fun_size long 24
    log MEMORY_FILE offset fun_size
    callfunction DECRYPT
    math offset += fun_size

    #get ver         short MEMORY_FILE
    get flag        short MEMORY_FILE
    get method      short MEMORY_FILE
    get timedate    long MEMORY_FILE
    get crc         long MEMORY_FILE
    get comp_size   long MEMORY_FILE
    get uncomp_size long MEMORY_FILE
    get name_len    short MEMORY_FILE
    get extra_len   short MEMORY_FILE

    set fun_size long name_len
    log MEMORY_FILE offset fun_size
    callfunction DECRYPT
    math offset += fun_size
    getdstring name     fun_size MEMORY_FILE

    set fun_size long extra_len
    log MEMORY_FILE offset fun_size
    callfunction DECRYPT
    math offset += fun_size
    getdstring extra    fun_size MEMORY_FILE

    if method == 0
        Log name offset uncomp_size
    elif method == 8
        CLog name offset comp_size uncomp_size
    else
        print "method %method% not supported"
        cleanexit
    endif

    math offset += comp_size
    goto offset
next

startfunction DECRYPT
    math TMP = CL
    for j = 0 < fun_size
        getvarchr CHR MEMORY_FILE j
        math CHR ^= TMP
        math TMP += DL
        putvarchr MEMORY_FILE j CHR
    next j
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get SIGN long
get VER long
get FILES long
get VPP_SIZE long

math OFFSET = FILES
math OFFSET *= 0x40
math OFFSET += 0x800
goto 0x800

for i = 0 < FILES
    getdstring NAME 0x3c
    get SIZE long

    if OFFSET % 0x800
        math OFFSET += 0x7ff
        math OFFSET &= 0xfffff800
    endif
    log NAME OFFSET SIZE
    math OFFSET += SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "\x78\x56\x34\x12"
get OFFSET long
get FILES long
savepos INFO_OFF

math TMP = FILES
math TMP -= 1
math TMP *= 17
math TMP += INFO_OFF
goto TMP
    get DUMMY long
    get ZSIZE long
    get SIZE long
    get ZIP byte
    get OFFSET long
if ZIP == 0
    log MEMORY_FILE OFFSET SIZE
else
    clog MEMORY_FILE OFFSET ZSIZE SIZE
endif

get FILES long MEMORY_FILE
goto INFO_OFF
for i = 0 < FILES
    get DUMMY long
    get ZSIZE long
    get SIZE long
    get ZIP byte
    get OFFSET long
    get NAMESZ short MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE

    if ZIP == 0
        log NAME OFFSET SIZE
    elif ZIP == 4
        comtype xmemdecompress
        savepos TMP
        goto OFFSET
        get SIZE long
        get ZSIZE long
        savepos OFFSET
        clog NAME OFFSET ZSIZE SIZE
        goto TMP
    else
        comtype zlib
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
open FDDE "bin" 0
get MYENDIAN short
if MYENDIAN == 0
    endian big
endif
goto 0

get VER long
if VER == 12
    set KEYX string "rFy5_pnOUOb6GWmsAD9z8^I2?Bv$dsD56AjY%MRWW((VBuTRzkfo9O+*Rr#J?WRS"
else
    print "unsupported game %VER%"
    cleanexit
endif
get BINSZ long
get FILES long
get DUMMY short
get PACKS short # + 1
get NAMES_OFF long
if NAMES_OFF != 0
    math NAMES_OFF += 0x10
endif

set KEY string ""
for KEYLEN = 0 < 0x100
    string KEY += KEYX
    strlen KEYLEN KEY
next

log MEMORY_FILE 0 0
encryption rc4 KEY "" 0 0x100
for i = 0 < FILES
    set NAME string ""
    if NAMES_OFF != 0
        savepos MYOFF
        math TMP = i
        math TMP *= 4
        math TMP += NAMES_OFF
        goto TMP
        get OFFSET long
        math OFFSET += TMP
        goto OFFSET
        math j = 0
        do
            get CHR byte
            putvarchr MEMORY_FILE j CHR
            log MEMORY_FILE2 j 1 MEMORY_FILE
            get CHR byte MEMORY_FILE2
            putvarchr MEMORY_FILE j CHR
            math j += 1
        while CHR != 0x00
        goto 0 MEMORY_FILE
        get NAME string MEMORY_FILE
        goto MYOFF
    endif
    putarray 0 i NAME
next i

encryption rc4 KEY "" 0 0x100
for i = 0 < FILES
    get SIZE long
    get DUMMY long
    get DUMMY long
    get EXT long

    get SIZE long
    if MYENDIAN == 0
        reverselong SIZE
    endif
    goto 0 MEMORY_FILE
    put SIZE long MEMORY_FILE
    log MEMORY_FILE 0 4 MEMORY_FILE
    goto 0 MEMORY_FILE
    get SIZE long MEMORY_FILE
    reverselong SIZE

    get DUMMY long
    get CRC long

    get OFFSET long
    if MYENDIAN == 0
        reverselong OFFSET
    endif
    goto 0 MEMORY_FILE
    put OFFSET long MEMORY_FILE
    log MEMORY_FILE 0 4 MEMORY_FILE
    goto 0 MEMORY_FILE
    get OFFSET long MEMORY_FILE
    reverselong OFFSET

    get DUMMY long

    putarray 1 i OFFSET
    putarray 2 i SIZE
    putarray 3 i EXT
next i

encryption "" ""
set OLD_EXT long -1
for i = 0 < FILES
    getarray NAME   0 i
    getarray OFFSET 1 i
    getarray SIZE   2 i
    getarray EXT    3 i
    if EXT != OLD_EXT
        string TMP p= "%03d" EXT
        open FDDE TMP 1
        set OLD_EXT long EXT
    endif
    log NAME OFFSET SIZE 1
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get Version long
get Product long
get Revision long
get Encryption long
get Compression long
get Reserved long
get OffsetToFiles long
get OffsetToFiles64 long
get OffsetToFolders long
get OffsetToFolders64 long
get OffsetToVolume long
get OffsetToVolume64 long

if Product != 0x30563347
    cleanexit
endif
set FULLPATH string ""

goto OffsetToFolders
callfunction EXTRACT

startfunction EXTRACT
    get Attributes long
    if Attributes == 0  # root
        math Attributes = 0x10
        set FileName string ""
    else
        get TMP long
        math TMP += 1
        getdstring FileName TMP
    endif

    if Attributes & 0x10
        getdstring FileTime 24
        get Attributes2 long
        get FileCount long

        string FULLPATH += FileName
        string FULLPATH += \
        for i = 0 < FileCount
            callfunction EXTRACT
        next i
    else
        get Offset long
        get Offset64 long
        getdstring FileTime 24
        get Attributes2 long
        get Encryption long
        get Compression long
        get ZSize long
        get Size long

        set FULLNAME string FULLPATH
        string FULLNAME += FileName

        if Attributes & 0x800
            set Compression long 2
        endif
        if Attributes & 0x4000
            print "this file seems to use encryption which is not supported at the moment, contact me"
            #cleanexit
        endif
        if Compression == 0
            log FULLNAME Offset Size
        else
            clog FULLNAME Offset ZSize Size
        endif
    endif
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzf # it's ever type 2

endian big
getdstring NAME 0x40
get DUMMY long  # maybe 64bit
get INFO_OFF long
get DUMMY long
get FILES long
goto INFO_OFF

for i = 0 < FILES
    getdstring NAME 0x40
    get TIMESTAMP longlong
    get ZERO long   # maybe 64bit
    get OFFSET long
    get CRC long
    get SIZE long
    get ZSIZE long
    get ZERO long

    if SIZE == ZSIZE
        log NAME OFFSET SIZE
    else
        savepos TMP
        goto OFFSET
        get TYPE byte
        if TYPE != 2
            print "unknown compression method (%TYPE%), contact me"
            cleanexit
        endif
        goto TMP

        math OFFSET += 1    # first byte is 0x02
        math ZSIZE  -= 1
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype rnc
get NAME basename
if NAME == "lumpy"
    # lumpy.dat/idx
    open FDDE "idx"
    open FDDE "dat" 1
    set PATH string ""
    set NAME string ""

    get FULLSIZE long
    callfunction EXTRACT
else
    # PCmusic.dat and PCsfx.dat
    get FILES long
    math FILES /= 4
        get OFFSET long
    for i = 1 <= FILES
        if i < FILES
            get NEXT_OFF long
        else
            get NEXT_OFF asize
        endif
        math SIZE = NEXT_OFF
        math SIZE -= OFFSET
        log "" OFFSET SIZE
        math OFFSET = NEXT_OFF
    next i
endif

startfunction EXTRACT
    get ENTRY long
    get FOLDERS long
    get FILES long
    get NAME string
    padding 4

    string PATH += NAME
    string PATH += /

    for i = 0 < FILES
        get ENTRY long
        get OFFSET long
        get SIZE long
        get ZSIZE long
        get NAME string
        padding 4

        set FNAME string PATH
        string FNAME += NAME
        if ZSIZE & 0x80000000
            math ZSIZE &= 0x7fffffff
            clog FNAME OFFSET ZSIZE SIZE 1
        else
            log FNAME OFFSET SIZE 1
        endif
    next i

    for i = 0 < FOLDERS
        callfunction EXTRACT
    next i
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
set FILES long 0
set PATH string ""
set NAME string ""
set FOLDER string ""
callfunction EXTRACT

startfunction EXTRACT
    get SUB_FOLDERS long
    for x = 0 < SUB_FOLDERS
        get FOLDERSZ long
        getdstring FOLDER FOLDERSZ
        set OLD_PATH string PATH
        string PATH += FOLDER
        string PATH += /
        get FILES long
        for i = 0 < FILES
            get NAMESZ long
            getdstring NAME NAMESZ
            get OFFSET long
            get SIZE long

            set FULLNAME string PATH
            string FULLNAME += NAME
            log FULLNAME OFFSET SIZE
        next i
        callfunction EXTRACT
        set PATH string OLD_PATH
    next x
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get BYTE1 byte
get BYTE2 byte
if BYTE1 == 0x1f
if BYTE2 == 0x8b
    get SIZE asize
    comtype gzip
    clog TEMPORARY_FILE 0 SIZE SIZE
    open "." TEMPORARY_FILE 0
    comtype zlib    # in case of future
endif
endif

goto 0
idstring "\xac\xdc\x00\x00"
get FILES long
for i = 0 < FILES
    get NAME string
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype bzip2
get FULL_FILE_SIZE asize
get VER long
get SUB_FILES long
set FULLPATH string ""
set NAME string ""
callfunction extract

startfunction extract
    string FULLPATH += NAME
    string FULLPATH += /
    math FILES = SUB_FILES
    for i = 0 < FILES
        get NAMESZ long
        getdstring NAME NAMESZ
        get TYPE byte
        get OFFSET long
        get SIZE long
        get DUMMY long
        get SUB_FILES long
        if TYPE == 0
            set FULLNAME string FULLPATH
            string FULLNAME += NAME
            callfunction bzip2_unpack
        elif TYPE == 1
            # folders
        else
            print "Error: unknown type %TYPE%, contact me"
            cleanexit
        endif
        if SUB_FILES > 0
            callfunction extract
        endif
    next i
endfunction

startfunction bzip2_unpack
    savepos TMP_OFF
    goto OFFSET
    getdstring BZIP2_HEADER 10
    if BZIP2_HEADER == "BZh91AY&SY"
        savepos NEXT_OFF
        findLoc NEXT_OFF string "BZh91AY&SY" 0 -1
        if NEXT_OFF < 0
            math NEXT_OFF = FULL_FILE_SIZE
        endif
        math ZSIZE = NEXT_OFF
        math ZSIZE -= OFFSET
        clog FULLNAME OFFSET ZSIZE SIZE
    else
        log FULLNAME OFFSET SIZE
    endif
    goto TMP_OFF
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get ZSIZE long
encryption cryptdecrypt "Error reading stream file data pcK" "CALG_MD5 CALG_RC4"
savepos OFFSET
math SIZE = ZSIZE
math SIZE *= 20
clog MEMORY_FILE OFFSET ZSIZE SIZE
math OFFSET += ZSIZE

for
    findloc name string "name=" MEMORY_FILE
    math name += 6
    goto name MEMORY_FILE
    getct name string 0x22 MEMORY_FILE

    findloc real_size string "real_size=" MEMORY_FILE
    math real_size += 11
    goto real_size MEMORY_FILE
    getct real_size string 0x22 MEMORY_FILE

    findloc size string "size=" MEMORY_FILE
    math size += 6
    goto size MEMORY_FILE
    getct size string 0x22 MEMORY_FILE

    findloc position string "position=" MEMORY_FILE
    math position += 10
    goto position MEMORY_FILE
    getct position string 0x22 MEMORY_FILE

    findloc path string "path=" MEMORY_FILE
    math path += 6
    goto path MEMORY_FILE
    getct path string 0x22 MEMORY_FILE

    set fullname string path
    string fullname += name
    math position += OFFSET
    clog fullname position size real_size
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "SCream resource file"
goto 0x100
get FILES long
for i = 0 < FILES
    getdstring NAME 0x54
    get OFFSET long
    get SIZE long
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "SF"
getdstring DUMMY 2
get FILES long
get DUMMY long
for i = 0 < FILES
    get NAMESZ short
    get DUMMY short
    get DUMMY long
    getdstring NAME 0x70
    putvarchr NAME NAMESZ 0
    get SIZE long
    get OFFSET long
    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
callfunction get_sfs_name 1
set IL2_MODE long 0
set CRYPT_MODE long 0

log MEMORY_FILE 0 0x100
idstring MEMORY_FILE "SFS\0"
get VERSION long MEMORY_FILE
if VERSION <= 0xc9
    get CRC long MEMORY_FILE
    get FILES long MEMORY_FILE
    get INFO_OFF long MEMORY_FILE
    get INFO2_OFF long MEMORY_FILE
    get DATA_OFF long MEMORY_FILE
    get DATA_SIZE long MEMORY_FILE
elif VERSION == 0xca    # only IL-2 1946 uses it at the moment
    set IL2_MODE long 1
    set CRYPT_MODE long 1
    math SFS_CHECKSUM_SIZE = SFS_NAME_LEN
    put SFS_NAME string MEMORY_FILE2
    callfunction sfs_checksum 1
    set DECRYPT_SIZE long 0x18
    set sfs_decrypt_div long 3
    log MEMORY_FILE2 8 DECRYPT_SIZE MEMORY_FILE
    callfunction sfs_decrypt 1
    goto 0 MEMORY_FILE2
    get CRC long MEMORY_FILE2
    get FILES long MEMORY_FILE2
    get INFO_OFF long MEMORY_FILE2
    get INFO2_OFF long MEMORY_FILE2
    get DATA_OFF long MEMORY_FILE2
    get DATA_SIZE long MEMORY_FILE2
else
    print "Error: this version of the file (%VERSION%) is not supported yet"
    cleanexit
endif
if INFO_OFF != 0x100
    print "Alert: the information offset is not 0x100 (%INFO_OFF%/%VERSION%), the extraction could fail"
endif

# lame check to know the right parameters of the encryption... ufff
set EVER2_IS_OK long 0
set CHECK long 0
do
    math CHECK += 1
    if CHECK == 1
        print "check Theatre of War encryption"
        set IL2_MODE long 0
        set CRYPT_MODE long 0
    elif CHECK == 2
        print "check Theatre of War demo encryption"
        set IL2_MODE long 0
        set CRYPT_MODE long 1
    elif CHECK == 3
        print "check IL-2 encryption"
        set IL2_MODE long 1
        set CRYPT_MODE long 1
    elif CHECK == 4
        print "check IL-2 dunno encryption"
        set IL2_MODE long 1
        set CRYPT_MODE long 0
    else
        print "Error: unsupported file type, contact me"
        cleanexit
    endif

    if IL2_MODE == 0        # Theatre of War
        set sfs_decrypt_div1 long 2
        set sfs_decrypt_div2 long 7
    else                    # IL-2
        set sfs_decrypt_div1 long 5
        set sfs_decrypt_div2 long 3
    endif

    if VERSION <= 0xc9
        set SFS_CHECKSUM_SIZE long 0x100
        log MEMORY_FILE2 0 0x100
        callfunction sfs_checksum 1
    endif

    log MEMORY_FILE2 INFO_OFF 32
    set DECRYPT_SIZE long 32
    if CRYPT_MODE == 0
        set sfs_decrypt_div long sfs_decrypt_div1
    else
        set sfs_decrypt_div long sfs_decrypt_div2
    endif
    callfunction sfs_decrypt 1

    get NAME_CRC long MEMORY_FILE2
    get FILE_CRC long MEMORY_FILE2
    get DUMMY long MEMORY_FILE2
    get OFFSET long MEMORY_FILE2
    get SIZE long MEMORY_FILE2
    get EVER2 long MEMORY_FILE2
    math EVER2 a= EVER2 # remove the possible negative sign
    if EVER2 <= 2
        set EVER2_IS_OK long 1
    endif
while EVER2_IS_OK == 0

# table with the informations about the files
math INFO_SIZE = FILES
math INFO_SIZE *= 32
log MEMORY_FILE2 INFO_OFF INFO_SIZE
set DECRYPT_SIZE long INFO_SIZE
if CRYPT_MODE == 0
    set sfs_decrypt_div long sfs_decrypt_div1
else
    set sfs_decrypt_div long sfs_decrypt_div2
endif
callfunction sfs_decrypt 1
log MEMORY_FILE 0 INFO_SIZE MEMORY_FILE2    # copy it on MEMORY_FILE

# table with the informations about the chunks
math INFO2_SIZE = DATA_OFF
math INFO2_SIZE -= INFO2_OFF
log MEMORY_FILE2 INFO2_OFF INFO2_SIZE
set DECRYPT_SIZE long INFO2_SIZE
if CRYPT_MODE == 0
    set sfs_decrypt_div long sfs_decrypt_div2
else
    set sfs_decrypt_div long sfs_decrypt_div1
endif
callfunction sfs_decrypt 1

#log xMEMORY_FILE  0 INFO_SIZE MEMORY_FILE      #debug
#log xMEMORY_FILE2 0 INFO2_SIZE MEMORY_FILE2    #debug
#cleanexit                                      #debug
set MEMTTMP_SIZE long 800000000 # use memory file below this size
print "please wait the unpacking of the filesystem on the disk/memory"

# unpack the chunks
math CHUNKS = INFO2_SIZE
math CHUNKS /= 4
math CHUNKS -= 1    # the last one is EOF
if DATA_SIZE < MEMTTMP_SIZE
    putvarchr MEMORY_FILE3 DATA_SIZE 0   # yes, you need enough memory
    log MEMORY_FILE3 0 0
else
    log TEMPORARY_FILE 0 0
endif
append
get OFFSET long MEMORY_FILE2
for i = 0 < CHUNKS
    get NEXT_OFFSET long MEMORY_FILE2
    math SIZE = NEXT_OFFSET
    math SIZE -= OFFSET
    if SIZE == 32768
            if DATA_SIZE < MEMTTMP_SIZE
                log MEMORY_FILE3 OFFSET SIZE
            else
                log TEMPORARY_FILE OFFSET SIZE
            endif
    else
        goto OFFSET
        get TYPE byte
        math SIZE -= 1
        math OFFSET += 1
        if TYPE == 1
            comtype lzss "12 4 2 2 0"   # lzss with 0x00 initializer (PUYO_LZ01 is ok too)
            if DATA_SIZE < MEMTTMP_SIZE
                clog MEMORY_FILE3 OFFSET SIZE 32768
            else
                clog TEMPORARY_FILE OFFSET SIZE 32768
            endif
        else
            comtype deflate
            get METHOD short
            math SIZE -= 2
            math OFFSET += 2
            if METHOD == 0
                if DATA_SIZE < MEMTTMP_SIZE
                    log MEMORY_FILE3 OFFSET SIZE
                else
                    log TEMPORARY_FILE OFFSET SIZE
                endif
            elif METHOD == 8
                if DATA_SIZE < MEMTTMP_SIZE
                    clog MEMORY_FILE3 OFFSET SIZE 32768
                else
                    clog TEMPORARY_FILE OFFSET SIZE 32768
                endif
            else
                print "Error: unknown method %METHOD% at offset %OFFSET%"
                cleanexit
            endif
        endif
    endif
    math OFFSET = NEXT_OFFSET
next i
append

if DATA_SIZE < MEMTTMP_SIZE
    # do nothing
else
    open "." TEMPORARY_FILE 1
endif

# extract the files
for i = 0 < FILES
    get NAME_CRC1 long MEMORY_FILE
    get NAME_CRC2 long MEMORY_FILE
    callfunction lame_namecrc 1
    get DUMMY1 long MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get EVER2 long MEMORY_FILE
    get ATTRIBUTES long MEMORY_FILE
    get DUMMY2 long MEMORY_FILE
    #if ATTRIBUTES & 6
    #   not supported at the moment
    #endif
    #else
        if DATA_SIZE < MEMTTMP_SIZE
            log NAME_CRC OFFSET SIZE MEMORY_FILE3
        else
            log NAME_CRC OFFSET SIZE 1
        endif
    #endif
next i

# various functions

startfunction lame_namecrc
    set NAME_CRC string ""
    #string NAME_CRC += NAME_CRC2
    #string NAME_CRC += NAME_CRC1
    #string NAME_CRC += ".dat"
endfunction

startfunction sfs_checksum
    if SFS_CHECKSUM_SIZE <= 0
        print "Error: SFS_CHECKSUM_SIZE in script"
        cleanexit
    endif
    set CRC_TABLE1 binary "\x00\x00\x00\x00\x5e\x8d\x78\x23\xbc\x1a\xf1\x46\xe2\x97\x89\x65\x78\x35\xe2\x0d\x26\xb8\x9a\x2e\xc4\x2f\x13\x4b\x9a\xa2\x6b\x68\xae\xe7\xbc\x38\xf0\x6a\xc4\x1b\x12\xfd\x4d\x7e\x4c\x70\x35\x5d\xd6\xd2\x5e\x35\x88\x5f\x26\x16\x6a\xc8\xaf\x73\x34\x45\xd7\x50\x5c\xcf\x79\x71\x02\x42\x01\x52\xe0\xd5\x88\x37\xbe\x58\xf0\x14\x24\xfa\x9b\x7c\x7a\x77\xe3\x5f\x98\xe0\x6a\x3a\xc6\x6d\x12\x19\xf2\x28\xc5\x49\xac\xa5\xbd\x6a\x4e\x32\x34\x0f\x10\xbf\x4c\x2c\x8a\x1d\x27\x44\xd4\x90\x5f\x67\x36\x07\xd6\x02\x68\x8a\xae\x21\xb8\x9e\xf3\x62\xe6\x13\x8b\x41\x04\x84\x02\x24\x5a\x09\x7a\x07\xc0\xab\x11\x6f\x9e\x26\x69\x4c\x7c\xb1\xe0\x29\x22\x3c\x98\x0a\x16\x79\x4f\x5a\x48\xf4\x37\x79\xaa\x63\xbe\x1c\xf4\xee\xc6\x3f\x6e\x4c\xad\x57\x30\xc1\xd5\x74\xd2\x56\x5c\x11\x8c\xdb\x24\x32\xe4\x51\x8a\x13\xba\xdc\xf2\x30\x58\x4b\x7b\x55\x06\xc6\x03\x76\x9c\x64\x68\x1e\xc2\xe9\x10\x3d\x20\x7e\x99\x58\x7e\xf3\xe1\x7b\x4a\xb6\x36\x2b\x14\x3b\x4e\x08\xf6\xac\xc7\x6d\xa8\x21\xbf\x4e\x32\x83\xd4\x26\x6c\x0e\xac\x05\x8e\x99\x25\x60\xd0\x14\x5d\x43\x2e\xb0\x9f\x66\x70\x3d\xe7\x45\x92\xaa\x6e\x20\xcc\x27\x16\x03\x56\x85\x7d\x6b\x08\x08\x05\x48\xea\x9f\x8c\x2d\xb4\x12\xf4\x0e\x80\x57\x23\x5e\xde\xda\x5b\x7d\x3c\x4d\xd2\x18\x62\xc0\xaa\x3b\xf8\x62\xc1\x53\xa6\xef\xb9\x70\x44\x78\x30\x15\x1a\xf5\x48\x36\x72\x7f\xe6\x17\x2c\xf2\x9e\x34\xce\x65\x17\x51\x90\xe8\x6f\x72\x0a\x4a\x04\x1a\x54\xc7\x7c\x39\xb6\x50\xf5\x5c\xe8\xdd\x8d\x7f\xdc\x98\x5a\x2f\x82\x15\x22\x0c\x60\x82\xab\x69\x3e\x0f\xd3\x4a\xa4\xad\xb8\x22\xfa\x20\xc0\x01\x18\xb7\x49\x64\x46\x3a\x31\x47\x96\x2e\x6c\x04\xc8\xa3\x14\x27\x2a\x34\x9d\x42\x74\xb9\xe5\x61\xee\x1b\x8e\x09\xb0\x96\xf6\x2a\x52\x01\x7f\x4f\x0c\x8c\x07\x6c\x38\xc9\xd0\x3c\x66\x44\xa8\x1f\x84\xd3\x21\x7a\xda\x5e\x59\x59\x40\xfc\x32\x31\x1e\x71\x4a\x12\xfc\xe6\xc3\x77\xa2\x6b\xbb\x54\xca\xe1\x15\x75\x94\x6c\x6d\x56\x76\xfb\xe4\x33\x28\x76\x9c\x10\xb2\xd4\xf7\x78\xec\x59\x8f\x5b\x0e\xce\x06\x3e\x50\x43\x7e\x1d\x64\x06\xa9\x4d\x3a\x8b\xd1\x6e\xd8\x1c\x58\x0b\x86\x91\x20\x28\x1c\x33\x4b\x40\x42\xbe\x33\x63\xa0\x29\xba\x06\xfe\xa4\xc2\x25\x02\xed\x47\x6e\x5c\x60\x3f\x4d\xbe\xf7\xb6\x28\xe0\x7a\xce\x0b\x7a\xd8\xa5\x63\x24\x55\xdd\x40\xc6\xc2\x54\x25\x98\x4f\x2c\x06\xac\x0a\xfb\x56\xf2\x87\x83\x75\x10\x10\x0a\x10\x4e\x9d\x72\x33\xd4\x3f\x19\x5b\x8a\xb2\x61\x78\x68\x25\xe8\x1d\x36\xa8\x90\x3e\x5e\x22\x3e\x1f\x00\xaf\x46\x3c\xe2\x38\xcf\x59\xbc\xb5\xb7\x7a\x26\x17\xdc\x12\x78\x9a\xa4\x31\x9a\x0d\x2d\x54\xc4\x80\x55\x77\xf0\xc5\x82\x27\xae\x48\xfa\x04\x4c\xdf\x73\x61\x12\x52\x0b\x42\x88\xf0\x60\x2a\xd6\x7d\x18\x09\x34\xea\x91\x6c\x6a\x67\xe9\x4f\xba\x73\xb4\x0c\xe4\xfe\xcc\x2f\x06\x69\x45\x4a\x58\xe4\x3d\x69\xc2\x46\x56\x01\x9c\xcb\x2e\x22\x7e\x5c\xa7\x47\x20\xd1\xdf\x64\x14\x94\x08\x34\x4a\x19\x70\x17\xa8\x8e\xf9\x72\xf6\x03\x81\x51\x6c\xa1\xea\x39\x32\x2c\x92\x1a\xd0\xbb\x1b\x7f\x8e\x36\x63\x5c\xe6\xbc\xcd\x7d\xb8\x31\xb5\x5e\x5a\xa6\x3c\x3b\x04\x2b\x44\x18\x9e\x89\x2f\x70\xc0\x04\x57\x53\x22\x93\xde\x36\x7c\x1e\xa6\x15\x48\x5b\x71\x45\x16\xd6\x09\x66\xf4\x41\x80\x03\xaa\xcc\xf8\x20\x30\x6e\x93\x48\x6e\xe3\xeb\x6b\x8c\x74\x62\x0e\xd2\xf9\x1a\x2d\x2c\x5d\xd8\x08\x72\xd0\xa0\x2b\x90\x47\x29\x4e\xce\xca\x51\x6d\x54\x68\x3a\x05\x0a\xe5\x42\x26\xe8\x72\xcb\x43\xb6\xff\xb3\x60\x82\xba\x64\x30\xdc\x37\x1c\x13\x3e\xa0\x95\x76\x60\x2d\xed\x55\xfa\x8f\x86\x3d\xa4\x02\xfe\x1e\x46\x95\x77\x7b\x18\x18\x0f\x58\x70\x92\xa1\x79\x2e\x1f\xd9\x5a\xcc\x88\x50\x3f\x92\x05\x28\x1c\x08\xa7\x43\x74\x56\x2a\x3b\x57\xb4\xbd\xb2\x32\xea\x30\xca\x11\xde\x75\x1d\x41\x80\xf8\x65\x62\x62\x6f\xec\x07\x3c\xe2\x94\x24\xa6\x40\xff\x4c\xf8\xcd\x87\x6f\x1a\x5a\x0e\x0a\x44\xd7\x76\x29\x94\xc3\x2b\x6a\xca\x4e\x53\x49\x28\xd9\xda\x2c\x76\x54\xa2\x0f\xec\xf6\xc9\x67\xb2\x7b\xb1\x44\x50\xec\x38\x21\x0e\x61\x40\x02\x3a\x24\x97\x52\x64\xa9\xef\x71\x86\x3e\x66\x14\xd8\xb3\x1e\x37\x42\x11\x75\x5f\x1c\x9c\x0d\x7c\xfe\x0b\x84\x19\xa0\x86\xfc\x3a\xc8\x0c\x52\x1b\x96\x81\x2a\x38\x74\x16\xa3\x5d\x2a\x9b\xdb\x7e\xb0\x39\xb0\x16\xee\xb4\xc8\x35\x0c\x23\x41\x50\x52\xae\x39\x73\x66\xeb\xee\x23\x38\x66\x96\x00\xda\xf1\x1f\x65\x84\x7c\x67\x46\x1e\xde\x0c\x2e\x40\x53\x74\x0d\xa2\xc4\xfd\x68\xfc\x49\x85\x4b"
    set CRC_TABLE2 binary "\x00\x00\x00\x00\x2e\x18\x34\x14\x72\x28\x5c\x3c\x5c\x30\x68\x28\xca\x48\x8c\x6c\xe4\x50\xb8\x78\xb8\x60\xd0\x50\x96\x78\xe4\x44\xba\x89\x2c\x4d\x94\x91\x18\x59\xc8\xa1\x70\x71\xe6\xb9\x44\x65\x70\xc1\xa0\x21\x5e\xd9\x94\x35\x02\xe9\xfc\x1d\x2c\xf1\xc8\x09\x74\x13\x59\x1a\x5a\x0b\x6d\x0e\x06\x3b\x05\x26\x28\x23\x31\x32\xbe\x5b\xd5\x76\x90\x43\xe1\x62\xcc\x73\x89\x4a\xe2\x6b\xbd\x5e\xce\x9a\x75\x57\xe0\x82\x41\x43\xbc\xb2\x29\x6b\x92\xaa\x1d\x7f\x04\xd2\xf9\x3b\x2a\xca\xcd\x2f\x76\xfa\xa5\x07\x58\xe2\x91\x13\xc6\x3e\x86\x20\xe8\x26\xb2\x34\xb4\x16\xda\x1c\x9a\x0e\xee\x08\x0c\x76\x0a\x4c\x22\x6e\x3e\x58\x7e\x5e\x56\x70\x50\x46\x62\x64\x7c\xb7\xaa\x6d\x52\xaf\x9e\x79\x0e\x9f\xf6\x51\x20\x87\xc2\x45\xb6\xff\x26\x01\x98\xe7\x12\x15\xc4\xd7\x7a\x3d\xea\xcf\x4e\x29\xb2\x2d\xdf\x3a\x9c\x35\xeb\x2e\xc0\x05\x83\x06\xee\x1d\xb7\x12\x78\x65\x53\x56\x56\x7d\x67\x42\x0a\x4d\x0f\x6a\x24\x55\x3b\x7e\x08\xa4\xf3\x77\x26\xbc\xc7\x63\x7a\x8c\xaf\x4b\x54\x94\x9b\x5f\xc2\xec\x7f\x1b\xec\xf4\x4b\x0f\xb0\xc4\x23\x27\x9e\xdc\x17\x33\xa2\x65\x38\x55\x8c\x7d\x0c\x41\xd0\x4d\x64\x69\xfe\x55\x50\x7d\x68\x2d\xb4\x39\x46\x35\x80\x2d\x1a\x05\xe8\x05\x34\x1d\xdc\x11\x18\xec\x14\x18\x36\xf4\x20\x0c\x6a\xc4\x48\x24\x44\xdc\x7c\x30\xd2\xa4\x98\x74\xfc\xbc\xac\x60\xa0\x8c\xc4\x48\x8e\x94\xf0\x5c\xd6\x76\x61\x4f\xf8\x6e\x55\x5b\xa4\x5e\x3d\x73\x8a\x46\x09\x67\x1c\x3e\xed\x23\x32\x26\xd9\x37\x6e\x16\xb1\x1f\x40\x0e\x85\x0b\x6c\xff\x4d\x02\x42\xe7\x79\x16\x1e\xd7\x11\x3e\x30\xcf\x25\x2a\xa6\xb7\xc1\x6e\x88\xaf\xf5\x7a\xd4\x9f\x9d\x52\xfa\x87\xa9\x46\x64\x5b\xbe\x75\x4a\x43\x8a\x61\x16\x73\xe2\x49\x38\x6b\xd6\x5d\xae\x13\x32\x19\x80\x0b\x06\x0d\xdc\x3b\x6e\x25\xf2\x23\x5a\x31\xde\xd2\x92\x38\xf0\xca\xa6\x2c\xac\xfa\xce\x04\x82\xe2\xfa\x10\x14\x9a\x1e\x54\x3a\x82\x2a\x40\x66\xb2\x42\x68\x48\xaa\x76\x7c\x10\x48\xe7\x6f\x3e\x50\xd3\x7b\x62\x60\xbb\x53\x4c\x78\x8f\x47\xda\x00\x6b\x03\xf4\x18\x5f\x17\xa8\x28\x37\x3f\x86\x30\x03\x2b\xaa\xc1\xcb\x22\x84\xd9\xff\x36\xd8\xe9\x97\x1e\xf6\xf1\xa3\x0a\x60\x89\x47\x4e\x4e\x91\x73\x5a\x12\xa1\x1b\x72\x3c\xb9\x2f\x66\x6a\xd3\x44\x3e\x44\xcb\x70\x2a\x18\xfb\x18\x02\x36\xe3\x2c\x16\xa0\x9b\xc8\x52\x8e\x83\xfc\x46\xd2\xb3\x94\x6e\xfc\xab\xa0\x7a\xd0\x5a\x68\x73\xfe\x42\x5c\x67\xa2\x72\x34\x4f\x8c\x6a\x00\x5b\x1a\x12\xe4\x1f\x34\x0a\xd0\x0b\x68\x3a\xb8\x23\x46\x22\x8c\x37\x1e\xc0\x1d\x24\x30\xd8\x29\x30\x6c\xe8\x41\x18\x42\xf0\x75\x0c\xd4\x88\x91\x48\xfa\x90\xa5\x5c\xa6\xa0\xcd\x74\x88\xb8\xf9\x60\xa4\x49\x31\x69\x8a\x51\x05\x7d\xd6\x61\x6d\x55\xf8\x79\x59\x41\x6e\x01\xbd\x05\x40\x19\x89\x11\x1c\x29\xe1\x39\x32\x31\xd5\x2d\xac\xed\xc2\x1e\x82\xf5\xf6\x0a\xde\xc5\x9e\x22\xf0\xdd\xaa\x36\x66\xa5\x4e\x72\x48\xbd\x7a\x66\x14\x8d\x12\x4e\x3a\x95\x26\x5a\x16\x64\xee\x53\x38\x7c\xda\x47\x64\x4c\xb2\x6f\x4a\x54\x86\x7b\xdc\x2c\x62\x3f\xf2\x34\x56\x2b\xae\x04\x3e\x03\x80\x1c\x0a\x17\xd8\xfe\x9b\x04\xf6\xe6\xaf\x10\xaa\xd6\xc7\x38\x84\xce\xf3\x2c\x12\xb6\x17\x68\x3c\xae\x23\x7c\x60\x9e\x4b\x54\x4e\x86\x7f\x40\x62\x77\xb7\x49\x4c\x6f\x83\x5d\x10\x5f\xeb\x75\x3e\x47\xdf\x61\xa8\x3f\x3b\x25\x86\x27\x0f\x31\xda\x17\x67\x19\xf4\x0f\x53\x0d\xc8\xb6\x7c\x6b\xe6\xae\x48\x7f\xba\x9e\x20\x57\x94\x86\x14\x43\x02\xfe\xf0\x07\x2c\xe6\xc4\x13\x70\xd6\xac\x3b\x5e\xce\x98\x2f\x72\x3f\x50\x26\x5c\x27\x64\x32\x00\x17\x0c\x1a\x2e\x0f\x38\x0e\xb8\x77\xdc\x4a\x96\x6f\xe8\x5e\xca\x5f\x80\x76\xe4\x47\xb4\x62\xbc\xa5\x25\x71\x92\xbd\x11\x65\xce\x8d\x79\x4d\xe0\x95\x4d\x59\x76\xed\xa9\x1d\x58\xf5\x9d\x09\x04\xc5\xf5\x21\x2a\xdd\xc1\x35\x06\x2c\x09\x3c\x28\x34\x3d\x28\x74\x04\x55\x00\x5a\x1c\x61\x14\xcc\x64\x85\x50\xe2\x7c\xb1\x44\xbe\x4c\xd9\x6c\x90\x54\xed\x78\x0e\x88\xfa\x4b\x20\x90\xce\x5f\x7c\xa0\xa6\x77\x52\xb8\x92\x63\xc4\xc0\x76\x27\xea\xd8\x42\x33\xb6\xe8\x2a\x1b\x98\xf0\x1e\x0f\xb4\x01\xd6\x06\x9a\x19\xe2\x12\xc6\x29\x8a\x3a\xe8\x31\xbe\x2e\x7e\x49\x5a\x6a\x50\x51\x6e\x7e\x0c\x61\x06\x56\x22\x79\x32\x42\x7a\x9b\xa3\x51\x54\x83\x97\x45\x08\xb3\xff\x6d\x26\xab\xcb\x79\xb0\xd3\x2f\x3d\x9e\xcb\x1b\x29\xc2\xfb\x73\x01\xec\xe3\x47\x15\xc0\x12\x8f\x1c\xee\x0a\xbb\x08\xb2\x3a\xd3\x20\x9c\x22\xe7\x34\x0a\x5a\x03\x70\x24\x42\x37\x64\x78\x72\x5f\x4c\x56\x6a\x6b\x58"
    set SFS_KEY binary "\0\0\0\0\0\0\0\0"
    #log MEMORY_FILE2 0 0x100
    if CRYPT_MODE == 0
        set SFS_AND long 0xfffff000
    else
        set SFS_AND long 0x0f00fff0
    endif

    set eax long 0
    set ecx long 0
    for x = 0 < SFS_CHECKSUM_SIZE
        getvarchr edx MEMORY_FILE2 x
        math ebp = ecx
        math ecx u<<= 8
        math ebp u>>= 24
        math ecx |= edx
        math ebp *= 4
        getvarchr TMP CRC_TABLE1 ebp long
        math ecx ^= TMP
        math ebp = eax
        math eax u<<= 8
        math ebp u>>= 24
        math eax |= edx
        math ebp *= 4
        getvarchr TMP CRC_TABLE2 ebp long
        math eax ^= TMP 
    next x
    if IL2_MODE == 0
        math edx = eax
        math edx ^= ecx
        math edx &= SFS_AND
        math edx ^= eax
        math eax ^= ecx
        math eax &= SFS_AND
        math eax ^= ecx
        math ecx = edx
    endif
    putvarchr SFS_KEY 0 ecx long
    putvarchr SFS_KEY 4 eax long
    set SFS_CHECKSUM_SIZE long 0
endfunction

startfunction sfs_decrypt
    if DECRYPT_SIZE <= 0
        print "Error: DECRYPT_SIZE in script"
        cleanexit
    endif
    if VERSION >= 0xc9
        for x = 0 < DECRYPT_SIZE
            getvarchr CHR MEMORY_FILE2 x
            math TMP = x
            math TMP /= sfs_decrypt_div
            math TMP += x
            math TMP &= 7
            getvarchr TMP SFS_KEY TMP
            math CHR ^= TMP
            putvarchr MEMORY_FILE2 x CHR
        next x
    endif
    set DECRYPT_SIZE long 0
endfunction

startfunction get_sfs_name
    get SFS_NAME filename
    math SFS_NAME_LEN = 0
    do
        getvarchr CHR SFS_NAME SFS_NAME_LEN
        if CHR >= 'A'
        if CHR <= 'Z'
            math CHR += 32  # tolower
            putvarchr SFS_NAME SFS_NAME_LEN CHR
        endif
        endif
        math SFS_NAME_LEN += 1
    while CHR != 0
    math SFS_NAME_LEN -= 1
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "EASTFANTASY"
goto 0x34
get FILES long
get DUMMY long
savepos TMP
math BASE_OFF = FILES
math BASE_OFF *= 0x48
math BASE_OFF += TMP
for i = 0 < FILES
    getdstring NAME 0x3c
    get SIZE long
    get ZSIZE long
    get OFFSET long
    math OFFSET += BASE_OFF
    clog NAME OFFSET ZSIZE SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get SIZE asize
encryption charset "\xda\xca\xfa\xea\x9a\x8a\xba\xaa\x5a\x4a\x7a\x6a\x1a\x0a\x3a\x2a\xdb\xcb\xfb\xeb\x9b\x8b\xbb\xab\x5b\x4b\x7b\x6b\x1b\x0b\x3b\x2b\xd8\xc8\xf8\xe8\x98\x88\xb8\xa8\x58\x48\x78\x68\x18\x08\x38\x28\xd9\xc9\xf9\xe9\x99\x89\xb9\xa9\x59\x49\x79\x69\x19\x09\x39\x29\xde\xce\xfe\xee\x9e\x8e\xbe\xae\x5e\x4e\x7e\x6e\x1e\x0e\x3e\x2e\xdf\xcf\xff\xef\x9f\x8f\xbf\xaf\x5f\x4f\x7f\x6f\x1f\x0f\x3f\x2f\xdc\xcc\xfc\xec\x9c\x8c\xbc\xac\x5c\x4c\x7c\x6c\x1c\x0c\x3c\x2c\xdd\xcd\xfd\xed\x9d\x8d\xbd\xad\x5d\x4d\x7d\x6d\x1d\x0d\x3d\x2d\xd2\xc2\xf2\xe2\x92\x82\xb2\xa2\x52\x42\x72\x62\x12\x02\x32\x22\xd3\xc3\xf3\xe3\x93\x83\xb3\xa3\x53\x43\x73\x63\x13\x03\x33\x23\xd0\xc0\xf0\xe0\x90\x80\xb0\xa0\x50\x40\x70\x60\x10\x00\x30\x20\xd1\xc1\xf1\xe1\x91\x81\xb1\xa1\x51\x41\x71\x61\x11\x01\x31\x21\xd6\xc6\xf6\xe6\x96\x86\xb6\xa6\x56\x46\x76\x66\x16\x06\x36\x26\xd7\xc7\xf7\xe7\x97\x87\xb7\xa7\x57\x47\x77\x67\x17\x07\x37\x27\xd4\xc4\xf4\xe4\x94\x84\xb4\xa4\x54\x44\x74\x64\x14\x04\x34\x24\xd5\xc5\xf5\xe5\x95\x85\xb5\xa5\x55\x45\x75\x65\x15\x05\x35\x25"
log MEMORY_FILE 0 SIZE
encryption "" ""

idstring MEMORY_FILE "CRAE*"
get FILES long MEMORY_FILE
reverselong FILES
savepos TMP MEMORY_FILE
get TMP2 byte MEMORY_FILE
if TMP2 > 1
    goto TMP MEMORY_FILE
endif
savepos START_OFF MEMORY_FILE
for EXTRACT = 0 < 2
    for i = 0 < FILES
        get NAMESZ byte MEMORY_FILE
        getdstring NAME NAMESZ MEMORY_FILE
        get SIZE long MEMORY_FILE
        if EXTRACT == 1
            log NAME OFFSET SIZE MEMORY_FILE
            math OFFSET += SIZE
        endif
    next i
    if EXTRACT == 0
        savepos OFFSET MEMORY_FILE
        goto START_OFF MEMORY_FILE
    endif
next EXTRACT


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get MYFILEEXT extension
if MYFILEEXT == "xml"
    open FDDE PAK 0
endif

open FDDE XML 1

for
    findloc NAME_OFF string "src=\'" 1
    if NAME_OFF == 0
        cleanexit 
    endif

    math NAME_OFF += 5
    goto NAME_OFF 1
    getct NAME string 0x27 1

    findloc SIZE_OFF string "size=\'" 1
    math SIZE_OFF += 6
    goto SIZE_OFF 1
    getct SIZE string 0x27 1

    findloc OFFSET_OFF string "offset=\'" 1
    math OFFSET_OFF += 8
    goto OFFSET_OFF 1
    getct OFFSET string 0x27 1

    log NAME OFFSET SIZE
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
goto -4
get OFFSET long
goto OFFSET
get ZIP byte
if ZIP == 0
    get SIZE long
    savepos OFFSET
    log MEMORY_FILE OFFSET SIZE
else
    get ZSIZE long
    get SIZE long
    savepos OFFSET
    clog MEMORY_FILE OFFSET ZSIZE SIZE
endif
math IDXSIZE = SIZE

goto 0 MEMORY_FILE
    get FILES long MEMORY_FILE
        get DUMMY1 short MEMORY_FILE
        get DUMMY2 short MEMORY_FILE
        get NAMESZ short MEMORY_FILE
        getdstring NAME NAMESZ MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get XSIZE long MEMORY_FILE  # ???

    get TMP long MEMORY_FILE
    if TMP u<= 10   # timestamp
        set VER long 1
    else
        set VER long 0
    endif
goto 0 MEMORY_FILE

do
    get FILES long MEMORY_FILE
    for i = 0 < FILES
        get DUMMY1 short MEMORY_FILE
        get DUMMY2 short MEMORY_FILE
        get NAMESZ short MEMORY_FILE
        getdstring NAME NAMESZ MEMORY_FILE
        get OFFSET long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get XSIZE long MEMORY_FILE  # ???
        if VER > 0  # blah I thought was a NOZIP but it's wrong
            get NOZIP long MEMORY_FILE
        else
            math NOZIP = -1
        endif
        get TSTAMP longlong MEMORY_FILE

        putarray 0 i NAME
        putarray 1 i OFFSET
        putarray 2 i SIZE
        putarray 3 i XSIZE
        putarray 4 i NOZIP
    next i

    set EXT string ""
    set PATH string ""
    for i = 0 < 4
        get NAMESZ short MEMORY_FILE
        getdstring NAME NAMESZ MEMORY_FILE
        if i == 1
            set EXT string NAME
        elif i == 2
            set PATH string NAME
        endif
    next i

    for i = 0 < FILES
        getarray NAME   0 i
        getarray OFFSET 1 i
        getarray SIZE   2 i
        getarray XSIZE  3 i
        getarray NOZIP  4 i

        set FNAME string PATH
        string FNAME += /
        string FNAME += NAME
        string FNAME += EXT

        if VER > 0
            goto OFFSET
            get ZIP byte
            if ZIP == 0
                get SIZE long
                savepos OFFSET
                log FNAME OFFSET SIZE
            elif ZIP == 1
                get ZSIZE long
                get SIZE long
                savepos OFFSET
                clog FNAME OFFSET ZSIZE SIZE
            else
                log FNAME OFFSET SIZE
            endif
        else
            if XSIZE == 0
                log FNAME OFFSET SIZE
            else
                clog FNAME OFFSET SIZE XSIZE
            endif
        endif
    next i

    savepos OFFSET MEMORY_FILE
while OFFSET < IDXSIZE


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get DUMMY long
idstring "ShotOnline Resource file"
goto 0x80
get DUMMY long
get DUMMY long
getdstring PATH 0x100
strlen i PATH
for i = i >= 0
    math i -= 1
    getvarchr TMP PATH i
    if TMP == 0x5c
        break
    endif
    putvarchr PATH i 0x00
next
get ZERO long
get FULLSIZE long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
savepos INFO_OFF
for INFO_OFF = INFO_OFF < FULLSIZE
    goto INFO_OFF

    get CRC long
    get DUMMY long
    savepos NAME_OFFSET
    math INFO_OFF += 0x124
    goto INFO_OFF

    get NAME_ZSIZE long
    get ZSIZE long
    get CRC long
    get OFFSET long
    get NEXT_OFFSET long
    get ZERO long
    get ZERO long
    get DUMMY long
    get TSTAMP longlong
    get TSTAMP longlong
    get TSTAMP longlong
    get CRC long
    get ZERO long
    get SIZE long
    get DUMMY long
    get DUMMY long
    get DUMMY long
    get TSTAMP longlong
    get TSTAMP longlong
    get TSTAMP longlong
    get ZERO long
    get ZERO long
    savepos INFO_OFF

    clog MEMORY_FILE NAME_OFFSET NAME_ZSIZE 0x100
    get NAME string MEMORY_FILE
    set FNAME string PATH
    string FNAME += NAME
    clog FNAME OFFSET ZSIZE SIZE

    math INFO_OFF = NEXT_OFFSET
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype dk2
endian big
get SIGN long
get FILES long
get DUMMY long
get NAMES_OFF long
get NAMES_SIZE long
get NAMESZ byte
get FOLDERSZ byte

math FOLDERS_OFF = FILES
math FOLDERS_OFF *= NAMESZ
math FOLDERS_OFF += NAMES_OFF
math FOLDERS_OFF x= 0x10
math NAMESZ -= 2

# guess the multiplier
# in my opinion it's:
# DUMMY = 0x100600 = 0x10
# DUMMY = 0x100400 = 0x40
set SMALL_OFF long 0xffffffff
goto 0x30
for i = 0 < FILES
    get OFFSET long
    get ZSIZE long
    get SIZE long
    get CRC long
    if OFFSET u< SMALL_OFF
        math SMALL_OFF = OFFSET
    endif
next i
math TMP = NAMES_OFF
math TMP += NAMES_SIZE
math TMP x= 0x100
math MUL = TMP
math MUL /= SMALL_OFF

goto 0x30
for i = 0 < FILES
    get OFFSET long
    get ZSIZE long
    get SIZE long
    get CRC long

    savepos TMP
    goto NAMES_OFF
    get FOLDER short
    getdstring NAME NAMESZ
    savepos NAMES_OFF
    math FOLDER *= FOLDERSZ
    math FOLDER += FOLDERS_OFF
    goto FOLDER
    getdstring FOLDER FOLDERSZ
    goto TMP

    set FULLNAME string FOLDER
    string FULLNAME += /
    string FULLNAME += NAME
    math OFFSET *= MUL
    if ZSIZE == 0
        log FULLNAME OFFSET SIZE
    else
        clog FULLNAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype LZO1X

get DUMMY long
get DUMMY long
get FILES_OFFSET long
get NAMESZ short
getdstring NAME NAMESZ  # version of the file
get FOLDERS short

savepos OFFSET
for i = 0 < FOLDERS
    get NAMESZ short
    getdstring NAME NAMESZ
next i
savepos SIZE
math SIZE -= OFFSET
log MEMORY_FILE OFFSET SIZE

get FILES long

for i = 0 < FILES
    get CRC32 long
    get TYPE byte
    get SIZE long
    get ZSIZE long
    get FOLDER_NUM long
    get OFFSET long
    get NAMESZ short
    getdstring NAME NAMESZ

    set FULLNAME ""
    goto 0 MEMORY_FILE
    for j = 0 <= FOLDER_NUM
        get FOLDERSZ short MEMORY_FILE
        getdstring FULLNAME FOLDERSZ MEMORY_FILE
    next j
    string FULLNAME += NAME

    clog FULLNAME OFFSET ZSIZE SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "#AMB"
get DUMMY byte
if DUMMY == 0
    endian big
endif
goto 0x10
get FILES long
get INFO_OFF long
get FILES_OFF long
get NAMES_OFF long
for i = 0 < FILES
    goto INFO_OFF
    get OFFSET long
    get SIZE long
    get VALID long
    get DUMMY long
    savepos INFO_OFF
    if NAMES_OFF == 0
        set NAME string ""
    else
        goto NAMES_OFF
        getdstring NAME 0x20
        savepos NAMES_OFF
    endif
    if SIZE != 0
        log NAME OFFSET SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get EXT extension
get FULLSIZE asize
set TYPE long 0
if EXT == "ppk"
    set TYPE long 1
endif

if TYPE == 0
    get DUMMY long
    idstring "RESOURCES PACK"
endif
savepos OFFSET
for OFFSET = OFFSET < FULLSIZE
    goto OFFSET
    get NAMESZ long
    getdstring NAME NAMESZ
    get CRC long
    if TYPE == 0
        get ZIP long
    else
        set ZIP long 0
    endif
    get SIZE long
    get ZSIZE long
    savepos OFFSET
    if ZIP == 0
        clog NAME OFFSET ZSIZE SIZE
    else
        log NAME OFFSET SIZE
    endif
    math OFFSET += ZSIZE
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get DUMMY long
goto 0
math DUMMY ^= 0xbac04ac0
if DUMMY == 0x54436841
    filexor "0x41 0x68 0x43 0x54 0x75 0x54 0x33 0x47 0x35 0x23 0x55 0x69 0x33 0x50 0x30 0x39 0x42 0x67 0x69 0x55 0x69 0x4F 0x35"    # AhCTuT3G5#Ui3P09BgiUiO5
elif DUMMY == 0x43706f50
    filexor "0x50 0x6f 0x70 0x43 0x61 0x70 0x53 0x65 0x78 0x79 0x46 0x72 0x61 0x6d 0x65 0x77 0x6f 0x72 0x6b"                        # PopCapSexyFramework
elif DUMMY == 0x63657073
    filexor "0x73 0x70 0x65 0x63 0x69 0x61 0x6c 0x62 0x69 0x74"                                                                     # specialbit
else
    print "possible key %DUMMY%"
    math DUMMY &= 0xff
    filexor DUMMY
    #print "the file seems unsupported, contact me if extraction fails!"
endif
idstring "\xc0\x4a\xc0\xba"
for EXTRACT = 0 < 2
    goto 8
    for
        get END byte
        if END != 0
            break
        endif
        get NAMESZ byte
        getdstring NAME NAMESZ
        get SIZE long
        get DATE longlong
        if EXTRACT != 0
            log NAME OFFSET SIZE
            math OFFSET += SIZE
        endif
    next
    savepos OFFSET
next EXTRACT


Source: http://aluigi.altervista.org/quickbms.htm
Script:
filexor "0x29 0x23 0xBE 0x84 0xE1 0x6C 0xD6 0xAE 0x52 0x90 0x49 0xF1 0xF1 0xBB 0xE9 0xEB"
idstring GMGB
get FILES long

savepos NAMESTART
for i = 1 to FILES
    get NAME string
    get SIZE long
next i

savepos OFFSET
goto NAMESTART
for i = 1 to FILES
    get NAME string
    get SIZE long
    log NAME OFFSET SIZE
    math OFFSET += SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "PAK"
get TMP byte
get HEAD_SIZE long
get FOLDERS long
for i = 0 < FOLDERS
    get SUB long
    get LEVEL long
    putarray 0 i SUB
    putarray 1 i LEVEL
next i
get FILES long

savepos INFO_OFF
math NAMES_OFF = FILES
math NAMES_OFF *= 0x10
math NAMES_OFF += INFO_OFF

goto NAMES_OFF
for i = 0 < FOLDERS
    getarray SUB 0 i
    getarray LEVEL 1 i
    if LEVEL < 0
        set NAME string ""
    else
        get NAMESZ byte
        getdstring NAME NAMESZ
        putarray 4 LEVEL ""
    endif
    putarray 0 i SUB
    putarray 1 i LEVEL
    putarray 2 i NAME
next i
savepos NAMES_OFF

set PATH string ""
for i = 0 < FILES
    for j = 0 < FOLDERS
        getarray SUB   0 j
        getarray LEVEL 1 j
        getarray NAME  2 j
        if i == SUB
            if LEVEL < 0
                set PATH string /
            else
                getarray PATH 4 LEVEL
                string PATH += NAME
                string PATH += /
                math LEVEL += 1
                putarray 4 LEVEL PATH
            endif
            break
        endif
    next j

    goto INFO_OFF
    get OFFSET long
    get SIZE long
    get DUMMY long  # 0x20
    get TSTAMP long
    savepos INFO_OFF

    goto NAMES_OFF
    get NAMESZ byte
    getdstring NAME NAMESZ
    savepos NAMES_OFF

    set FNAME string PATH
    string FNAME += NAME
    log FNAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype unthandor
idstring "pck\0"
get FSIZE long
getdstring BLAH 0xa8
get FILES long
get ZERO long
goto 0x200
for i = 0 < FILES
    getdstring UNAME 0x1f0
    set NAME unicode UNAME
    get SIZE long
    getdstring TYPE 4
    get ZSIZE long
    get PACK long
    savepos OFFSET

    if PACK == 0
        clog NAME OFFSET ZSIZE SIZE
        math OFFSET += ZSIZE
    elif PACK == 1
        log NAME OFFSET SIZE
        math OFFSET += SIZE
    elif PACK == 2
        get SIZE long
        math OFFSET += 0x10
        math ZSIZE -= 0x10
        clog NAME OFFSET ZSIZE SIZE
        math OFFSET += ZSIZE
    else
        print "unknown type of pack %PACK%"
        cleanexit
    endif

    goto OFFSET
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "TBVolume\0"
get DUMMY short
get FILES long
get DUMMY short
getdstring NAME 24
savepos INFO_OFF
for i = 0 < FILES
    goto INFO_OFF
    get DUMMY long
    get OFFSET long
    savepos INFO_OFF

    goto OFFSET
    getdstring NAME 24
    get SIZE long
    savepos OFFSET

    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
encryption xor "\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2a\x2b\x2c\x2d\x2e\x2f\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3a\x3b\x3c\x3d\x3e\x3f\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9"

get FILES long
math BASE_OFF = FILES
math BASE_OFF *= 40
math BASE_OFF += 4

for i = 0 < FILES
    savepos OFFSET
    get NAME string
    get EXT string
    math OFFSET += 32
    goto OFFSET
    get OFFSET long
    get SIZE long

    string NAME += "."
    string NAME += EXT
    math OFFSET += BASE_OFF

    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get EXT extension
if EXT != "pkg"
    print "open directly the pkg files, no need of hsl"
    cleanexit
endif

comtype lzss
idstring "nxpk"
get DUMMY long
get DUMMY long
get HEADER_SIZE long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long

set PATH string ""
set NAME string ""
for
    callfunction EXTRACT
next

startfunction EXTRACT
    string PATH += NAME
    string PATH += /

    do
        savepos TMP
        if TMP >= HEADER_SIZE
            cleanexit
        endif
        getdstring TYPE 4
        if TYPE == "fldr"
            get DUMMY long
            get DUMMY long
            get PREV_OFF long
            get DUMMY long
            get NEXT_OFF long
            getdstring DUMMY 0x28
            get NAME string
            padding 0x10

            if NEXT_OFF != 0
                goto NEXT_OFF
                callfunction EXTRACT
            endif
            if PREV_OFF != 0
                goto PREV_OFF
            else
                math NEXT_OFF = 0
            endif

        elif TYPE == "file"
            get PREV_OFF long
            get DUMMY long
            get NEXT_OFF long
            get DUMMY long
            get OFFSET long
            get SIZE long
            getdstring DUMMY 0x24
            get NAME string
            padding 0x10

            set FNAME string PATH
            string FNAME += NAME

            savepos TMP
            goto OFFSET
            getdstring SIGN 4
            if SIGN == "PACK"
                callfunction PACK_LZSS
            else
                log FNAME OFFSET SIZE
            endif
            goto TMP

            if NEXT_OFF != 0
                goto NEXT_OFF
            endif

        elif TYPE == "nxpk"
            cleanexit

        else
            print "unsupported type %TYPE%, contact me"
            cleanexit
        endif
    while NEXT_OFF != 0
endfunction

startfunction PACK_LZSS
    endian big
    get PACK_FILES long
    get PACK_HEADER_SIZE long
    get PACK_SIZE long
    getdstring DUMMY 0x10
    for j = 0 < PACK_FILES
        getdstring DUMMY 0x10
        get XOFFSET long
        get XSIZE long
        get DUMMY long
        get DUMMY long
        getdstring XNAME 0x20
        set NAME string FNAME
        string NAME += /
        string NAME += XNAME
        savepos TMP2
        math XOFFSET += OFFSET
        goto XOFFSET
        getdstring SIGN 4
        if SIGN == "LZSS"
            get XSIZE long
            get XZSIZE long
            get DUMMY long
            savepos XOFFSET
            clog NAME XOFFSET XZSIZE XSIZE
        else
            log NAME XOFFSET XSIZE
        endif
        goto TMP2
    next j
    endian little
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "SERF"
get VER long
get DUMMY long
get FILES long
get DUMMY long

for i = 0 < FILES
      savepos OFFSET
      set SIZE long 256
      getdstring DUMMY SIZE
      callfunction boring_crypt
    get NAME string MEMORY_FILE
    get OFFSET long
    get ZSIZE long
    get SIZE long

    if ZSIZE == SIZE
        if NAME extension "tkr"
            callfunction boring_crypt
            get SIZE asize MEMORY_FILE
            log NAME 0 SIZE MEMORY_FILE
        else
            log NAME OFFSET SIZE
        endif
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i

# all the compression and encryption functions in QuickBMS are implemented to work with extraction (log/clog)
startfunction boring_crypt
    comtype base64
      clog MEMORY_FILE2 OFFSET SIZE SIZE
    comtype zlib
    encryption CryptDecrypt "0x4f3_56b1!44:fa" "0x8003 0x6601"
      get SIZE asize MEMORY_FILE2
      log MEMORY_FILE 0 SIZE MEMORY_FILE2
    encryption "" ""
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzo1x
idstring "ABE"
get DUMMY byte
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
get DUMMY long
get NEXT long
get DUMMY long
get ROOT long
get DUMMY long
get DUMMY long  # packs?
get FILES long
do
    goto NEXT
    get FILES long
    get PREV long
    get NEXT long
    for i = 0 < FILES
        getdstring NAME 0x50
        if NAME == ""
            break   # in case the FILES calculation is wrong
        endif
        get ZERO long
        get PREV_FILE long
        get ZSIZE long
        get TIMESTAMP longlong
        get CRC long
        get DUMMY long
        get OFFSET long
        get DUMMY long
        get SIZE long
        getdstring DUMMY 0x50
        string NAME R= "_" "/"
        savepos TMP
        goto OFFSET
        get ZSIZE long
        get SIZE long
        get DUMMY long
        get TEST long
        math OFFSET += 0x20
        if TEST == 6
            # unsupported
            math SIZE = ZSIZE
        endif
        if ZSIZE == SIZE
            goto OFFSET
            getdstring SIGN 4
            if SIGN == "LySE"
                math OFFSET += 0x14
                math SIZE   -= 0x14
            endif
            log NAME OFFSET SIZE
        else
            clog NAME OFFSET ZSIZE SIZE
        endif
        goto TMP
    next i
while NEXT != 0xffffffff


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "POD2"
get DUMMY long
getdstring TITLE 80
get FILES long
get DUMMY long

set BASE_NAME long FILES
math BASE_NAME *= 20
math BASE_NAME += 0x60

for i = 0 < FILES
    get NAME_OFF long
    get SIZE long
    get OFFSET long
    get DUMMY long
    get DUMMY long

    savepos INFO_OFF
    math NAME_OFF += BASE_NAME
    goto NAME_OFF
    get NAME string
    goto INFO_OFF

    log NAME OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring LP2C
set FULLPATH string ""
set NAME string ""
callfunction extractor

startfunction extractor
    string FULLPATH += NAME
    string FULLPATH += \

    get FOLDERS long
    get FILES long
    for i = 0 < FILES
        get NAMESZ byte
        getdstring NAME NAMESZ
        get SIZE long
        get DUMMY long
        get OFFSET long
        get ZERO long
        getdstring TIMESTAMP 8

        set FULLNAME string FULLPATH
        string FULLNAME += NAME
        log FULLNAME OFFSET SIZE
    next i
    for i = 0 < FOLDERS
        get NAMESZ byte
        getdstring NAME NAMESZ
        callfunction extractor
    next i
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
set MEMORY_FILE2 binary "\x55\x89\xe5\x57\x56\x53\x83\xec\x10\x8b\x45\x10\x85\xc0\x0f\x84\x97\x00\x00\x00\xc7\x45\xe4\x00\x00\x00\x00\x90\x8d\x74\x26\x00\x8b\x45\xe4\x8b\x55\x0c\x8b\x0c\x02\x8b\x54\x02\x04\x8b\x45\x08\x8b\x58\x0c\x8b\x70\x08\x8b\x00\x89\x5d\xe8\x8b\x5d\x08\x89\x45\xf0\x8b\x5b\x04\x89\x5d\xec\xbb\x98\xaf\xa7\xf7\x8d\x74\x26\x00\x89\xcf\x89\xc8\xc1\xef\x05\x03\x7d\xe8\xc1\xe0\x04\x01\xf0\x31\xf8\x8d\x3c\x0b\x31\xf8\x29\xc2\x89\xd0\x89\xd7\xc1\xe0\x04\xc1\xef\x05\x03\x45\xf0\x03\x7d\xec\x31\xf8\x8d\x3c\x1a\x81\xc3\x47\x86\xc8\x61\x31\xf8\x29\xc1\x81\xfb\x08\x14\x30\x14\x75\xc1\x8b\x45\xe4\x8b\x5d\x0c\x89\x0c\x03\x89\x54\x03\x04\x83\xc0\x08\x39\x45\x10\x89\x45\xe4\x0f\x87\x75\xff\xff\xff\x83\xc4\x10\x5b\x5e\x5f\x5d\xc3"
set MEMORY_FILE3 binary "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"

get BXX_NAME basename
comtype gzip
set BASE_OFF long 0
idstring "BX"
get SIGNX byte
get VERSION byte
getdstring TYPE 4
if TYPE == "ARCH"
    get DUMMY longlong
    get DUMMY longlong
    get SIZE longlong
    savepos BASE_OFF

    #if SIZE == 0   # more compatible between various versions
        get SIZE asize
        math SIZE -= BASE_OFF
    #endif

    log MEMORY_FILE BASE_OFF SIZE
    if SIGNX == 0x58
        set i long 0
        do
            if i == 0   # 3D SexVilla 2
                put 0x88957D69 long MEMORY_FILE3
                put 0xFB714ACA long MEMORY_FILE3
                put 0xBD32A8BC long MEMORY_FILE3
                put 0x36D56631 long MEMORY_FILE3
            elif i == 1 # Hentai3D 2
                put 0xB7318850 long MEMORY_FILE3
                put 0x1A7711DD long MEMORY_FILE3
                put 0xBD0B0800 long MEMORY_FILE3
                put 0xBD0B0800 long MEMORY_FILE3
            elif i == 2 # 3D SexVilla
                put 0x6559185A long MEMORY_FILE3
                put 0xFBA8524D long MEMORY_FILE3
                put 0x39EADE34 long MEMORY_FILE3
                put 0xC73A2D05 long MEMORY_FILE3
            elif i == 3 # Hentai3D 2
                put 0xB539945D long MEMORY_FILE3
                put 0x9C13407E long MEMORY_FILE3
                put 0x958CDC47 long MEMORY_FILE3
                put 0x9CEC0BBA long MEMORY_FILE3
            elif i == 4 # Virtually Jenna
                put 0x821B3FAC long MEMORY_FILE3
                put 0x398742C0 long MEMORY_FILE3
                put 0xB7ED394B long MEMORY_FILE3
                put 0x4A68E012 long MEMORY_FILE3
            elif i == 5 # Virtually Jenna 2
                put 0xBE11003C long MEMORY_FILE3
                put 0xA98C422E long MEMORY_FILE3
                put 0xA3987CE9 long MEMORY_FILE3
                put 0x0B6D0E76 long MEMORY_FILE3
            else
                print "Error: unsupported decryption key, contact me"
                cleanexit
            endif
            callfunction TEST_KEY 1
            math i += 1
        while SIGN != "BX"
        calldll MEMORY_FILE2 0 cdecl "" MEMORY_FILE3 MEMORY_FILE SIZE
    endif
else
    get SIZE asize
    log MEMORY_FILE 0 SIZE
endif

#log "dump.arch" 0 SIZE MEMORY_FILE

for i = 0
    do
        findloc OFFSET string "BX" MEMORY_FILE
        goto OFFSET MEMORY_FILE
        idstring MEMORY_FILE "BX"   # lame check
        get SIGNY byte MEMORY_FILE
    while SIGNX != SIGNY
    goto OFFSET MEMORY_FILE

    idstring MEMORY_FILE "BX"
    get SIGNX byte MEMORY_FILE
    get VERSION byte MEMORY_FILE
    getdstring TYPE 4 MEMORY_FILE
    get OLD_SIZE longlong MEMORY_FILE
    get DUMMY longlong MEMORY_FILE
    get SIZE longlong MEMORY_FILE
    if TYPE == "INDX"
        getdstring DUMMY 16 MEMORY_FILE
        getdstring DUMMY 16 MEMORY_FILE
    elif TYPE == "TREE"
    elif TYPE == "SDIR"
    elif TYPE == "DATA"
    elif TYPE == "FILE"
        # md5 with initializers 0x200, 0, 3A2D09EA FBA8591D C73DE354 6552485A (useful for the main key)
        if VERSION <= 2
            set SIZE long OLD_SIZE
        endif
        savepos OFFSET MEMORY_FILE
        math OFFSET += 16
        log MEMORY_FILE3 OFFSET 16 MEMORY_FILE  # the key
        math OFFSET += 16
        math TMP_OFF = OFFSET
        math TMP_SIZE = SIZE
        math TMP_SIZE += 15
        math TMP_SIZE &= 0xfffffff0
        math TMP_OFF += BASE_OFF
        log MEMORY_FILE4 TMP_OFF TMP_SIZE
        if SIGNX == 0x58
            calldll MEMORY_FILE2 0 cdecl "" MEMORY_FILE3 MEMORY_FILE4 TMP_SIZE
        endif
        callfunction COOL_NAME 1
        if DO_GZIP == 0
            log NAME 0 SIZE MEMORY_FILE4
        else
            clog NAME 0 SIZE SIZE MEMORY_FILE4
        endif
        math OFFSET += TMP_SIZE
        goto OFFSET MEMORY_FILE
    else
        print "Alert: unknown chunk type (%TYPE%) at offset %OFFSET%"
        #cleanexit
    endif
next i

startfunction TEST_KEY
    goto 0 MEMORY_FILE3
    log MEMORY_FILE4 0 8 MEMORY_FILE
    calldll MEMORY_FILE2 0 cdecl "" MEMORY_FILE3 MEMORY_FILE4 8
    goto 0 MEMORY_FILE4
    getdstring SIGN 2 MEMORY_FILE4
endfunction

startfunction COOL_NAME
    set DO_GZIP long 0
    set EXT string ".dat"
    if SIZE >= 4
        goto 0 MEMORY_FILE4
        getdstring SIGN 4 MEMORY_FILE4
        getvarchr SIGN1 SIGN 0
        if SIGN == "DDS "
            set EXT string ".dds"
        elif SIGN == "�PNG"
            set EXT string ".png"
        elif SIGN == "OggS"
            set EXT string ".ogg"
        elif SIGN == "RIFF"
            set EXT string ".wav"
        elif SIGN == "FEV1"
            set EXT string ".fev"
        elif SIGN == "FSB4"
            set EXT string ".fsb"
        elif SIGN == "FSB3"
            set EXT string ".fsb"
        elif SIGN == "����"
            set EXT string ".jpg"
        elif SIGN == "�O�Q"
            set EXT string ".jp2"
        elif SIGN1 == 0x1f
            set EXT string ".bsb"   # gzipped, can be any ext
            set DO_GZIP long 1
        elif SIGN1 == 0x00
            set EXT string ".jp2"
        elif SIGN1 == 0x2f
            set EXT string ".bs"
        elif SIGN1 == 0x22
            set EXT string ".bh"
        elif SIGN1 == 0x23
            set EXT string ".control"
        elif SIGN1 == 0x2e
            set EXT string ".length"
        else
            string SIGN -= 1
            if SIGN == "BSB"
                set EXT string ".bsb"
            else
                set EXT string ".dat"
            endif
        endif
    endif

    set NAME string BXX_NAME
    string NAME += /
    string NAME += i
    string NAME += EXT
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring FPAK
get DUMMY long
get DUMMY long
get FILES long
set INFO_SIZE long FILES
math INFO_SIZE *= 73
savepos INFO_OFFSET

log MEMORY_FILE INFO_OFFSET INFO_SIZE

set VAR_A long INFO_SIZE
math VAR_A -= 0x27
set VAR_C long 0xad
set VAR_D long 0x6f
for i = 0 < INFO_SIZE
    math VAR_A += VAR_C
    math VAR_C += VAR_A
    math VAR_D += VAR_C
    math VAR_D ^= VAR_A
    math VAR_A &= 0xff  # not needed
    math VAR_C &= 0xff  # not needed
    math VAR_D &= 0xff  # not needed
    getvarchr BYTE MEMORY_FILE i
    math BYTE ^= VAR_D
    putvarchr MEMORY_FILE i BYTE
next i

set MEMORY_FILE2 binary "\x7B\x47\x85\xF0\x91\x8B\x2C\x94\xA7\x55\x3A\xF6\x17\xB1\xC2\x06\x6B\x64\x28\x8A\x86\x09\xCE\xA2\x9F\x58\xDE\x46\xAE\x24\x63\x74\x69\x9D\xFB\xFD\x6E\x50\xE0\x12\x57\x1C\x08\xBC\x1B\xD0\xD9\x81\x01\xE4\xC7\x07\x88\x16\x76\x49\x23\x05\xAD\x51\x38\x78\x45\x89\x5D\xCF\x2E\x20\x26\xB6\x3B\xC3\xEB\xEF\x22\xA0\x19\xC6\x6A\xBB\xA1\x41\xF5\xCB\x73\xED\xEA\x9B\x90\xA9\x2D\xAA\x15\x27\xDA\x37\xF9\x40\xA4\xE8\x67\xBF\x1E\xB8\xAC\x60\x53\xD2\x54\x1D\x68\xF7\x4F\x00\xC4\x5E\x33\x29\x14\x0C\x3F\x62\xFC\x93\xC1\xB0\xB4\x9C\x1F\x72\xAB\x11\x18\x87\xB5\xE9\xF1\x59\xF8\x36\x5C\xA3\xE3\x79\x8C\x2F\x0A\xBA\x44\xD8\xC8\xA6\x2A\x03\xCA\x1A\x10\x35\xF3\x77\xD7\x31\xB9\x97\x43\xF2\x3D\xDF\x21\x52\x65\xB2\x34\x6F\x7F\xD3\x2B\xC0\xCC\x6D\x75\xDD\x0D\x13\xDB\xE5\x02\xEE\xB3\xF4\xC9\xFE\x66\x5B\xEC\x7D\x83\x5F\xCD\x8E\xE6\x84\xD4\xBE\x32\xD1\xA5\x56\xC5\x70\x9E\x0B\x9A\x80\x6C\x5A\xE7\x7A\x7C\xB7\x7E\xFA\xDC\x0F\xE1\x4B\x4C\x8F\x4A\x04\x4E\xA8\xFF\x3C\xD6\x0E\x95\x39\x82\x42\x3E\x61\x96\x48\x8D\xAF\x30\xE2\x71\x4D\xD5\x25\x92\xBD\x99\x98"

for i = 0 < FILES
    getdstring NAME 0x41 MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE

    log MEMORY_FILE3 OFFSET SIZE

    for j = 0 < SIZE
        getvarchr BYTE MEMORY_FILE3 j
        getvarchr BYTE MEMORY_FILE2 BYTE
        putvarchr MEMORY_FILE3 j BYTE
    next j

    log NAME 0 SIZE MEMORY_FILE3
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzma86head
idstring "tongas_pack_"
getdstring DUMMY 6
get FILES long
get HEAD_SIZE long
for i = 0 < FILES
    get OFFSET long
    get SIZE long
    get ZIP long
    get NAMESZ long
    getdstring NAME NAMESZ
    if ZIP == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET SIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "bzf2"
get DATE long
get INFO_SIZE long
get FILES long
savepos OFFSET

math INFO_SIZE += 3
math INFO_SIZE &= 0xfffffffc
math INFO_SIZE -= 16

# modified XXTEA
set MEMORY_FILE3 binary "\x53\x8b\x5c\x24\x10\x85\xdb\x57\x0f\x84\x9d\x00\x00\x00\xb8\x34\x00\x00\x00\x33\xd2\xf7\xf3\xbf\x56\xda\x4c\xb5\x69\xc0\x47\x86\xc8\x61\x2b\xf8\x0f\x84\x81\x00\x00\x00\x8b\x4c\x24\x0c\x55\x56\xeb\x04\x8b\x5c\x24\x1c\x8b\xf7\x8d\x43\xff\xc1\xee\x02\x83\xe6\x03\x85\xc0\x76\x34\x8b\x54\x81\xfc\x8b\xda\x8b\xea\xc1\xeb\x05\xc1\xe5\x04\x33\xdd\x8b\x6c\x24\x18\x03\xda\x8b\xd0\x83\xe2\x03\x33\xd6\x8b\x54\x95\x00\x8b\x2c\x81\x03\xd7\x33\xda\x2b\xeb\x89\x2c\x81\x48\x75\xd0\x8b\x5c\x24\x1c\x8b\x54\x99\xfc\x83\xe0\x03\x8b\xda\x8b\xea\xc1\xeb\x05\xc1\xe5\x04\x33\xdd\x33\xc6\x03\xda\x8b\x54\x24\x18\x8b\x04\x82\x8b\x11\x03\xc7\x33\xd8\x2b\xd3\x81\xc7\x47\x86\xc8\x61\x89\x11\x75\x89\x5e\x5d\x5f\x5b\xc3"
log MEMORY_FILE OFFSET INFO_SIZE
set MEMORY_FILE2 binary "\x76\x1b\xd4\xfe\xe0\x2b\xd3\x89\x5a\x7a\xda\x10\xcc\x4a\xdd\x67"
math INFO_SIZE /= 4

# check if the info table is encrypted, unfortunately don't exist other ways
get TYPE byte MEMORY_FILE
get OFFSET long MEMORY_FILE
goto 0 MEMORY_FILE
set do_encryption long 0
if TYPE == 4
elif TYPE == 5
else
    set do_encryption long 1
endif
math OFFSET >>= 24
math OFFSET &= 0xff
if OFFSET != 0x00
    set do_encryption long 1
endif
if do_encryption != 0
    calldll MEMORY_FILE3 0 cdecl RET MEMORY_FILE MEMORY_FILE2 INFO_SIZE
endif

#extraction
for i = 0 < FILES
    get TYPE byte MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get ZSIZE long MEMORY_FILE
    get DUMMY long MEMORY_FILE
    get NAMESZ short MEMORY_FILE
    getdstring NAME NAMESZ MEMORY_FILE

    if TYPE == 4
        log NAME OFFSET SIZE
    elif TYPE == 5
        clog NAME OFFSET ZSIZE SIZE
    else
        print "Error: unknown TYPE %TYPE%"
        cleanexit
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
putarray 0 0 "mcp.bin"
putarray 0 1 "cp.bin"
putarray 0 2 "ep.bin"
putarray 0 3 "vp.bin"
putarray 0 4 "tp.bin"
putarray 0 5 ""
math MYBIN = 0

endian big
comtype lzss "12 4 2 2 0"   # normal LZSS with 0x00

get MYNAME filename
math IDX = 0
if MYNAME == "i.dat"
    math IDX += 1
endif
for i = 0
    getarray NAME 0 i
    if NAME == ""
        break
    endif
    if NAME == MYNAME
        math IDX += 1
    endif
next i
if IDX != 0
    open FDSE "i.dat"
endif

callfunction DECRYPT 1

get FULLSIZE asize MEMORY_FILE
if IDX == 0
    get PCHECK basename
    strlen NAMESZ PCHECK
    math NAMESZ -= 1
    string PCHECK <= NAMESZ

    get PATH basename
    string PATH += /
    endian little
    get FILES long MEMORY_FILE
    for OFFSET = 0 < FULLSIZE
        getdstring NAME 0x200 MEMORY_FILE
        set NAME unicode NAME

        ## old guess method ##
        #savepos OFFSET MEMORY_FILE
        #findloc NEXT_OFF string "\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd\xfd" MEMORY_FILE ""
        #if NEXT_OFF == ""
        #    get NEXT_OFF asize MEMORY_FILE
        #else
        #    goto NEXT_OFF MEMORY_FILE
        #    for j = 0 < 0x200
        #        get TMP byte MEMORY_FILE
        #        if TMP != 0xfd
        #            break
        #        endif
        #    next j
        #    savepos NEXT_OFF MEMORY_FILE
        #    math NEXT_OFF -= 0x200
        #    math NEXT_OFF -= 1
        #endif
        #math SIZE = NEXT_OFF
        #math SIZE -= OFFSET

        if PCHECK != "p"
            get DUMMY long MEMORY_FILE
            get DUMMY long MEMORY_FILE
        endif
        get SIZE long MEMORY_FILE
        savepos OFFSET MEMORY_FILE

        set FNAME string PATH
        string FNAME += NAME
        log FNAME OFFSET SIZE MEMORY_FILE

        #math OFFSET = NEXT_OFF
        math OFFSET += SIZE

        goto OFFSET MEMORY_FILE
    next
else
    # create backup
    log MEMORY_FILE2 0 FULLSIZE MEMORY_FILE

    getdstring NAME 0x18 MEMORY_FILE2
    set NAME unicode NAME
    get FILES long MEMORY_FILE2
    reverselong FILES
    for i = 0 < FILES
        get ENTRYSZ byte MEMORY_FILE2

        get NAMESZ short MEMORY_FILE2
        math NAMESZ *= 2
        getdstring NAME NAMESZ MEMORY_FILE2
        set NAME unicode NAME

        get PATHSZ short MEMORY_FILE2
        math PATHSZ *= 2
        getdstring PATH PATHSZ MEMORY_FILE2
        set PATH unicode PATH

        get DUMMY1 byte MEMORY_FILE2
        get SIZE long MEMORY_FILE2
        reverselong SIZE
        get DUMMY2 byte MEMORY_FILE2
        get OFFSET long MEMORY_FILE2
        reverselong OFFSET

        set FNAME string PATH
        string FNAME += /
        string FNAME += NAME

        if OFFSET == 0
            getarray NAME 0 MYBIN
            math MYBIN += 1
            open FDSE NAME
            callfunction DECRYPT 1
        endif

        if PATH == "museum"    # unsupported
            print "skip %FNAME%"
        else
            log FNAME OFFSET SIZE MEMORY_FILE
        endif
    next i
endif

startfunction DECRYPT
    math XOFFSET = 0x10
    get XSIZE asize
    math XSIZE -= XOFFSET
    getdstring KEY XOFFSET
    filerot "\x3b\x16\x6f\xd8\xac\xb2\x09\xfc\xb0\x9d\xa9\x3a\xdc\xa1\x3f\xd2\x45\x17\x11\x03\xfb\x59\x5e\x21\xd3\x7a\x41\xe8\x6a\x34\xd9\x10\x66\x21\xa7\x21\xff\x2e\x37\x89\xbf\x4e\x03\xec\x85\x6b\x94\xbb\xd0\xa2\xea\x08\x3a\xaf\x1e\x99\x43\xa6\x46\x3b\x50\xe5\x99\x58\xf4\x46\xd4\xcc\x6d\x99\xdc\xf5\x72\x51\xa4\x09\x2c\x7d\x51\xad\x82\xfa\x9c\xc3\x99\xe7\x78\x83\x9b\x5a\xf5\xcd\xb8\x51\x65\xbd\x6b\xec\xbd\x81\xff\xd9\x3e\x67\x51\x0f\x54\x3a\xd7\xbf\xbe\xcf\xe1\x87\xef\xdb\x1f\xea\xb4\x07\x64\xfd\x18\x47\xa9\x62\x85\x67\x55\x7a\x2b\xe7\xbc\xd7\xa5\x08\xe5\xf0\xda\x27\x90\x19\x22\x4a\x77\xb2\xab\xf9\xd5\x9e\x1a\x4f\x25\xf7\x75\x50\x2c\xff\x40\x7d\x39\x5a\xe6\xa6\xac\x7b\x5b\x00\xb5\x5d\x00\x77\x5e\x73\xc7\x45\xcc\xe1\x97\xc4\xc1\xec\xf2\x80\x66\xaf\xd5\x91\x48\x10\xdf\x28\xa0\xf3\xb6\x67\xd7\xae\xa7\x76\x49\xbc\x8c\xd3\x4a\xb5\xf3\xe9\x66\x7d\x7c\xe5\xed\xbc\x83\xc5\xb0\x8f\xff\xb1\x05\x7e\xaa\x8f\x11\xad\x63\xd2\x46\x56\xd0\x92\x2a\x76\x47\xe2\x5a\xc7\xef\x5e\xcf\xef\x22\x03\x61\xf7\x16\x44\x89\xfe\xbd\x59\x6b\x2f\xe9\xdb"
    encryption xor KEY "" 0 XOFFSET
    log MEMORY_FILE XOFFSET XSIZE
    encryption "" ""
    filerot ""

    get XZSIZE asize MEMORY_FILE
    get TMP long MEMORY_FILE
    reverselong TMP
    math XOFFSET = 0
    math XSIZE = XZSIZE
    math XSIZE *= 8
    if TMP < XSIZE
    if TMP > XZSIZE
        math XSIZE = TMP
        savepos XOFFSET MEMORY_FILE
        math XZSIZE -= XOFFSET
    endif
    endif
    clog MEMORY_FILE XOFFSET XZSIZE XSIZE MEMORY_FILE
    goto 0 MEMORY_FILE
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype lzf
get DUMMY long
get FILES long
get BASE_OFF long
math BASE_OFF += 0xc
for i = 0 < FILES
    get NAME string
    get OFFSET long
    get NOZIP byte
    get SIZE long
    get ZSIZE long
    get CRC long
    math OFFSET += BASE_OFF
    if NOZIP == 0
        clog NAME OFFSET ZSIZE SIZE
    else
        log NAME OFFSET SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
print "NOTE that this script is a work-around so will not work with all the files\nif you want to extract ALL the files without names (but they will be 100% corrects) edit this script setting NAMELESS to 1"

set NAMELESS long 0 # set to 1 to extract the files without names
comtype lz2k

get INFO_OFF long
if INFO_OFF & 0x80000000
    math INFO_OFF ^= 0xffffffff
    math INFO_OFF <<= 8
    math INFO_OFF += 0x100
endif
get INFO_SIZE long
log MEMORY_FILE INFO_OFF INFO_SIZE

get TYPE_BOH long MEMORY_FILE
get FILES long MEMORY_FILE
savepos INFO_OFF MEMORY_FILE

math TMP = FILES
math TMP *= 16
math NAME_INFO = INFO_OFF
math NAME_INFO += TMP

goto NAME_INFO MEMORY_FILE
get NAMES long MEMORY_FILE
savepos NAME_INFO MEMORY_FILE

math TMP = NAMES
math TMP *= 8
math NAME_OFF = NAME_INFO
math NAME_OFF += TMP

goto NAME_OFF MEMORY_FILE
get NAMECRC_OFF long MEMORY_FILE
savepos NAME_OFF MEMORY_FILE

math NAMECRC_OFF += NAME_OFF
goto NAMECRC_OFF MEMORY_FILE
for i = 0 < FILES
    get CRC long MEMORY_FILE
    putarray 0 i CRC
next i

if TYPE_BOH <= -2
    get DUMMY1 long MEMORY_FILE
    get DUMMY2 long MEMORY_FILE
    if DUMMY1 > 0
        #print "Error: not implemented yet"
        #cleanexit
    endif
endif

# print "files:       %FILES%"
# print "names:       %NAMES%"
# print "info_off:    %INFO_OFF%"
# print "info_size:   %INFO_SIZE%"
# print "name_info:   %NAME_INFO%"
# print "name_off:    %NAME_OFF%"
# print "namecrc_off: %NAMECRC_OFF%"

set NAMEZ long 0
set FULLNAME string ""
set FULLPATH string ""

for i = 0 < FILES
    # do NOT try to understand this part because I have not understood it too :)
    do
        goto NAME_INFO MEMORY_FILE
        get NEXT short MEMORY_FILE
        get PREV short MEMORY_FILE
        get OFF long MEMORY_FILE
        savepos NAME_INFO MEMORY_FILE

        math OFF += NAME_OFF
        goto OFF MEMORY_FILE
        get NAME string MEMORY_FILE

        if NEXT & 0x8000    # 16bit sign conversion
            math NEXT |= 0xffff0000
        endif

        putarray 1 NAMEZ NAME
        if NEXT > 0 # folder
            getarray OLDNAME 1 PREV
            string FULLPATH >>= OLDNAME
            if NAME != ""
                string FULLPATH += NAME
                string FULLPATH += \
            endif
        endif
        math NAMEZ += 1
    while NEXT > 0
    set FULLNAME string FULLPATH
    string FULLNAME += NAME

    if NAMELESS == 0
        math CRC = 0x811c9dc5
        strlen NAMESZ FULLNAME
        for j = 0 < NAMESZ
            getvarchr CHR FULLNAME j
            if CHR >= 0x61
                if CHR <= 0x7a
                    math CHR -= 0x20
                endif
            endif
            math CRC ^= CHR
            math CRC *= 0x199933
        next j
        for j = 0 < FILES
            getarray TMP 0 j
            if CRC == TMP
                break
            endif
        next j
        if j >= FILES
            print "Alert: the crc of the file %FULLNAME% has not been found, it can't be extracted!"
            #cleanexit
            # all wrongs!
            math j = i
            #math TMP = NEXT
            #math j = 0
            #math j -= NEXT
            #math j -= 1
        endif
        math TMP = j
    else
        math TMP = i
    endif

        math TMP *= 16
        math TMP += INFO_OFF
        goto TMP MEMORY_FILE
        get OFFSET long MEMORY_FILE
        math OFFSET <<= 8
        get ZSIZE long MEMORY_FILE
        get SIZE long MEMORY_FILE
        get PACKED long MEMORY_FILE

        goto OFFSET
        getdstring SIGN 4
        if SIGN == "LZ2K"
            set PACKED long 2
        else
            set PACKED long 0
        endif

        if PACKED & 2
            callfunction UNLZ2K
            log FULLNAME 0 SIZE MEMORY_FILE2
        else
            if SIZE != 0
            if ZSIZE != 0
            if SIZE != ZSIZE
                print "SIZE (%SIZE%) and ZSIZE (%ZSIZE%) differ, contact me"
                cleanexit
            endif
            endif
            endif
            log FULLNAME OFFSET SIZE
        endif
next i


startfunction UNLZ2K
    putvarchr MEMORY_FILE2 SIZE 0
    log MEMORY_FILE2 0 0
    append
    for TMPSZ = 0 < ZSIZE
        goto OFFSET
        getdstring SIGN 4
        if SIGN != "LZ2K"
            print "Error: the signature at offset %OFFSET% (%SIGN%) is not LZ2K, contact me"
            cleanexit
        endif
        get LZ2K_SIZE long
        get LZ2K_ZSIZE long
        savepos OFFSET
        if LZ2K_ZSIZE == LZ2K_SIZE
            log MEMORY_FILE2 OFFSET LZ2K_SIZE
        else
            clog MEMORY_FILE2 OFFSET LZ2K_ZSIZE LZ2K_SIZE
        endif
        math OFFSET += LZ2K_ZSIZE
        savepos TMP MEMORY_FILE2
        math TMPSZ += 12
        math TMPSZ += LZ2K_ZSIZE
    next
    append
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "APK"
get PACK_NUMBER byte
get INFO_OFFSET long
get CRYPT_INIT long

goto INFO_OFFSET
get INFO_SIZE asize
math INFO_SIZE -= INFO_OFFSET
log MEMORY_FILE INFO_OFFSET INFO_SIZE

set TMP_x10194eac long CRYPT_INIT
math TMP_x10194eac *= INFO_OFFSET
for i = 0 < INFO_SIZE
    set TMP long TMP_x10194eac
    math TMP >>= 16
    math TMP_x10194eac &= 0xffff
    math TMP_x10194eac *= 0x6054
    math TMP_x10194eac += TMP

    getvarchr CHR MEMORY_FILE i
    math CHR ^= TMP_x10194eac
    putvarchr MEMORY_FILE i CHR
next i

set OUT_INFO_SIZE long INFO_SIZE
math OUT_INFO_SIZE *= 8    # more than enough
clog MEMORY_FILE2 0 INFO_SIZE OUT_INFO_SIZE MEMORY_FILE

get TABLE_SIZE asize MEMORY_FILE2
for
    savepos TABLE_OFFSET MEMORY_FILE2   # regular
    if TABLE_OFFSET >= TABLE_SIZE
        cleanexit
    endif

    get NAME string MEMORY_FILE2
    get OFFSET long MEMORY_FILE2
    get ZSIZE long MEMORY_FILE2
    get XTYPE byte MEMORY_FILE2
    get SIZE long MEMORY_FILE2
    get CRYPT_INIT long MEMORY_FILE2

    savepos TABLE_OFFSET MEMORY_FILE2   # it's needed here in this game
    if TABLE_OFFSET >= TABLE_SIZE
        cleanexit
    endif

    get DUMMY long MEMORY_FILE2

    log MEMORY_FILE OFFSET ZSIZE

    if XTYPE & 1
        set TMP_x10194eac long OFFSET
        math TMP_x10194eac *= SIZE
        math TMP_x10194eac ^= CRYPT_INIT
        for i = 0 < ZSIZE
            set TMP long TMP_x10194eac
            math TMP >>= 16
            math TMP_x10194eac &= 0xffff
            math TMP_x10194eac *= 0x6054
            math TMP_x10194eac += TMP

            getvarchr CHR MEMORY_FILE i
            math CHR ^= TMP_x10194eac
            putvarchr MEMORY_FILE i CHR
        next i
    endif

    if XTYPE & 2
        clog NAME 0 ZSIZE SIZE MEMORY_FILE
    else
        log NAME 0 SIZE MEMORY_FILE
    endif
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring LZSS_SIGN 4
if LZSS_SIGN == "LZSS"
    get WDT_SIZE long
    get CHUNK_SIZE long
    get LZSS_TYPE short
    comtype TZAR_LZSS LZSS_TYPE
    get CHUNK_OFF long

    set BASE_OFF long CHUNK_OFF
    putvarchr MEMORY_FILE WDT_SIZE 0    # pre-allocate for making it faster
    log MEMORY_FILE 0 0
    append
    do
        savepos MYOFF
        get NEXT_OFF long
        if MYOFF >= BASE_OFF
            get NEXT_OFF asize
        endif
        math ZSIZE = NEXT_OFF
        math ZSIZE -= CHUNK_OFF
        clog MEMORY_FILE CHUNK_OFF ZSIZE CHUNK_SIZE
        set CHUNK_OFF long NEXT_OFF
    while MYOFF < BASE_OFF
    append
    goto 0 MEMORY_FILE
else
    get WDT_SIZE asize
    log MEMORY_FILE 0 WDT_SIZE
endif

idstring MEMORY_FILE "HMMSYS PackFile"
goto 0x20 MEMORY_FILE
get FILES long MEMORY_FILE
get DUMMY long MEMORY_FILE

set SAVENAME string ""
for i = 0 < FILES
    get NAMESZ byte MEMORY_FILE
    get SAVED byte MEMORY_FILE
    set FULLNAME string SAVENAME
    putvarchr FULLNAME SAVED 0
    math NAMESZ -= SAVED
    getdstring NAME NAMESZ MEMORY_FILE
    string FULLNAME += NAME
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE

    log FULLNAME OFFSET SIZE MEMORY_FILE
    set SAVENAME string FULLNAME
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
endian big
comtype lzma86head
idstring "UnityWeb"
get DUMMY long
get VER byte
get VER string
get VER string
get SIZE long
get OFFSET long
math SIZE -= OFFSET

get NAME filename
string NAME += "_unpacked"
#unpacker only
#clog NAME OFFSET SIZE SIZE
set PATH string NAME

clog MEMORY_FILE OFFSET SIZE SIZE
get FILES long MEMORY_FILE
for i = 0 < FILES
    get NAME string MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    set FNAME string PATH
    string FNAME += /
    string FNAME += NAME
    log FNAME OFFSET SIZE MEMORY_FILE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
set SIGN_OFF long 0
set MPG_MODE long 0
get NAME basename
getdstring SIGN 3
if SIGN == "VSP"
elif SIGN == "RIF"
else
    findloc SIGN_OFF string "VSP" ""
    if SIGN_OFF == ""
        findloc SIGN_OFF string "RIF" ""
        if SIGN_OFF == ""
            cleanexit
        endif
    endif
    goto SIGN_OFF
    getdstring SIGN 3
    #findloc SIGN_END string "RIFF" ""   # wav file after it
    #if SIGN_END == ""
        get SIGN_END asize
    #endif
endif

#set VS4_DO_NOTHING long 0
#if VS4_DO_NOTHING != 0  # useless
#    goto -0x2c
#    get x54 long
#    get x50 long
#    get x4c long
#    get x48 long
#    get x44 long
#    get x40 long
#    get x3c long
#    get x38 long
#    get x34 long
#    get x30 long
#    get x2c long
#
#    math x44 ^= 0x214FE73
#    math x40 ^= 0x16563E3
#    math x3c ^= 0x29CC764
#    math OFFSET = x30
#    math OFFSET += x50
#    math OFFSET += x38
#    math OFFSET += x34
#    math OFFSET += x3c
#    math OFFSET += x40
#    math OFFSET += x44
#
#    math OFFSET += SIGN_OFF
#    goto OFFSET
#    getdstring DATA 0x3c
#    get DATASZ short
#    getdstring DATA DATASZ
#    get DATASZ short
#    getdstring DATA DATASZ
#    get DATASZ short
#    getdstring DATA DATASZ
#
#    set NAME string DATA
#    string NAME += ".avi"
#endif
#goto SIGN_OFF
#getdstring SIGN 3

get SIGN4 byte
if SIGN == "VSP"
    math SIGN4 ^= 0x46
    filexor SIGN4
    if SIGN4 == 0xc8
        set XOR_SIZE long  500001
    elif SIGN4 == 0xaa
        set XOR_SIZE long 1500001
    else
        set SIGN4 long 0xc8
        set XOR_SIZE long  500001
        set MPG_MODE long 1
        filexor SIGN4
        #print "Error: unknown xor size for SIGN4 %SIGN4%"
        #cleanexit
    endif

    if MPG_MODE == 0
        get RIFF_SIZE long
        math RIFF_SIZE += 8
    else
        math RIFF_SIZE = SIGN_END
        math RIFF_SIZE -= SIGN_OFF
    endif

    log MEMORY_FILE SIGN_OFF XOR_SIZE
    filexor ""
    math TMP_SIZE = RIFF_SIZE
    math TMP_SIZE -= XOR_SIZE
    math TMP_OFF = XOR_SIZE
    math TMP_OFF += SIGN_OFF
    append
        log MEMORY_FILE TMP_OFF TMP_SIZE
    append
elif SIGN == "RIF"  # change the codec only
    get RIFF_SIZE long
    math RIFF_SIZE += 8
    log MEMORY_FILE SIGN_OFF RIFF_SIZE
endif

if MPG_MODE == 0
    putvarchr MEMORY_FILE 0x00 0x52
    putvarchr MEMORY_FILE 0x01 0x49
    putvarchr MEMORY_FILE 0x02 0x46
    putvarchr MEMORY_FILE 0x03 0x46

    putvarchr MEMORY_FILE 0x70 0x64
    putvarchr MEMORY_FILE 0x71 0x69
    putvarchr MEMORY_FILE 0x72 0x76
    putvarchr MEMORY_FILE 0x73 0x78

    putvarchr MEMORY_FILE 0xbc 0x44
    putvarchr MEMORY_FILE 0xbd 0x58
    putvarchr MEMORY_FILE 0xbe 0x35
    putvarchr MEMORY_FILE 0xbf 0x30
    string NAME += ".avi"
else
    putvarchr MEMORY_FILE 0x00 0x00
    putvarchr MEMORY_FILE 0x01 0x00
    putvarchr MEMORY_FILE 0x02 0x01
    string NAME += ".mpg"
endif

log NAME 0 RIFF_SIZE MEMORY_FILE


Source: http://aluigi.altervista.org/quickbms.htm
Script:
comtype gzip
endian big
idstring FArC
get LIMIT long
get DUMMY long
for CURR_OFF = 0xc < LIMIT
    get NAME string
    get OFFSET long
    get ZSIZE long
    get SIZE long
    if SIZE == ZSIZE
        log NAME OFFSET SIZE
    else
        endian little   # for gzip
        clog NAME OFFSET ZSIZE SIZE
        endian big
    endif
    savepos CURR_OFF
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
# Visionaire Player/Studio (script 0.3.6)
#   notes:
#   - decryption of images is not supported (there are just 8 bytes xored with a filename-related key)
#   - the output names are not 100% correct
#   - the script works also with executables and encrypted old VIS archives
#
# I highly suggest you to use the VISExt tool of Deniz Oezmen instead of this script:
#   http://oezmen.eu/gameresources/files/anb.zip
#
# script for QuickBMS http://quickbms.aluigi.org

# build the keys database
# to developers: use -a DUMP for an help guessing the key

# Long story short, I add a space prefix or the key is handled as a number (quickbms bug/feature)
putarray 8 -1 " 76093af7c458e3c5"   # md5 hash of unicode "VSADV3PL" (many games)
putarray 8 -1 " 98d1a1f120d8ce55"   # md5 hash of unknown string (Deponia)
putarray 8 -1 " af0512966ae16580"   # The Dark Eye: Chains of Satinav
putarray 8 -1 " 155c703a508c1c8a"   # ???
putarray 8 -1 " d9ef88157bcbcae0"   # Deponia french
putarray 8 -1 " 6b7d3fb08202c948"   # Goodbye Deponia
putarray 8 -1 " 5ecdd8875a17aeb6"   # Goodbye Deponia
putarray 8 -1 " ce374042a0c24e0d"   # Deponia Complete Journey
putarray 8 -1 " 485f13a285b3f109"   # ASA

# from vis.key
putarray 8 -1 ";76093af7c458e3c5"
putarray 8 -1 ";98d1a1f120d8ce55"
putarray 8 -1 ";d501025337a850e0"
putarray 8 -1 ";32e617da0a210263"
putarray 8 -1 ";5b905e9ae76ed5d1"
putarray 8 -1 ";eae80125d94d10e9"
putarray 8 -1 ";0b5250b3a2ff1440"
putarray 8 -1 ";af0512966ae16580"
putarray 8 -1 ";155c703a508c1c8a"
putarray 8 -1 ";d0e0111bf880e80f"
putarray 8 -1 ";d9ef88157bcbcae0"
putarray 8 -1 ";885974be81048e9b"
putarray 8 -1 ";008d8599a3a27c55"
putarray 8 -1 ";dcff854efc3e840c"
putarray 8 -1 ";5ecdd8875a17aeb6"
putarray 8 -1 ";dbd41139252cfd20"
putarray 8 -1 ";db94f6d45fc49b11"
putarray 8 -1 ";a986265a4cba51d3"
putarray 8 -1 ";0c994edf1c03d376"

putarray 8 -1 "                 "
putarray 8 -1 ""

getdstring SIGN 4
if SIGN == "VIS3"
    get FILES long  # max 0x1869f?
    if FILES u> 0x00ffffff # 0x1869f
        endian big
        reverselong FILES
    endif
    savepos BASE_OFF
    math TMP = FILES
    math TMP *= 16
    math TMP += 6

    # key scanner
    math i = 0
    do
        getarray KEY 8 i
        if KEY == ""
            print "unknown Visionaire key, I try to guess it"
            goto BASE_OFF
            getdstring KEY 0x17
            callfunction GUESS_KEY 1
        else
            string KEY <<= 1    # remove the space work-around
        endif
        encryption xor KEY
        log MEMORY_FILE BASE_OFF 3
        encryption "" ""
        getdstring SIGN 3 MEMORY_FILE
        math i += 1
    while SIGN != "HDR"
    print "use key %KEY%"

    encryption xor KEY
    log MEMORY_FILE BASE_OFF TMP
    encryption "" ""
    if quickbms_arg1 == "DUMP"
        log "visionaire_dump.dat" 0 TMP MEMORY_FILE
        cleanexit
    endif
    math BASE_OFF += TMP

    math LAME_VIS   = 0 # Deponia
    math OLD_OFFSET = 0
    math OLD_ZSIZE  = 0

    getdstring SIGN 3 MEMORY_FILE

    for i = 0 < FILES
        putarray 0 i ""
    next i
    savepos BACKUP_OFFSET MEMORY_FILE
    for EXTRACT = 0 < 2
        goto BACKUP_OFFSET MEMORY_FILE
        for i = 0 < FILES
            encryption "" ""
            get OFFSET long MEMORY_FILE
            get ZSIZE long MEMORY_FILE
            get SIZE long MEMORY_FILE
            get TYPE long MEMORY_FILE

            if i == 1
                if TYPE > 0xffff
                    math LAME_VIS = 1
                endif
            endif
            if LAME_VIS != 0
                callfunction LAME_VIS_FIX 1
            endif

            math OFFSET += BASE_OFF
            if SIZE != ZSIZE
                if TYPE & 1
                else
                    math OFFSET += 8    # 32bit SIZE + 32bit ZSIZE
                    math ZSIZE  -= 8
                endif
            endif

            if TYPE & 2
                encryption xor KEY
            endif
            if TYPE & 8
                # obfuscation of image files is not supported,
                # check VISExt DecryptPNG and DecryptWebP
            endif

            if EXTRACT == 0
                if TYPE & 0x11  # 0x10 or 0x01
                    callfunction DUMP_TO_MEMORY 1
                    callfunction GET_FILENAMES
                endif
            else
                getarray NAME 0 i
                callfunction DUMP_TO_NAME 1
            endif
        next i
    next EXTRACT
else
    goto 0
    getdstring SIGN 3
    goto 0  # reset, useful
    if SIGN != "VIS"
        # if you have only one big executable you must first dump
        # everything from the first occurrence of the bytes d1 b5 d1
        # update: no longer necessary because I do it here!
        math VIS_OFFSET = 0
        get EXT extension
        if EXT == "exe"
            findloc VIS_OFFSET string "\xd1\xb5\xd1"
            goto VIS_OFFSET
            print "- VIS file possible offset %VIS_OFFSET|x%"
        endif

        set PASSWD string "PASSWD"  # original of "\x7b\x6c\x7e\x7e\x82\x6f"
        strlen TMP PASSWD
        for i = 0 < TMP
            getvarchr BYTE PASSWD i
            math BYTE += 0x2b
            math BYTE n= BYTE   # needed for Encryption
            putvarchr PASSWD i BYTE
        next i
        encryption rot PASSWD "" "" TMP
    endif
    get SIZE asize  # yeah, lame way but it's the only one here
    math SIZE -= VIS_OFFSET
    math SIZE /= 4  # because it's necessary a one-byte function
    log MEMORY_FILE VIS_OFFSET SIZE
    encryption "" ""
    idstring MEMORY_FILE "VIS"
    get FILES long MEMORY_FILE
    for EXTRACT = 0 < 2
        goto 7 MEMORY_FILE
        for i = 0 < FILES
            get NAMESZ byte MEMORY_FILE
            getdstring NAME NAMESZ MEMORY_FILE
            get OFFSET long MEMORY_FILE
            get SIZE long MEMORY_FILE
            if EXTRACT != 0
                math OFFSET += BASE_OFF
                math OFFSET += VIS_OFFSET
                log NAME OFFSET SIZE
            endif
        next i
        savepos BASE_OFF MEMORY_FILE
    next EXTRACT
endif

startfunction LAME_VIS_FIX
    if i <= 4
        math TYPE = 0
    elif i <= 8
        math OFFSET = OLD_OFFSET
        math OFFSET += OLD_ZSIZE
    else
        math ZSIZE &= 0x00ffffff
        math LAME_VIS = 0   # reset
    endif
    math OLD_OFFSET = OFFSET
    math OLD_ZSIZE  = ZSIZE
endfunction

startfunction GET_FILENAMES
    for
        findloc NAME_OFF string "=\"" MEMORY_FILE2 ""
        if NAME_OFF == ""
            break
        endif
        math NAME_OFF += 2
        goto NAME_OFF MEMORY_FILE2
        findloc NAME_SIZE string "\"" MEMORY_FILE2 ""
        math NAME_SIZE -= NAME_OFF
        getdstring NAME NAME_SIZE MEMORY_FILE2
        if NAME & "#"
            string TMP = NAME
            string TMP >> 1
            string TMP strrchrx "#"
            math TMP = TMP
            string NAME % "#"
            putarray 0 TMP NAME
        endif
    next
endfunction

startfunction DUMP_TO_NAME
    if SIZE == ZSIZE    # copied below
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
endfunction

startfunction DUMP_TO_MEMORY
    if SIZE == ZSIZE    # copied above
        log MEMORY_FILE2 OFFSET SIZE
    else
        clog MEMORY_FILE2 OFFSET ZSIZE SIZE
    endif
endfunction

startfunction GUESS_KEY
    getvarchr TMP00 KEY 0x00
    getvarchr TMP01 KEY 0x01
    getvarchr TMP02 KEY 0x02
    getvarchr TMP03 KEY 0x03
    getvarchr TMP04 KEY 0x04
    getvarchr TMP05 KEY 0x05
    getvarchr TMP06 KEY 0x06
    getvarchr TMP07 KEY 0x07
    getvarchr TMP08 KEY 0x08
    getvarchr TMP09 KEY 0x09
    getvarchr TMP0a KEY 0x0a
    getvarchr TMP0b KEY 0x0b
    getvarchr TMP0c KEY 0x0c
    getvarchr TMP0d KEY 0x0d
    getvarchr TMP0e KEY 0x0e
    getvarchr TMP0f KEY 0x0f
    getvarchr TMP10 KEY 0x10
    getvarchr TMP11 KEY 0x11
    getvarchr TMP12 KEY 0x12
    getvarchr TMP13 KEY 0x13
    getvarchr TMP14 KEY 0x14
    getvarchr TMP15 KEY 0x15
    getvarchr TMP16 KEY 0x16
    math TMP00 ^ 'H'
    math TMP01 ^ 'D'
    math TMP02 ^ 'R'
    math TMP13 ^ TMP03
    math TMP14 ^ TMP04
    math TMP15 ^ TMP05
    math TMP16 ^ TMP06
    math TMP07 ^ TMP13
    math TMP08 ^ TMP14
    math TMP09 ^ TMP15
    math TMP0a ^ TMP16
    math TMP0b ^ TMP13
    math TMP0c ^ TMP14
    math TMP0d ^ TMP15
    math TMP0e ^ TMP16
    putvarchr KEY 0x00 TMP00
    putvarchr KEY 0x01 TMP01
    putvarchr KEY 0x02 TMP02
    putvarchr KEY 0x03 TMP03
    putvarchr KEY 0x04 TMP04
    putvarchr KEY 0x05 TMP05
    putvarchr KEY 0x06 TMP06
    putvarchr KEY 0x07 TMP07
    putvarchr KEY 0x08 TMP08
    putvarchr KEY 0x09 TMP09
    putvarchr KEY 0x0a TMP0a
    putvarchr KEY 0x0b TMP0b
    putvarchr KEY 0x0c TMP0c
    putvarchr KEY 0x0d TMP0d
    putvarchr KEY 0x0e TMP0e
    putvarchr KEY 0x0f TMP0f
    putvarchr KEY 0x10 0
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring LPK2
set XOFFSET 16
goto XOFFSET
get NAMES_OFFSET long
set LIMIT_OFFSET NAMES_OFFSET
math LIMIT_OFFSET += 20
math NAMES_OFFSET += 24
savepos XOFFSET

for XOFFSET = XOFFSET < LIMIT_OFFSET
    goto XOFFSET
    get DUMMY long
    get OFFSET long
    savepos XOFFSET

    math OFFSET += 8
    goto OFFSET
    get DUMMY long
    get SIZE long
    math SIZE -= 16
    getdstring DUMMY 12
    savepos OFFSET

    goto NAMES_OFFSET
    get NAME string
    savepos NAMES_OFFSET
    do  # padding
        if NAMES_OFFSET & 3
            math NAMES_OFFSET += 1
        endif
    while NAMES_OFFSET & 3

    log NAME OFFSET SIZE
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring SIGN 4
if SIGN == "YYST"
    comtype unzip_dynamic
    get DUMMY long
    get FILES long
    get HEAD_SIZE long
    for i = 0 < FILES
        get NAMESZ short
        getdstring NAME NAMESZ
        get SIZE long
        get OFFSET long
        set TMP extension NAME
        if TMP == "ccz"
            clog NAME OFFSET SIZE SIZE
        else
            log NAME OFFSET SIZE
        endif
    next i
    cleanexit
endif
goto 0

comtype lzma86head
get OFFSET long
goto OFFSET
set NAME string ""
set PATH string ""
callfunction EXTRACT

startfunction EXTRACT
    get NAMESZ byte
    getdstring NAME NAMESZ
    get FOLDERS short
    get FILES short

    string PATH += NAME
    string PATH += /
    for i = 0 < FOLDERS
        callfunction EXTRACT
    next i

    for i = 0 < FILES
        get NAMESZ byte
        getdstring NAME NAMESZ
        get OFFSET long
        get ZSIZE long
        get SIZE long
        get ZIP byte
        set FNAME string PATH
        string FNAME += NAME
        if ZIP == 0
            log FNAME OFFSET SIZE
        else
            clog FNAME OFFSET ZSIZE SIZE
        endif
    next i
endfunction


Source: http://aluigi.altervista.org/quickbms.htm
Script:
quickbmsver 0.3.15
get NAMESZ long
getdstring NAME NAMESZ
savepos OFFSET
get SIZE asize
math SIZE -= OFFSET
log MEMORY_FILE OFFSET SIZE

putvarchr MEMORY_FILE2 SIZE 0
log MEMORY_FILE2 0 SIZE MEMORY_FILE # for the remaining bytes

math e470 = 0
math e45c = SIZE
math e45c v= 2
for e46c = 0 < e45c
    for e468 = 0 < e45c
        math eax = e468
        math eax *= e45c
        math eax += e46c
        getvarchr BYTE MEMORY_FILE eax
        putvarchr MEMORY_FILE2 e470 BYTE
        math e470 += 1
    next e468
next e46c

goto 0 MEMORY_FILE2
get FILES long MEMORY_FILE2
for i = 0 < FILES
    get IDX long MEMORY_FILE2
    putarray 0 i IDX
next i

get FILES long MEMORY_FILE2
for i = 0 < FILES
    get OFFSET long MEMORY_FILE2
    putarray 1 i OFFSET
next i

get FILES long MEMORY_FILE2
for i = 0 < FILES
    get SIZE long MEMORY_FILE2
    putarray 2 i SIZE
next i

get FILES long MEMORY_FILE2
for i = 0 < FILES
    get TYPE long MEMORY_FILE2
    putarray 3 i TYPE
next i
savepos BASE_OFF MEMORY_FILE2

for i = 0 < FILES
    getarray IDX 0 i
    getarray OFFSET 1 IDX
    getarray SIZE 2 IDX
    getarray TYPE 3 IDX
    math OFFSET += BASE_OFF
    set NAME string IDX
    if TYPE == 1061
        string NAME += ".jpg"
    elif TYPE == 1066
        string NAME += ".png"
    elif TYPE == -1
        string NAME += ".xa3"
    else
        string NAME += ".dat"
    endif
    log NAME OFFSET SIZE MEMORY_FILE2
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "[ GEAR BigFile ]"
get DUMMY long
get DUMMY long
get FILES long
get DUMMY long

savepos OFFSET_OFF
for i = 0 < FILES
    get DUMMY long
    get DUMMY long
next i

savepos SIZE_OFF
for i = 0 < FILES
    get DUMMY long
next i

savepos CRC_OFF         # crc of the filenames?
for i = 0 < FILES
    get DUMMY long
next i

savepos DUMMY_OFF
for i = 0 < FILES
    get DUMMY string    # or byte?
next i

for i = 0 < FILES
    goto OFFSET_OFF
    get OFFSET long
    get OFFSET64 long
    savepos OFFSET_OFF

    goto SIZE_OFF
    get SIZE long
    savepos SIZE_OFF

    goto CRC_OFF
    get CRC long
    savepos CRC_OFF

    log "" OFFSET SIZE # or sequential names: log "" OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get OFFSET asize
math OFFSET -= 0x100
goto OFFSET
findloc OFFSET string "\xff\xd9\x03\x04"
goto OFFSET
get SIGN long
get FILES short
get SIZE long
get OFFSET2 long

math OFFSET = 0
for i = 0 < FILES
    goto OFFSET
    get SIGN short
    if SIGN != 0xd8ff
        print "invalid signature at offset %OFFSET%"
        cleanexit
    endif
    get TYPE short
    get ver             short
    get flag            short
    get method          short
    get modtime         short
    get moddate         short
    get crc             long
    get name_len        short
    getdstring name     name_len
    savepos OFFSET

    goto OFFSET2
    get SIGN short
    if SIGN != 0xd8ff
        print "invalid signature at offset %OFFSET%"
        cleanexit
    endif
    get TYPE short
    get ver_made        short
    get ver_need        short
    get flag            short
    get method          short
    get modtime         short
    get moddate         short
    get crc             long
    get name_len        short
    get CHUNKS          long
    getdstring name     name_len

    math TMP = CHUNKS
    math TMP *= 16384
    putvarchr MEMORY_FILE TMP 0
    log MEMORY_FILE 0 0

    append
    for j = 0 < CHUNKS
        get uncomp_size     long
        get comp_size       long
        get ext_attr        long

        if method == 0
            log MEMORY_FILE OFFSET uncomp_size
        else
            clog MEMORY_FILE OFFSET comp_size uncomp_size
        endif
        math OFFSET += comp_size
    next j
    append
    savepos OFFSET2

    get SIZE asize MEMORY_FILE
    log name 0 SIZE MEMORY_FILE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
idstring "KAPL"
get VERSION long
get TABLE_OFF long
get INFO_OFF long
get NAME_OFF long
get FILE_OFF long
get TABLE_SIZE long
get INFO_SIZE long
get NAME_SIZE long
get FILE_SIZE long
get PAK_SIZE long
get DUMMY long

log MEMORY_FILE NAME_OFF NAME_SIZE
comtype deflate
set FILES long INFO_SIZE
math FILES /= 32
goto INFO_OFF

math XNAMEOFF = 0
for i = 0 < FILES
    get OFFSET long
    math OFFSET += FILE_OFF
    get NAMEOFF long
    get ZSIZE long
    get SIZE long
    get TYPE long

    goto XNAMEOFF MEMORY_FILE
    get NAME string MEMORY_FILE
    savepos XNAMEOFF MEMORY_FILE

    if TYPE == 0
        log NAME OFFSET SIZE
    else
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
open FDDE "tbl"
open FDDE "cdp" 1
get FILES asize
math FILES /= 8
for i = 0 < FILES
    get OFFSET long
    get SIZE long
    math OFFSET *= 0x800
    log "" OFFSET SIZE
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
get DAT_SIZE asize
for OFFSET = 0 < DAT_SIZE
    get NAMESZ long
    if NAMESZ == 0
        cleanexit
    endif
    getdstring NAME NAMESZ
    get SIZE long
    savepos OFFSET
    log NAME OFFSET SIZE
    math SIZE += 20
    math OFFSET += SIZE
    goto OFFSET
next


Source: http://aluigi.altervista.org/quickbms.htm
Script:
getdstring SIGN 4
if SIGN == "dat2"
    get DUMMY short
    get DUMMY short
    get DUMMY long
    get FILES long
    get NAMES_SIZE long
    savepos TMP
    math NAMES_OFF = FILES
    math NAMES_OFF *= 0x10
    math NAMES_OFF += TMP
    log MEMORY_FILE NAMES_OFF NAMES_SIZE
    for i = 0 < FILES
        get OFFSET long
        get ZSIZE long
        get SIZE long
        get NAME_OFF long
        goto NAME_OFF MEMORY_FILE
        get NAME string MEMORY_FILE
        clog NAME OFFSET ZSIZE SIZE
    next i
else
    print "only dat2 is supported by this script"
    cleanexit

    # type1 0x13 / type2 0x0a only supported
    goto 0
    get TYPE1 short
    get TYPE2 short
    get DUMMY byte
    get DAT_SIZE asize
    for
        savepos TMP
        if TMP >= DAT_SIZE
            cleanexit
        endif
        get NAMESZ long
        getdstring NAME NAMESZ
        get SIZE long
        savepos OFFSET
        log NAME OFFSET SIZE
        math OFFSET += SIZE
        goto OFFSET
        get DUMMY long
        get DUMMY long
        get DUMMY long
        get DUMMY long
        get DUMMY long
    next
endif


Script:
ImpType SFileSize ;
Do ;
GetDString FNAME 13 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
If FSIZE = 0 ;
CleanExit ;
EndIf ;
SavePos FOFFSET 0 ;
Log FNAME FOFFSET FSIZE 0 FSIZEX ;
Math FOFFSET += FSIZE ;
GoTo FOFFSET 0 ;
While NotEOF <> 0 ;


Script:
IDString 0 TLCF ;
SavePos FILESTART 0 ;
Math FILESTART += 4 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 32 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Long 0 ;
SavePos FILEOFF 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
SavePos FILESTART 0 ;
While NotEOF <> 0 ;


Script:
ImpType SFileSize ;
Get FILENUM Long 0 ;
Get DATASIZE Long 0 ;
SavePos DIRSTART 0 ;
Set FDIRSTRT Long FILENUM ;
Math FDIRSTRT *= 8 ;
Math FDIRSTRT += 16 ;
GoTo EOF 0 ;
SavePos DATASTRT 0 ;
Math DATASTRT -= DATASIZE ;
Math DATASTRT += 1 ;
GoTo DIRSTART 0 ;
For X = 1 To FILENUM ;
Get FOFFSET Long 0 ;
Math FOFFSET += DATASTRT ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
SavePos NEXTFILE 0 ;
GoTo FDIRSTRT 0 ;
Get FNAME String 0 ;
SavePos FDIRSTRT 0 ;
Log FNAME FOFFSET FSIZE 0 FSIZEX ;
GoTo NEXTFILE 0 ;
Next X ;


Script:
IDString 0 cgds ;
Get FNum Long 0 ;
Math FNum -= 1 ;
For T = 1 To FNum ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos ST 0 ;
Get FS Long 0 ;
Math FS -= FO ;
Log "" FO FS FOO 0 ;
GoTo ST 0 ;
Next T ;


Script:
IDString 0 AFS ;
ImpType Standard ;
Get D Byte 0 ;
Get FileNum Long 0 ;
For T = 1 To FileNum ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log "" FO FS FOO FSO ;
Next T ;


Script:
Get FC Int 0 ;
Set FS Long 0 ;
Set M Long FC ;
Math M -= 1 ;
Math M *= 14 ;
Math M += 2 ;
GoTo M 0 ;
Get D Int 0 ;
Get FO Long 0 ;
Get FSI Long 0 ;
Get DD Long 0 ;
Set S Long 0 ;
GoTo S 0 ;
Set TO Long FO ;
Math TO += FSI ;
Get D Int 0 ;
For T = 1 To FC ;
Get D Int 0 ;
Get FO Long 0 ;
Get FSI Long 0 ;
Get DD Long 0 ;
SavePos S 0 ;
GoTo TO 0 ;
GetDString FN 15 0 ;
SavePos TO 0 ;
Log FN FO FSI 0 0 ;
GoTo S 0 ;
Next T ;


Script:
ImpType Standard ;
Get U1 Long 0 ;
Get FileNum Long 0 ;
Get Dir2Size Long 0 ;
Get U2 Long 0 ;
For T = 1 To FileNum ;
SavePos FOO 0 ;
Get FO Long 0 ;
Get OffDir2 Long 0 ;
SavePos FSO 0 ;
Get ComSize Long 0 ;
Get UnComSize Long 0 ;
Log "" FO ComSize FOO FSO ;
Next T ;


Script:
ImpType Standard ;
Get FC Long 0 ;
For T = 1 To FC ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
GetDString FN 80 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
IDString 0 VOLT ;
Get VN Long 0 ;
Get FN Long 0 ;
Get HS Long 0 ;
SavePos ST 0 ;
Set J Long 12 ;
Math J *= FN ;
Math ST += J ;
GoTo ST 0 ;
For T = 1 To FN ;
SavePos FOO 0 ;
Get FO Long 0 ;
Get D Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get D Long 0 ;
Get FNA String 0 ;
Log FNA FO FS FOO FSO ;
Next T ;


Script:
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
Set DUMMYL Long 65 ;
Set TAILOFF Long DUMMYL ;
Math TAILOFF *= 4 ;
Do ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
Get FILENAME String 0 ;
Math FILESTART += TAILOFF ;
GoTo FILEOFF 0 ;
Get DUMMYL Long 0 ;
Get FILESIZE Long 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT = FILECNTL ;


Script:
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
Set DUMMYL Long 65 ;
Set TAILOFF Long DUMMYL ;
Math TAILOFF *= 4 ;
Math TAILOFF -= 4 ;
Do ;
GoTo FILESTART 0 ;
Get FILENAME String 0 ;
Math FILESTART += TAILOFF ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
IDString 0 GABA ;
ImpType Standard ;
GoTo 8 0 ;
Get Filenumber Long 0 ;
Set Start Long 16 ;
For Count = 1 To Filenumber ;
GoTo Start 0 ;
Get Filename String 0 ;
Math Start += 32 ;
GoTo Start 0 ;
SavePos FileOffOff 0 ;
Get FileOff Long 0 ;
SavePos FileSizeOff 0 ;
Get FileSize Long 0 ;
Math Start += 32 ;
Log Filename FileOff FileSize FileOffOff FileSizeOff ;
Next Count ;


Script:
ImpType StandardTail ;
Set S Long 12 ;
GoTo S 0 ;
Get FC Long 0 ;
Get FTSize Long 0 ;
SavePos TailOffOff 0 ;
Get TO Long 0 ;
Set FJ Long 4 ;
Math FJ *= FC ;
GoTo TO 0 ;
For TE = 1 To FC ;
Get FE Long 0 ;
Math FE += TO ;
Math FE += FJ ;
SavePos CB 0 ;
GoTo FE 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos TP 0 ;
Math TP += 12 ;
GoTo TP 0 ;
Get FN String 0 ;
Log FN FO FS FOO FSO ;
GoTo CB 0 ;
Next TE ;


Script:
Get ST Long 0 ;
Set STE Long ST ;
Math STE += 4 ;
For T = 0 To ST ;
Get DOff Long 0 ;
SavePos OffOff 0 ;
Get Off Long 0 ;
Math Off += STE ;
SavePos SizeOff 0 ;
Get Size Long 0 ;
Get D Long 0 ;
Get BS Long 0 ;
GetDString FN BS 0 ;
Log FN Off Size OffOff SizeOff ;
Math T -= 1 ;
Math T += 20 ;
Math T += BS ;
Next T ;


Script:
ImpType SFileSize ;
Get FILENUM Long 0 ;
Get DATASTRT Long 0 ;
Get FOOBAR Long 0 ;
For X = 1 To FILENUM ;
GetDString FNAME 16 0 ;
Get FOFFSET Long 0 ;
Math FOFFSET += DATASTRT ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FNAME FOFFSET FSIZE 0 FSIZEX ;
Next X ;


Script:
IDString 0 BIFFV1 ;
Get DUMMYL Int 0 ;
SavePos FILESTART 0 ;
Get FILECNTL Long 0 ;
Math FILESTART += 16 ;
Do ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
Math FILESTART += 16 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType Standard ;
IDString 0 BIGF ;
Get D Long 0 ;
Get FC Long 0 ;
ReverseLong FC ;
Get D Long 0 ;
SavePos FS 0 ;
For T = 1 To FC ;
GoTo FS 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
ReverseLong FO ;
SavePos FSO 0 ;
Get FSI Long 0 ;
ReverseLong FSI ;
Get FN String 0 ;
SavePos FS 0 ;
Log FN FO FSI FOO FSO ;
Next T ;


Script:
Get FILESTART Long 0 ;
Get FILEJMP Long 0 ;
Set FILECNTL Long FILEJMP ;
Math FILECNTL /= 32 ;
Do ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
GetDString FILENAME 16 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Set FILESTART Long 9 ;
Do ;
GoTo FILESTART 0 ;
Get DUMMYL Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILEOFF 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
SavePos FILESTART 0 ;
While NotEOF <> 0 ;


Script:
ImpType Standard ;
Get VarType Long 0 ;
Get RemainingSize Long 0 ;
Get U1 Long 0 ;
Get RelOff1 Long 0 ;
SavePos COff 0 ;
Math COff += RelOff1 ;
GoTo COff 0 ;
Get VarType Long 0 ;
Get ResInfoSize Long 0 ;
Get VarType Long 0 ;
Get HeaderSize Long 0 ;
SavePos COff 0 ;
Get U2 Long 0 ;
GetDString BINName 28 0 ;
GetDString OriName 64 0 ;
Set FP String . ;
Get OriSize Long 0 ;
Math COff += HeaderSize ;
GoTo COff 0 ;
Get VarType Long 0 ;
Get TableSize Long 0 ;
SavePos COff 0 ;
Math COff += TableSize ;
GoTo COff 0 ;
Get VarType Long 0 ;
Get ResInfoSize Long 0 ;
Set FileNum Long ResInfoSize ;
Math FileNum /= 24 ;
For T = 1 To FileNum ;
Get VarType Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get UCS Long 0 ;
Get U3 Long 0 ;
Get U4 Long 0 ;
Set Name String OriName ;
String Name += FP ;
String Name += T ;
Log Name FO FS FOO FSO ;
Next T ;


Script:
Get S ASize 0 ;
For T = 1 To S ;
FindLoc B String RIFF 0 ;
GoTo B 0 ;
Get D Long 0 ;
Get FSI Long 0 ;
Math FSI += 8 ;
Set T Long B ;
Math T += FSI ;
Log "" B FSI 0 0 ;
Next T ;


Script:
ImpType Standard ;
Get FILENUM Long 0 ;
For X = 1 To FILENUM ;
GetDString FNAME 36 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next X ;


Script:
GoTo EOF 0 ;
SavePos TOFF 0 ;
Set TEMP Long TOFF ;
Math TEMP -= 3 ;
GoTo TEMP 0 ;
Get FILENUM Long 0 ;
Set FILENUMX Long FILENUM ;
Math FILENUMX *= 48 ;
Math FILENUMX += 17 ;
Set TEMP Long TOFF ;
Math TEMP -= FILENUMX ;
GoTo TEMP 0 ;
For X = 1 To FILENUM ;
GetDString FNAME 32 0 ;
Get TEMP Long 0 ;
Set FOFFSET Long TOFF ;
Math FOFFSET -= TEMP ;
Math FOFFSET += 1 ;
Get FSIZE Long 0 ;
Get FOOBAR Long 0 ;
Get FOOBAR Long 0 ;
Log FNAME FOFFSET FSIZE 0 0 ;
Next X ;


Script:
quickbmsver 0.4.5
getdstring SIGN 4
if SIGN != "FPMF"
    print "you must use this script only with the files having the HED extension (FPMF archives) because QuickBMS will extract all the files inside the 0000.dat files automatically!"
    cleanexit
endif
get DUMMY short
get DUMMY short
get DATA_SIZE long
get DUMMY long

savepos OFFSET
get DUMMY byte  # this is the key but at the moment I don't have the game to reverse the key generation algorithm
get ZERO short
if ZERO == 0x16f6
    encryption rot "\x0B\xF6\x16\xB7\x6D\x61\x21\x40\x75\x76\x15\x27\x88\xF1\x59\xAB\x88\xE7\xF1\xDA\x0F\x8B\x50\x6A\xB1\xBD\x24\xB0\x73\xC6\x04\xFC\x43\x09\xB3\xCD\xEB\xC7\xB1\x66\x96\x8A\xC0\x13\xC8\xA0\x56\xD0\x65\x55\x4F\x0A\xB2\x69\x9C\x97\x31\x06\x12\x8A\x0F\xBF\x0F\x40" "" 1
elif ZERO == 0x84d4
    encryption rot "\x5f\xd4\x84\xe0\xc1\x5c\x0c\x3d\xed\x9b\xf6\x08\x79\x36\x01\x3d\x34\x40\x78\x3a\xce\xb1\x00\xa8\xe2\x08\x79\xb8\x75\x8b\x10\x18\x0e\xa0\xd9\xd5\x4d\x8f\x60\x58\xd1\xae\x9a\x34\xef\xd6\xa0\xe3\xe6\x15\x04\x7c\xa5\xae\xce\x60\xd4\x4e\xff\x1d\x3c\x56\x3c\xfa" "" 1
else
    print "unknown key (%ZERO%), contact me"
    cleanexit
endif
log MEMORY_FILE OFFSET DATA_SIZE
encryption "" ""

get DUMMY long MEMORY_FILE
get DUMMY long MEMORY_FILE
get NAMESZ byte MEMORY_FILE
math NAMESZ *= 2
getdstring NAME NAMESZ MEMORY_FILE
set BASE_NAME unicode NAME
get DUMMY long MEMORY_FILE
get DUMMY long MEMORY_FILE
get DUMMY long MEMORY_FILE
get DUMMY long MEMORY_FILE
get KEY_SIZE long MEMORY_FILE
getdstring KEY KEY_SIZE MEMORY_FILE
get DUMMY long MEMORY_FILE
get DUMMY long MEMORY_FILE
get FILES long MEMORY_FILE

math PREV_PACKNUM = -1
for i = 0 < FILES
    get FOLDERSZ byte MEMORY_FILE
    math FOLDERSZ *= 2
    getdstring FOLDER FOLDERSZ MEMORY_FILE
    set FOLDER unicode FOLDER

    get NAMESZ byte MEMORY_FILE
    math NAMESZ *= 2
    getdstring NAME NAMESZ MEMORY_FILE
    set NAME unicode NAME

    get PACKNUM long MEMORY_FILE
    get OFFSET long MEMORY_FILE
    get SIZE long MEMORY_FILE
    get CRC long MEMORY_FILE
    get ZERO long MEMORY_FILE

    if PACKNUM != PREV_PACKNUM
        string TMP printf BASE_NAME PACKNUM
        open FDSE TMP 1
        math PREV_PACKNUM = PACKNUM
    endif

    set FULLNAME string FOLDER
    string FULLNAME += NAME
    encryption rot KEY "" 1 KEY_SIZE
    log FULLNAME OFFSET SIZE 1
    encryption "" ""
next i


Script:
comtype deflate
getdstring SIGN 4
if SIGN == "LTAR"
elif SIGN == "RATL"
    set SIGN string "LTAR"
    endian big
elif SIGN == "LTAX"
    comtype xmemdecompress
elif SIGN == "XATL"
    comtype xmemdecompress
    set SIGN string "LTAX"
    endian big
else
    cleanexit
endif
get VERSION long

# it's possible to make the check on the version or using this solution
savepos TMP
get FULL_SIZE asize
get DUMMY1 long
get DUMMY2 long
math AUTOGUESS = 0
if DUMMY1 u> FULL_SIZE
    math AUTOGUESS = 1
endif
if DUMMY2 u> FULL_SIZE
    math AUTOGUESS = 1
endif
goto TMP
if AUTOGUESS == 0
    get NAMESSZ long
    get FOLDERS long
    get FILES long
    get DUMMY long      # 1
    get DUMMY long      # 0
    get DUMMY long      # 0
    getdstring HASH 16
else
    getdstring HASH 16
    get DUMMY long      # 1
    get DUMMY long      # 0
    get DUMMY long      # 0
    get FILES long
    get FOLDERS long
    get NAMESSZ long
endif

savepos OFFSET
log MEMORY_FILE OFFSET NAMESSZ

math OFFSET += NAMESSZ
set FILESSZ long FILES
math FILESSZ *= 32
log MEMORY_FILE2 OFFSET FILESSZ

math OFFSET += FILESSZ
set FOLDERSSZ long FOLDERS
math FOLDERSSZ *= 16
log MEMORY_FILE3 OFFSET FOLDERSSZ

set FOLDER string ""
callfunction EXTRACT

startfunction EXTRACT
    savepos CURR_OFF MEMORY_FILE3
    if CURR_OFF >= FOLDERSSZ
        cleanexit
    endif
    get NAME_OFF long MEMORY_FILE3
    get SUB_FOLDERS long MEMORY_FILE3
    get NEXT_FOLDERS long MEMORY_FILE3
    get NUM_FILES long MEMORY_FILE3

    goto NAME_OFF MEMORY_FILE
    get NAME string MEMORY_FILE

    # don't have the minimal idea if it's correct, it's an update of the old script
    if AUTOGUESS == 0
        string FOLDER = NAME
    else
        string FOLDER += NAME
    endif
    string FOLDER += /

    for i = 0 < NUM_FILES
        savepos CURR_OFF MEMORY_FILE2
        if CURR_OFF >= FILESSZ
            cleanexit
        endif
        get NAME_OFF long MEMORY_FILE2
        get OFFSET  longlong MEMORY_FILE2
        get ZSIZE   longlong MEMORY_FILE2
        get SIZE    longlong MEMORY_FILE2
        get ZIP     long MEMORY_FILE2

        goto NAME_OFF MEMORY_FILE
        get NAME string MEMORY_FILE

        if FOLDER != "CRC/" # they are not files
            set FNAME string FOLDER
            string FNAME += NAME
            if ZIP == 0
                log FNAME OFFSET SIZE
            else
                # compression 9, it's the same for both zlib and xmem
                callfunction ZIP_DUMP 1 # 1 only for being faster
            endif
        endif
    next i

    for i = 0 < SUB_FOLDERS
        callfunction EXTRACT
    next i

    set FOLDER string ""
    for i = 0 < NEXT_FOLDERS
        callfunction EXTRACT
    next i
endfunction

startfunction ZIP_DUMP
    putvarchr MEMORY_FILE4 SIZE 0
    log MEMORY_FILE4 0 0
    math LIMIT = OFFSET
    math LIMIT += ZSIZE
    append
    for OFFSET = OFFSET < LIMIT
        goto OFFSET
        math CHUNK_PACKED = 1
        get CHUNK_ZSIZE long
        if SIGN == "LTAR"
            get CHUNK_SIZE long
            savepos OFFSET
            if CHUNK_ZSIZE == CHUNK_SIZE
                math CHUNK_PACKED = 0
            endif
        else    # "LTAX"
            math CHUNK_SIZE = 0x10000
            savepos OFFSET
            if CHUNK_ZSIZE & 0x80000000 #0xf0000000
                math CHUNK_PACKED = 0
                math CHUNK_ZSIZE &= 0x0fffffff
            endif
        endif
        if CHUNK_PACKED == 0
            log MEMORY_FILE4 OFFSET CHUNK_ZSIZE
        else
            clog MEMORY_FILE4 OFFSET CHUNK_ZSIZE CHUNK_SIZE
        endif
        math OFFSET += CHUNK_ZSIZE
        math OFFSET x= 4
    next
    append
    get SIZE asize MEMORY_FILE4
    log FNAME 0 SIZE MEMORY_FILE4
endfunction


Script:
IDString 0 LEMBOX ;
Get FILECNTL Long 0 ;
Get DUMMYL Long 0 ;
Set TAILSIZEB Long 0 ;
Set DUMMYL Long FILECNTL ;
Math DUMMYL *= 4 ;
SavePos FILESTART 0 ;
Set TAILOFF Long 0 ;
Do ;
Get FILEOFF Long 0 ;
GetDString FILENAME FILEOFF 0 ;
Math TAILOFF += 1 ;
While FILECNTL <> TAILOFF ;
SavePos FILEJMP 0 ;
Math FILEJMP += 4 ;
Math DUMMYL += FILEJMP ;
Math DUMMYL += 4 ;
Do ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
GetDString FILENAME FILEOFF 0 ;
SavePos FILESTART 0 ;
GoTo FILEJMP 0 ;
Get FILEOFF Long 0 ;
SavePos FILEJMP 0 ;
GoTo DUMMYL 0 ;
Get FILESIZE Long 0 ;
SavePos DUMMYL 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;
Set BytesRead Long 0 ;
Do ;
GoTo DUMMYL 0 ;
GetDString FILENAME 56 0 ;
Set WHATEVER1 Long 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
SavePos DUMMYL 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While BytesRead <> TAILSIZEB ;


Script:
Get FC Int 0 ;
SavePos FS 0 ;
GoTo EOF 0 ;
SavePos TO 0 ;
Set D Long FC ;
Math D *= 18 ;
Math TO -= D ;
Math TO += 1 ;
For T = 1 To FC ;
Set FO Long FS ;
GoTo TO 0 ;
GetDString FN 14 0 ;
Get FSI Long 0 ;
SavePos TO 0 ;
Log FN FO FSI 0 0 ;
Math FS += FSI ;
Next T ;


Script:
ImpType Standard ;
ComType ZLib1 ;
GoTo 8 0 ;
Get FNum Long 0 ;
GoTo 24 0 ;
Set FNDir Long 24 ;
GoTo 306 0 ;
Math FNDir *= FNum ;
Math FNDir += 306 ;
For n = 1 To FNum ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos DFSO 0 ;
Get DFS Long 0 ;
SavePos NextJump 0 ;
Math NextJump += 12 ;
GoTo FNDir 0 ;
Get FN String 0 ;
SavePos FNDir 0 ;
GoTo NextJump 0 ;
CLog FN FO FS FOO FSO DFS DFSO ;
Next n ;


Script:
GoTo 32 0 ;
Get numAnim Long 0 ;
Get numSound Long 0 ;
Get numPoint Long 0 ;
Get numTri Long 0 ;
Get picSize Long 0 ;
For nT = 1 To numTri ;
SavePos FOT 0 ;
Set FST Long 64 ;
Log "" FOT FST 0 0 ;
Math FOT += FST ;
GoTo FOT 0 ;
Next nT ;
For nP = 1 To numPoint ;
SavePos FOP 0 ;
Set FSP Long 16 ;
Log "" FOP FSP 0 0 ;
Math FOP += FSP ;
GoTo FOP 0 ;
Next nP ;
SavePos FO 0 ;
Log "" FO picSize 0 0 ;
Math FO += picSize ;
GoTo FO 0 ;
For nA = 1 To numAnim ;
SavePos FOA 0 ;
SavePos JPA 0 ;
Get FNA String 0 ;
Math JPA += 36 ;
GoTo JPA 0 ;
Get JPA2 Long 0 ;
Math JPA2 *= numPoint ;
Math JPA2 *= 6 ;
Set FSA Long 40 ;
Math FSA += JPA2 ;
Log FN FOA FSA 0 0 ;
Math FOA += FSA ;
GoTo FOA 0 ;
Next nA ;
For nS = 1 To numSound ;
SavePos FOS 0 ;
SavePos JPS 0 ;
Get FNS String 0 ;
Math JPS += 32 ;
GoTo JPS 0 ;
Get JPS2 Long 0 ;
Set FSS Long 36 ;
Math FSS += JPS2 ;
Log FN FOS FSS 0 0 ;
Math FOS += FSS ;
GoTo FOS 0 ;
Next nS ;


Script:
Get FILENUM Long 0 ;
GoTo EOF 0 ;
SavePos EOFX 0 ;
Math EOFX -= 3 ;
GoTo EOFX 0 ;
Get FOOTER Long 0 ;
If FOOTER <> 1263419714 ;
CleanExit ;
EndIf ;
Set CRAP String ? ;
Math FILENUM /= 8 ;
GoTo SOF 0 ;
For F = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePOS FSIZEX 0 ;
Get FSIZE Long 0 ;
SavePos NEXTFILE 0 ;
GoTo FOFFSET 0 ;
Get FNSIZE Byte 0 ;
Math FOFFSET += FNSIZE ;
Math FOFFSET += 1 ;
GetDString FNAME FNSIZE 0 ;
String FNAME -= CRAP ;
SavePos TEMP 0 ;
Math TEMP += FSIZE ;
Math TEMP += 1 ;
GoTo TEMP 0 ;
Get EXTSIZE Byte 0 ;
Math EXTSIZE -= 1 ;
Do ;
Get EXTB Byte 0 ;
Math EXTSIZE -= 1 ;
While EXTB <> 46 ;
GetDString FNAMEEXT EXTSIZE 0 ;
Set DOT String . ;
String FNAME += DOT ;
String FNAME += FNAMEEXT ;
Log FNAME FOFFSET FSIZE 0 0 ;
GoTo NEXTFILE 0 ;
Next F ;


Script:
ImpType Standard ;
Get FN Long 0 ;
For T = 1 To FN ;
Get FID Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log "" FO FS FOO FSO ;
Next T ;


Script:
ImpType SFileOff ;
IDString 0 CAT ;
Set TEMP Long 16 ;
GoTo TEMP 0 ;
Get FILENUM Long 0 ;
Get FOOBAR Long 0 ;
Get FOOBAR Long 0 ;
For X = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
Get FNSIZE Long 0 ;
GetDString FNAME FNSIZE 0 ;
SavePos TEMP 0 ;
If X = FILENUM ;
GoTo EOF 0 ;
SavePos FSIZE 0 ;
Math FSIZE -= FOFFSET ;
Math FSIZE += 1 ;
Else ;
Get FSIZE Long 0 ;
Math FSIZE -= FOFFSET ;
EndIf ;
Log FNAME FOFFSET FSIZE FOFFSETX 0 ;
GoTo TEMP 0 ;
Next X ;


Script:
IDString 0 AWAD ;
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
Set DUMMYL Long 65 ;
Set TAILOFF Long DUMMYL ;
Math TAILOFF *= 4 ;
Do ;
Math FILESTART += 1 ;
GoTo FILESTART 0 ;
Get FILENAME String 0 ;
Math FILESTART += TAILOFF ;
Math FILESTART -= 1 ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType SFileOff ;
Get FILENUM Long 0 ;
Get ARCSIZE Long 0 ;
For F = 1 To FILENUM ;
GetDString FNAME 52 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos TEMP 0 ;
If F = FILENUM ;
Set FSIZE Long ARCSIZE ;
Math FSIZE -= FOFFSET ;
Else ;
GetDString FOOBAR 52 0 ;
Get FSIZE Long 0 ;
Math FSIZE -= FOFFSET ;
EndIf ;
Log FNAME FOFFSET FSIZE FOFFSETX 0 ;
GoTo TEMP 0 ;
Next F ;


Script:
IDString 0 COMPCNT4 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
CleanExit ;
SavePos DUMMYL 0 ;
Do ;
GoTo DUMMYL 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Int 0 ;
GetDString FILENAME DUMMYL 0 ;
SavePos DUMMYL 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Set DUMMYL Long 50 ;
Get FILECNTL Long 0 ;
Set DUMMYL Long DUMMYL ;
Math DUMMYL *= FILECNTL ;
SavePos FILESTART 0 ;
SavePos TAILSIZEU 0 ;
Math TAILSIZEU += DUMMYL ;
Math FILECNTL -= 1 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 50 0 ;
SavePos FILESTART 0 ;
GoTo TAILSIZEU 0 ;
Get FILEOFF Long 0 ;
SavePos TAILSIZEU 0 ;
Get FILESIZE Long 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;
GoTo FILESTART 0 ;
GetDString FILENAME 50 0 ;
SavePos FILESTART 0 ;
GoTo TAILSIZEU 0 ;
Get FILEOFF Long 0 ;
GoTo EOF 0 ;
SavePos FILESIZE 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;


Script:
ImpType Standard ;
IDString 0 ASCARON_ARCHIVE ;
Set D Long 40 ;
GoTo D 0 ;
Get FC Long 0 ;
Get S Long 0 ;
For T = 1 To FC ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get S Long 0 ;
Get FN String 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
IDString 0 GEEK ;
Set FOOBAR Long 16 ;
GoTo FOOBAR 0 ;
Get FILENUM Long 0 ;
For X = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
GetDString FNAME 128 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next X ;


Script:
ImpType SFileSize ;
IDString 0 XFIR ;
Get ARCSIZE Long 0 ;
Get TEMP Long 0 ;
Set FNTITLE String File_ ;
Set FNID String 1 ;
Set FNDOT String . ;
Set FNREMOVE String * ;
Do ;
GetDString FNEXT 4 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
If FSIZE = 0 ;
CleanExit ;
EndIf ;
SavePos FOFFSET 0 ;
Math FNID += 1 ;
Set FNAME String FNTITLE ;
String FNAME += FNID ;
String FNAME += FNDOT ;
String FNAME += FNEXT ;
String FNAME -= FNREMOVE ;
Log FNAME FOFFSET FSIZE 0 FSIZEX ;
Math FOFFSET += FSIZE ;
GoTo FOFFSET 0 ;
While NotEOF <> 0 ;


Script:
IDString 0 PKR3 ;
ImpType StandardTail ;
SavePos TailOffOff 0 ;
Get TAILOFF Long 0 ;
Math TAILOFF += 8 ;
GoTo TAILOFF 0 ;
Get FILENUM Long 0 ;
SavePos TEMP 0 ;
Math TEMP += 136 ;
GoTo TEMP 0 ;
SavePos TEMP 0 ;
For X = 1 To FILENUM ;
GoTo TEMP 0 ;
GetDString FNAME 128 0 ;
Get FOOBAR Long 0 ;
Get FOOBAR Long 0 ;
SavePos FOFFSETO 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEO 0 ;
Get FSIZE Long 0 ;
Get FOOBAR Long 0 ;
SavePos TEMP 0 ;
Log FNAME FOFFSET FSIZE FOFFSETO FSIZEO ;
Next X ;


Script:
Set FILESTART Long 32 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 6 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
GetDString FILENAME 6 0 ;
Get FILESIZE Long 0 ;
ReverseLong FILEOFF ;
ReverseLong FILESIZE ;
If FILESIZE = 0 ;
CleanExit ;
EndIf ;
Math FILESIZE -= FILEOFF ;
Log "" FILEOFF FILESIZE 0 0 ;
While NotEOF <> 0 ;


Script:
Get FILECNTL Int 0 ;
Do ;
GetDString FILENAME 14 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
GoTo FILEOFF 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
GoTo FILESTART 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Get FILECNTL Long 0 ;
SavePos FILEJMP 0 ;
SavePos FILESTART 0 ;
GoTo EOF 0 ;
SavePos TAILOFF 0 ;
Set DUMMYL Long FILECNTL ;
Math DUMMYL *= 36 ;
Math DUMMYL += 4 ;
Math FILECNTL -= 1 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 32 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
Set FILEJMP Long FILESTART ;
Math FILEJMP += 32 ;
GoTo FILEJMP 0 ;
Get FILESIZE Long 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;
GoTo FILESTART 0 ;
GetDString FILENAME 32 0 ;
Get FILEOFF Long 0 ;
Set FILESIZE Long TAILOFF ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;


Script:
ComType ZLib1 ;
GoTo EOF 0 ;
SavePos END 0 ;
Math END -= 3 ;
GoTo END 0 ;
Get TS Long 0 ;
Set ST Long END ;
Math ST -= TS ;
Math ST += 4 ;
Math END -= 4 ;
GoTo END 0 ;
Get FC Long 0 ;
GoTo ST 0 ;
For T = 1 To FC ;
Get FN String 0 ;
Get OFF Long 0 ;
Get COM Long 0 ;
Get PSize Long 0 ;
Get OSize Long 0 ;
Get DL Long 0 ;
CLog FN OFF PSize 0 0 OSize 0 ;
Next T ;


Script:
Get FC Long 0 ;
SavePos CP 0 ;
Math CP += 12 ;
Math FC -= 1 ;
GoTo CP 0 ;
For T = 1 To FC ;
SavePos FOO 0 ;
GetDString FN 8 0 ;
Get FO Long 0 ;
Get DUM Long 0 ;
SavePos CP 0 ;
GetDString FD 8 0 ;
Get FS Long 0 ;
Math FS -= FO ;
Log FN FO FS FOO 0 ;
GoTo CP 0 ;
Next T ;
GoTo EOF 0 ;
SavePos FS 0 ;
GoTo CP 0 ;
GetDString FN 8 0 ;
Get FO Long 0 ;
Get DUM Long 0 ;
Math FS -= FO ;
Log FN FO FS FOO 0 ;


Script:
SavePos ST 0 ;
Get FNum Long 0 ;
Math FNum /= 4 ;
Math FNum -= 1 ;
For T = 1 To FNum ;
GoTo ST 0 ;
Get FO Long 0 ;
SavePos ST 0 ;
Get FS Long 0 ;
Math FS -= FO ;
Log "" FO FS 0 0 ;
Next T ;
GoTo ST 0 ;
Get FO Long 0 ;
GoTo EOF 0 ;
SavePos FS 0 ;
Math FS -= FO ;
Math FS += 1 ;
Log "" FO FS 0 0 ;


Script:
IDString 0 ADAT ;
ImpType Standard ;
SavePos TailOffOff 0 ;
Get TO Long 0 ;
Get TS Long 0 ;
Math TS /= 144 ;
GoTo TO 0 ;
For t = 1 To TS ;
SavePos TO 0 ;
Get FN String 0 ;
Math TO += 128 ;
GoTo TO 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Get FS Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get D Long 0 ;
Log FN FO FS FOO FSO ;
Next t ;


Script:
ImpType Standard ;
ComType ZLib1 ;
Get AS ASize 0 ;
Math AS -= 4 ;
GoTo AS 0 ;
Get TS Long 0 ;
Math AS -= TS ;
GoTo AS 0 ;
SavePos TailOffOff 0 ;
Get FSP Long 0 ;
GoTo FSP 0 ;
Get FA Long 0 ;
For TE = 1 To FA ;
Get SS Long 0 ;
Get FN String 0 ;
SavePos FSP 0 ;
Math FSP += 8 ;
GoTo FSP 0 ;
SavePos OSO 0 ;
Get OS Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
CLog FN FO FS FOO FSO OS OSO ;
Next TE ;


Script:
Get FileNum Int 0 ;
For T = 1 To FileNum ;
GetDString FN 16 0 ;
SavePos SIZEOFF 0 ;
Get SIZE Long 0 ;
SavePos OFFOFF 0 ;
Get OFF Long 0 ;
Get DUM Byte 0 ;
Log FN OFF SIZE OFFOFF SIZEOFF ;
Next T ;


Script:
Open FDDE FAT 1 ;
GetDString MW 4 1 ;
Get FN Long 1 ;
For T = 1 To FN ;
Get Off Long 1 ;
Get Size Long 1 ;
Get Hash Long 1 ;
Log "" Off Size 0 0 ;
Next T ;


Script:
IDString 0 FILECHNK ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
Get FILEJMP Long 0 ;
Set FILEJMP Long FILEJMP ;
Math FILEJMP *= 48 ;
SavePos FILESTART 0 ;
Get FILENAME String 0 ;
SavePos DUMMYL 0 ;
Math DUMMYL += 1 ;
Math DUMMYL += 10 ;
GoTo DUMMYL 0 ;
Get FILEOFF Long 0 ;
Math FILEOFF += FILEJMP ;
Do ;
GoTo FILESTART 0 ;
Get FILENAME String 0 ;
SavePos FILESTART 0 ;
Math FILESTART += 1 ;
Math FILESTART += 16 ;
Set DUMMYL Long FILEOFF ;
Math DUMMYL += 4 ;
GoTo DUMMYL 0 ;
Get FILESIZE Long 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Open FileDir sector.h 1 ;
SavePos ST 1 ;
GoTo EOF 1 ;
SavePos ED 1 ;
Math ED -= 40 ;
GoTo ST 1 ;
Do ;
SavePos PE 1 ;
Get FileName String 1 ;
Math PE += 32 ;
GoTo PE 1 ;
Get BlockOff Long 1 ;
Get Size Long 1 ;
Math BlockOff *= 2048 ;
Log FileName BlockOff Size 0 0 ;
SavePos PE 1 ;
While PE < ED ;


Script:
ImpType StandardTail ;
GoTo EOF 0 ;
SavePos TE 0 ;
Math TE -= 3 ;
GoTo TE 0 ;
Get TEND Long 0 ;
Math TE -= 52 ;
GoTo TE 0 ;
Get TS Long 0 ;
Math TEND -= TS ;
Math TEND += 32 ;
Set FN Long TS ;
Math FN /= 32 ;
Math FN -= 1 ;
GoTo TEND 0 ;
SavePos FST 0 ;
For T = 1 To FN ;
Get FNAME String 0 ;
Math FST += 18 ;
GoTo FST 0 ;
SavePos FOO 0 ;
Get FOFF Long 0 ;
Get D Long 0 ;
SavePos FSO 0 ;
Get FSIZE Long 0 ;
SavePos FST 0 ;
Math FST += 2 ;
GoTo FST 0 ;
Log FNAME FOFF FSIZE FOO FSO ;
Next T ;


Script:
ImpType SFileSize ;
GetDString MW 16 0 ;
GetDString AN 16 0 ;
Get AllData Long 0 ;
Get FileNum Long 0 ;
For T = 1 To FileNum ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos PO 0 ;
Math PO += 1 ;
GoTo PO 0 ;
GetDString FileName 259 0 ;
SavePos FO 0 ;
Log FileName FO FS 0 FSO ;
Math FO += FS ;
GoTo FO 0 ;
Next T ;


Script:
IDString 0 DPK4 ;
ComType ZLib1 ;
ImpType Standard ;
Get ASize Long 0 ;
Get HSize Long 0 ;
Get FNum Long 0 ;
For T = 1 To FNum ;
SavePos TJ 0 ;
Get ESize Long 0 ;
SavePos UCSOff 0 ;
Get UCSize Long 0 ;
SavePos CSizeOff 0 ;
Get CSize Long 0 ;
SavePos OOF 0 ;
Get Offset Long 0 ;
Get FN String 0 ;
Math TJ += ESize ;
GoTo TJ 0 ;
CLog FN Offset CSize OOF CSizeOff UCSize UCSOff ;
Next T ;


Script:
SavePos CP 0 ;
GoTo EOF 0 ;
SavePos END 0 ;
GoTo CP 0 ;
Do ;
Set Offset Long CP ;
Get Width Long 0 ;
Get Heigth Long 0 ;
Set FileSize Long Heigth ;
Math FileSize *= Width ;
Get Unknown Long 0 ;
Get NameSize Long 0 ;
Get IDName String 0 ;
Get FileName String 0 ;
Log FileName Offset FileSize 0 0 ;
Math CP += FileSize ;
GoTo CP 0 ;
While CP < END ;


Script:
IDString 0 Copyright ;
Set FILESTART Long 68 ;
GoTo FILESTART 0 ;
Get FILESTART Long 0 ;
Get FILECNTL Long 0 ;
Do ;
GoTo FILESTART 0 ;
Get DUMMYL Long 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
Log "" FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
IDString 0 Copyright ;
ImpType Standard ;
GoTo 80 0 ;
Get FS Long 0 ;
GoTo 88 0 ;
Get FIS Long 0 ;
Set FN Long FS ;
Math FN -= FIS ;
Math FN /= 12 ;
GoTo FIS 0 ;
For TE = 1 To FN ;
Get D Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log "" FO FS FOO FSO ;
Next TE ;


Script:
Set FS Long 8 ;
ImpType Standard ;
GoTo FS 0 ;
SavePos TailOffOff 0 ;
Get TAO Long 0 ;
Get FN Long 0 ;
GoTo TAO 0 ;
For A = 1 To FN ;
GetCT FIN String 10 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log FIN FO FS FOO FSO ;
Next A ;


Script:
ImpType Standard ;
GoTo 8 0 ;
Get FNum Long 0 ;
For n = 1 To FNum ;
SavePos JP 0 ;
Math JP += 64 ;
Get FN String 0 ;
GoTo JP 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log FN FO FS FOO FSO ;
Next n ;


Script:
ImpType SFileSize ;
Get FN Long 0 ;
Get U1 Long 0 ;
GetDString ID 8 0 ;
Set B Long 2048 ;
Set A Long FN ;
Math A *= 16 ;
Math A += 16 ;
Set C Long A ;
Math C /= B ;
Math C *= 2048 ;
Math C += 2048 ;
Set Off Long C ;
For T = 1 To FN ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get U2 Long 0 ;
Get ID2 Long 0 ;
Get U3 Int 0 ;
Get END Int 0 ;
Log "" Off FS 0 FSO ;
Math FS /= 2048 ;
Math FS *= 2048 ;
Math FS += 2048 ;
Math Off += FS ;
Next T ;


Script:
ImpType SFileOffset ;
Get FILENUM Long 0 ;
Math FILENUM -= 1 ;
For X = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
Get FNAMEOFF Long 0 ;
SavePos TEMP 0 ;
GoTo FNAMEOFF 0 ;
Get FNAME String 0 ;
GoTo TEMP 0 ;
Get NFOFFSET Long 0 ;
Set FSIZE Long NFOFFSET ;
Math FSIZE -= FOFFSET ;
Log FNAME FOFFSET FSIZE FOFFSETX 0 ;
GoTo TEMP 0 ;
Next X ;


Script:
Set FILESTART Long 128 ;
Do ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
If FILEOFF = 0 ;
CleanExit ;
EndIf ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While NotEOF <> 0 ;


Script:
ImpType Standard ;
IDString 0 NGS ;
Set TEMP Long 6 ;
GoTo TEMP 0 ;
Get FILENUM Int 0 ;
SavePos FRSTFILE 0 ;
GoTo EOF 0 ;
SavePos TAILOFF 0 ;
Set TEMP Long FILENUM ;
Math TEMP *= 4 ;
Math TAILOFF -= TEMP ;
Math TAILOFF += 1 ;
GoTo TAILOFF 0 ;
For X = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos NEXTFILE 0 ;
Set TEMP Long FOFFSET ;
Math TEMP -= 6 ;
GoTo TEMP 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log "" FOFFSET FSIZE FOFFSETX FSIZEX ;
GoTo NEXTFILE 0 ;
Next X ;


Script:
GoTo EOF 0 ;
SavePos END 0 ;
Math END -= 2047 ;
GoTo END 0 ;
Get DUM Long 0 ;
Get FNU Long 0 ;
Get DJ Long 0 ;
Math END -= DJ ;
Set DJJ Long 24 ;
Math DJJ *= FNU ;
Math END -= DJJ ;
GoTo END 0 ;
For T = 1 To FNU ;
GetDString DUMM 16 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log "" FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
IDString 0 GOB ;
Get FOOBAR Byte 0 ;
Get FILENUM Long 0 ;
For X = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
GetDString FNAME 260 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next X ;


Script:
ImpType SFileSize ;
IDString 0 KenSilverman ;
Get FC Long 0 ;
Set MFC Long FC ;
Math MFC *= 16 ;
Math MFC += 16 ;
SavePos FS 0 ;
For TE = 1 To FC ;
GoTo FS 0 ;
GetDString FN 12 0 ;
SavePos FSO 0 ;
Get FSI Long 0 ;
SavePos FS 0 ;
Log FN MFC FSI 0 FSO ;
Math MFC += FSI ;
Next TE ;


Script:
Get DUMMYL Long 0 ;
Get TAILOFF Long 0 ;
GoTo TAILOFF 0 ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
SavePos TAILOFF 0 ;
Do ;
GoTo TAILOFF 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILEOFF Long 0 ;
Math FILEOFF += 16 ;
SavePos TAILOFF 0 ;
Math TAILOFF += 2 ;
GoTo TAILOFF 0 ;
Get FILENAME String 0 ;
SavePos TAILOFF 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
IDString 0 APUK ;
Get FILECNTL Long 0 ;
Set FILESTART Long 32 ;
Do ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Get FILEOFF Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
GetDString FILENAME 16 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
Do ;
GoTo FILESTART 0 ;
Get DUMMYL Int 0 ;
GetDString FILENAME DUMMYL 0 ;
SavePos FILESTART 0 ;
Get FILEOFF Long 0 ;
GoTo FILESTART 0 ;
Get TAILOFF Long 0 ;
Set TAILOFF Long FILESTART ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType Standard ;
Get FOOBAR Long 0 ;
Get FILENUM Long 0 ;
Get DIRSIZE Long 0 ;
Get PADSIZE Long 0 ;
Set TEMP Long PADSIZE ;
GoTo TEMP 0 ;
SavePos ENTOFF 0 ;
For Z = 1 To FILENUM ;
GoTo TEMP 0 ;
Math TEMP += 12 ;
Next Z ;
GoTo TEMP 0 ;
SavePos FNAMEOFF 0 ;
For X = 1 To FILENUM ;
GoTo ENTOFF 0 ;
Get FOOBAR Long 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
SavePos ENTOFF 0 ;
GoTo FNAMEOFF 0 ;
Get FNAME String 0 ;
SavePos FNAMEOFF 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next X ;


Script:
IDString 0 DHF ;
SavePos FILESTART 0 ;
GoTo EOF 0 ;
SavePos D 0 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 13 0 ;
Get FILESIZE Long 0 ;
SavePos FILEOFF 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math FILESTART += FILESIZE ;
Set F Long FILESTART ;
Math F += 17 ;
While F < D ;


Script:
IDString 0 HOG2 ;
Get FILECNTL Long 0 ;
Get FILESTART Long 0 ;
SavePos DUMMYL 0 ;
Math DUMMYL += 56 ;
Do ;
GoTo DUMMYL 0 ;
GetDString FILENAME 40 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Long 0 ;
SavePos DUMMYL 0 ;
GoTo FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
SavePos FILESTART 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
IDString 0 HMG_PACKED_FILE ;
Set S Long 32 ;
GoTo S 0 ;
Get OriginalName String 0 ;
Math S += 256 ;
GoTo S 0 ;
Get Entries Long 0 ;
SavePos S 0 ;
Math Entries *= 80 ;
Math S += Entries ;
Get AType Long 0 ;
Get Unknown Long 0 ;
Get Unknown Long 0 ;
Get FileNum Long 0 ;
SavePos J 0 ;
Math J += 64 ;
GoTo J 0 ;
For T = 1 To FileNum ;
Get RType Long 0 ;
Get Unknown Long 0 ;
Get ROff Long 0 ;
Get Size Long 0 ;
GetDString Name 64 0 ;
Math ROff += S ;
Log Name ROff Size 0 0 ;
Next T ;


Script:
ImpType Standard ;
IDString VER2 ;
Get NUMFILES Long 0 ;
SavePos CURPOS 0 ;
For T = 1 To NUMFILES ;
SavePos FOO ;
Get FILEOFF Long 0 ;
Math FILEOFF *= 2048 ;
SavePos FSO ;
Get FILESIZE Long 0 ;
Math FILESIZE *= 2048 ;
Get FILENAME String 0 ;
Log FILENAME FILEOFF FILESIZE FOO FSO ;
Math CURPOS += 32 ;
GoTo CURPOS 0 ;
Next T ;


Script:
ImpType Standard ;
IDString 0 LABN ;
Get D Long 0 ;
Get FC Long 0 ;
Set FJ Long FC ;
Math FJ *= 16 ;
Math FJ += 16 ;
Get D Long 0 ;
SavePos FT 0 ;
For T = 1 To FC ;
GoTo FT 0 ;
Get D Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get D Long 0 ;
SavePos FT 0 ;
GoTo FJ 0 ;
Get FN String 0 ;
SavePos FJ 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
Get FILECNTL Int 0 ;
Get DUMMYI Int 0 ;
Get DUMMYL Long 0 ;
SavePos TAILOFF 0 ;
Do ;
GoTo TAILOFF 0 ;
Get FILEOFF Long 0 ;
SavePos TAILOFF 0 ;
Get FILESIZE Long 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
IDString 0 EALIB ;
Get FILECNTL Int 0 ;
SavePos FILESTART 0 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 12 0 ;
Get DUMMYL Int 0 ;
Get FILEOFF Long 0 ;
Math FILEOFF += 5 ;
SavePos FILESTART 0 ;
SavePos DUMMYL 0 ;
Math DUMMYL += 12 ;
GoTo DUMMYL 0 ;
Get DUMMYL Int 0 ;
Get FILESIZE Long 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType Standard ;
Get FN Int 0 ;
For T = 1 To FN ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
GetDString FName 16 0 ;
Log FName FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
Do ;
SavePos C 0 ;
Get CH Byte 0 ;
GoTo C 0 ;
If CH <> 0 ;
GetDString FN 10 0 ;
Get D Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Log FN FO FS FOO FSO ;
EndIf ;
While CH <> 0 ;


Script:
ImpType Standard ;
Get FILENUM Long 0 ;
For F = 1 To FILENUM ;
GetDString FNAME 56 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
IDString 0 LOD ;
SavePos FILESTART 0 ;
Math FILESTART += 5 ;
GoTo FILESTART 0 ;
Get FILECNTL Long 0 ;
Set FILESTART Long 92 ;
GoTo FILESTART 0 ;
Do ;
SavePos FILESTART 0 ;
GetDString FILENAME 16 0 ;
Get FILEOFF Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
GoTo FILEOFF 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
GoTo FILESTART 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType Standard ;
SavePos FILESTART 0 ;
GetDString FILENAME 16 0 ;
Get DUMMYL Long 0 ;
GoTo FILESTART 0 ;
Math DUMMYL /= 24 ;
For T = 1 To DUMMYL ;
GetDString FILENAME 16 0 ;
SavePos FOO 0 ;
Get FILEOFF Long 0 ;
SavePos FSO 0 ;
Get FILESIZE Long 0 ;
Log FILENAME FILEOFF FILESIZE FOO FSO ;
Next T ;


Script:
ImpType Standard ;
Get Version Long 0 ;
Get FDO Long 0 ;
Get DO Long 0 ;
Get FC Long 0 ;
For T = 1 to FC ;
Goto FDO 0 ;
Get FN String 0 ;
SavePos FDO 0 ;
Goto DO 0 ;
Get UK Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FP Long 0 ;
SavePos DO 0 ;
Log FN FP FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
Get HeaderSize Long 0 ;
Get DataSize Long 0 ;
SavePos COff 0 ;
Do ;
SavePos FOO 0 ;
Get FO Long 0 ;
If FO <> 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get NSize Long 0 ;
GetDString FName NSize 0 ;
SavePos COff 0 ;
Log FName FO FS FOO FSO ;
Else ;
Set COff Long HeaderSize ;
EndIf ;
While COff < HeaderSize ;


Script:
ImpType Standard ;
Get FILENUM Long 0 ;
For F = 1 To FILENUM ;
Get FID Long 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
ImpType Standard ;
ComType ZLib1 ;
IDString 0 ZGWH ;
Get FILECNTL Long 0 ;
For T = 1 To FILECNTL ;
Get FILENAME String 0 ;
SavePos CSO 0 ;
Get CS Long 0 ;
SavePos UCSO 0 ;
Get UCS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FILESTART 0 ;
CLog FILENAME FO CS FOO CSO UCS UCSO ;
Next T ;


Script:
ImpType Standard ;
Get FILENUM Byte 0 ;
For F = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FOOBAR FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
IDString 0 #VBD ;
Get D Long 0 ;
Get D Long 0 ;
Get START Long 0 ;
Get Item_Count Int 0 ;
Get Item_Count Int 0 ;
For T = 1 To Item_Count ;
GetDString TIME 8 0 ;
Get OS Long 0 ;
Get NS Long 0 ;
Get RO Long 0 ;
Get IC Int 0 ;
Get BS Byte 0 ;
GetDString IN BS 0 ;
Set IO Long RO ;
Math IO += START ;
Log IN IO NS 0 0 ;
Next T ;


Script:
ImpType Standard ;
Goto 8 0 ;
Get FNum Long 0 ;
For n = 1 to FNum ;
Get FNLen Long 0 ;
GetDString FN FNLen 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log FN FS FO FSO FOO ;
Next n ;


Script:
ImpType SFileOff ;
SavePos FF 0 ;
Get TAILEND Long 0 ;
GoTo FF 0 ;
Do ;
SavePos FSO 0 ;
Get FILEOFF Long 0 ;
Get FILENAME String 0 ;
SavePos TAILOFF 0 ;
Get FILESIZE Long 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE FSO 0 ;
SavePos THERE 0 ;
GoTo TAILOFF 0 ;
While THERE < TAILEND ;


Script:
ImpType StandardTail ;
SavePos TailOffOff 0 ;
Get TO Long 0 ;
GoTo TO 0 ;
Get TS Long 0 ;
SavePos T 0 ;
Math T += 5 ;
GoTo T 0 ;
Get Path String 0 ;
Get FN Long 0 ;
For D = 1 To FN ;
Set Name String Path ;
Get Name String 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Get ZipState Long 0 ;
Get OrSize Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log Name FO FS FOO FSO ;
Next D ;


Script:
Set JC String .JC ;
SavePos ST 0 ;
GoTo EOF 0 ;
SavePos END 0 ;
GoTo ST 0 ;
Set Num Long 0 ;
Do ;
Get UCS Long 0 ;
SavePos CSO 0 ;
Get CS Long 0 ;
SavePos FO 0 ;
SavePos J 0 ;
GetDString ID 2 0 ;
SavePos UCSO 0 ;
Set FN String FILE ;
String FN += Num ;
String FN += JC ;
Log FN FO CS 0 CSO ;
Math Num += 1 ;
Math J += CS ;
GoTo J 0 ;
While J < END ;


Script:
ImpType Standard ;
ComType ZLib1 ;
Get DATE Long 0 ;
Get FileNum Long 0 ;
For T = 1 To FileNum ;
Get BlSize Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos UCSO 0 ;
Get UCS Long 0 ;
Get FNS Long 0 ;
GetDString FN FNS 0 ;
CLog FN FO FS FOO FSO UCS UCSO ;
Next T ;


Script:
ImpType Standard ;
Get U1 Long 0 ;
Get U2 Long 0 ;
Get U3 Long 0 ;
Get FileNum Long 0 ;
For T = 1 To FileNum ;
GetCT FName String 10 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get U3 Long 0 ;
Log FName FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
Get FILENUM Long 0 ;
For F = 1 To FILENUM ;
Get IDENT Long 0 ;
Get ID Long 0 ;
GetDString FNAME 12 0 ;
If IDENT = 1 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Else ;
Get FOO Long 0 ;
Get BAR Long 0 ;
End If ;
Next F ;


Script:
ImpType SFileSize ;
Get FILENUM Long 0 ;
Set DATASTRT Long FILENUM ;
Math DATASTRT *= 108 ;
Math DATASTRT += 4 ;
For F = 1 To FILENUM ;
GetDString FILENAME 100 0 ;
Get FOFFSET Long 0 ;
Math FOFFSET += DATASTRT ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FILENAME FOFFSET FSIZE 0 FSIZEX ;
Next F ;


Script:
ComType ZLib1 ;
Get Date Long 0 ;
Get FileNum Long 0 ;
For T = 1 To FileNum ;
Get Offset Long 0 ;
Get CSize Long 0 ;
Get UCSize Long 0 ;
Get CType Long 0 ;
Math Offset += 8 ;
Set FN String ".dec" ;
Set FP String "file" ;
String FP += UCSize ;
String FP += FN ;
Set UCSize Long 1000000 ;
CLog FP Offset CSize 0 0 UCSize 0 ;
Next T ;


Script:
ImpType Standard ;
GetDString MW 12 0 ;
Get DataEnd Long 0 ;
Get FNum Long 0 ;
Get Version Long 0 ;
SavePos S 0 ;
Math DataEnd /= 256 ;
Math DataEnd += 1 ;
Math DataEnd *= 256 ;
Set DataOff Long DataEnd ;
Set D Long 12 ;
Math D *= FNum ;
Math S += D ;
SavePos P 0 ;
For T = 1 To FNum ;
GoTo P 0 ;
Get RFNO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Set J Long P ;
Math J += RFNO ;
SavePos P 0 ;
GoTo J 0 ;
Get FN String 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
GoTo 4 0 ;
Get DirOffset Long 0 ;
Get FNum Long 0 ;
Math FNum /= 16 ;
Set JP Long DirOffset ;
For n = 1 To FNum ;
GoTo JP 0 ;
Get FNO Long 0 ;
Math FNO += DirOffset ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get DN Long 0 ;
SavePos JP 0 ;
GoTo FNO 0 ;
Get FN String 0 ;
Log FN FO FS FOO FSO ;
Next n ;


Script:
IDString 0 P5CK ;
SavePos TailOffOff 0 ;
Get TailOff Long 0 ;
Get TailSize Long 0 ;
Set J Long 2048 ;
GoTo J 0 ;
Get FileNum Int 0 ;
SavePos D 0 ;
Get B Byte 0 ;
GoTo D 0 ;
Set FNT String file ;
Set TJ Long TailOff ;
For T = 1 To FileNum ;
If B > 0 ;
GoTo D 0 ;
Get FNS Byte 0 ;
GetDString FN FNS 0 ;
SavePos D 0 ;
Else ;
Set FN String FNT ;
String FN += T ;
EndIf ;
GoTo TJ 0 ;
Get DUM Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get DUM Long 0 ;
SavePos TJ 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
IDString 0 PACK ;
ImpType Standard ;
SavePos TailOffOff 0 ;
Get T Long 0 ;
Get TS Long 0 ;
SavePos F 0 ;
GoTo T 0 ;
Math TS /= 64 ;
For i = 1 To TS ;
SavePos T 0 ;
Get FN String 0 ;
Math T += 56 ;
GoTo T 0 ;
SavePos Foo 0 ;
Get Fo Long 0 ;
SavePos Fso 0 ;
Get Fs Long 0 ;
Log FN Fo Fs Foo Fso ;
Next i ;


Script:
IDString 0 PACK ;
Get TAILOFF Long 0 ;
Get TAILSIZEB Long 0 ;
SavePos FILESTART 0 ;
GoTo TAILOFF 0 ;
SavePos DUMMYL 0 ;
Set BytesRead Long 0 ;
Do ;
GoTo DUMMYL 0 ;
GetDString FILENAME 56 0 ;
Set WHATEVER1 Long 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
SavePos DUMMYL 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While BytesRead <> TAILSIZEB ;


Script:
ImpType StandardTail ;
GoTo EOF 0 ;
SavePos END 0 ;
Math END -= 7 ;
GoTo END 0 ;
SavePos TailOffOff 0 ;
Get TailOffSet Long 0 ;
GoTo TailOffSet 0 ;
Get DIREntries Long 0 ;
Get FileNum Long 0 ;
Get U1 Long 0 ;
Get U2 Long 0 ;
SavePos FNOffset 0 ;
Math DIREntries *= 16 ;
Math FNOffset += DIREntries ;
Set C Long 0 ;
Do ;
Get U4 Long 0 ;
Get U5 Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FP 0 ;
If U5 <> 0 ;
GoTo FNOffset 0 ;
Get U6 Long 0 ;
Get NameSize Long 0 ;
GetDString FName NameSize 0 ;
SavePos FNOffset 0 ;
Math C += 1 ;
Log FName FO FS FOO FSO ;
GoTo FP 0 ;
EndIf ;
While C < FileNum ;


Script:
ImpType StandardTail ;
Set FS Long 8 ;
GoTo FS 0 ;
Get FC Long 0 ;
Get FJ Long 0 ;
SavePos TailOffOff 0 ;
Get TO Long 0 ;
GoTo TO 0 ;
For T = 1 To FC ;
Get D Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get D Long 0 ;
GetDString FN 36 0 ;
Get D Long 0 ;
Get D Long 0 ;
Math TO += FJ ;
GoTo TO 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
ImpType StandardTail ;
Get HEADSIZE Long 0 ;
Get HEADER Long 0 ;
If HEADER <> 860243536 ;
CleanExit ;
EndIf ;
Get FILENUM Long 0 ;
Get ENTSIZE Long 0 ;
Get TAILX Long 0 ;
GoTo TAILX 0 ;
For F = 1 To FILENUM ;
Get FOOBAR Long 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Get DATE Long 0 ;
GetDString FNAME 12 0 ;
Get FOO Long 0 ;
Get BAR Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
ImpType Standard ;
Get MW Long 0 ;
Get FileNum Long 0 ;
Get DataStart Long 0 ;
Get NUL Long 0 ;
For T = 1 To FileNum ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get FNS Long 0 ;
GetDString FName FNS 0 ;
Log FName FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
ComType ZLib1 ;
Set D Long 12 ;
GoTo D 0 ;
Get C Long 0 ;
Get D Long 0 ;
Get D Long 0 ;
Set J Long 24 ;
SavePos D 0 ;
Set JF Long 48 ;
Math JF *= C ;
Math JF += 28 ;
For T = 1 To C ;
SavePos UCSO 0 ;
Get UCS Long 0 ;
Get D Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos D 0 ;
Math D += J ;
GoTo D 0 ;
SavePos CSO 0 ;
Get CS Long 0 ;
Get D Long 0 ;
Get D Long 0 ;
SavePos D 0 ;
GoTo JF 0 ;
Get FNS Long 0 ;
GetDString FN FNS 0 ;
SavePos JF 0 ;
GoTo D 0 ;
CLog FN FO CS FOO CSO UCS UCSO ;
Next T ;


Script:
IDString 0 PICS ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 32 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILESIZE Long 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType Standard ;
Get FILENUM Long 0 ;
For F = 1 To FILENUM ;
GetDString FNAME 256 0 ;
GetDString FNAME 256 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
Get NULL Long 0 ;
Get FSIZE Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
ImpType Standard ;
Set TEMP Byte 6 ;
GoTo TEMP 0 ;
Get VERSION Byte 0 ;
If VERSION <> 52 ;
CleanExit ;
EndIf ;
Get FOOBAR Byte 0 ;
Get FILENUM Long 0 ;
For F = 1 To FILENUM ;
GetDString FNAME 256 0 ;
GetDString FNAME 256 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
Get FOOBAR Long 0 ;
Get FSIZE Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Get FOOBAR Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
ImpType Standard ;
IDString 0 PKR2 ;
Get TEMP Long 0 ;
Get DIRNUM Long 0 ;
Get TEMP Long 0 ;
For D = 1 To DIRNUM ;
GetDString DIRNAME 32 0 ;
Get NEXTFILE Long 0 ;
Get FILENUM Long 0 ;
SavePos NEXTDIR 0 ;
Set FNNUM Long 0 ;
GoTo NEXTFILE 0 ;
Do ;
Math FNNUM += 1 ;
GetDString FNREAL 32 0 ;
Get TEMP Long 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
Get FSIZE Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Set FNAME String DIRNAME ;
String FNAME += FNREAL ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
While FNNUM < FILENUM ;
GoTo NEXTDIR 0 ;
Next D ;


Script:
ImpType Standard ;
Get FILENUM Long 0 ;
Set TEMP Long 84 ;
GoTo TEMP 0 ;
For X = 1 To FILENUM ;
GetDString FNAME 32 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
SavePos FOFFX 0 ;
Get FOFFSET Long 0 ;
Log FNAME FOFFSET FSIZE FOFFX FSIZEX ;
Next X ;


Script:
ImpType StandardTail ;
IDString 0 POD3 ;
Set D Long 88 ;
GoTo D 0 ;
Get FNU Long 0 ;
Set D Long 264 ;
GoTo D 0 ;
SavePos TailOffOff 0 ;
Get TP Long 0 ;
Set DE Long FNU ;
Math DE *= 20 ;
Math DE += TP ;
For T = 1 To FNU ;
GoTo TP 0 ;
Get CO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos TP 0 ;
Math TP += 8 ;
Set DZ Long DE ;
Math DZ += CO ;
GoTo DZ 0 ;
Get FN String 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
Get FOOBAR Long 0 ;
Get FILENUM Long 0 ;
For X = 1 To FILENUM ;
GetDString FNAME 12 0 ;
Get FOFFX Long 0 ;
SavePos TEMP 0 ;
GoTo FOFFX 0 ;
SavePos FSIZEO 0 ;
Get FSIZE Long 0 ;
SavePos FOFFSETO 0 ;
SavePos FOFFSET 0 ;
Log FNAME FOFFSET FSIZE FOFFSETO FSIZEO ;
GoTo TEMP 0 ;
Next X ;


Script:
ImpType Standard ;
Get AS ASize 0 ;
Get FN Long 0 ;
Get FN Long 0 ;
SavePos TailOffOff 0 ;
Get FIP Long 0 ;
Get FNS Long 0 ;
Math AS -= FNS ;
For TE = 1 To FN ;
GoTo FIP 0 ;
Get D Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Get D Long 0 ;
Get D Int 0 ;
Get SU Long 0 ;
Set AA Long AS ;
Math AA += SU ;
SavePos FIP 0 ;
GoTo AA 0 ;
GetDString F$ D 0 ;
Log F$ FO FS FOO FSO ;
Next TE ;


Script:
IDString 0 0TSR ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
Get DUMMYL Long 0 ;
Get TAILOFF Long 0 ;
SavePos FILESTART 0 ;
Set DUMMYL Long FILECNTL ;
Math DUMMYL *= 56 ;
Math DUMMYL += 20 ;
Do ;
GoTo FILESTART 0 ;
Get FILENAME String 0 ;
Math FILESTART += 44 ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Math FILESTART += 12 ;
Math DUMMYL += 4 ;
Set FILEOFF Long DUMMYL ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math DUMMYL += FILESIZE ;
Math DUMMYL += 4 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
SavePos FILESTART 0 ;
Math FILESTART += 16 ;
GoTo FILESTART 0 ;
Get TAILOFF Long 0 ;
Get FILECNTL Long 0 ;
Do ;
GoTo TAILOFF 0 ;
Get DUMMYL Long 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Long 0 ;
GetDString FILENAME 16 0 ;
SavePos TAILOFF 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType Standard ;
Get FN Int 0 ;
For T = 1 To FN ;
Get D Byte 0 ;
GetDString NAME 12 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get D Byte 0 ;
Log NAME FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
SavePos TailOffOff 0 ;
Get TO Long 0 ;
GoTo TO 0 ;
Get FSN Long 0 ;
For TE = 1 To FSN ;
Get FNS Long 0 ;
GetDString FN FNS 0 ;
SavePos CSO 0 ;
Get CS Long 0 ;
SavePos FSO 0 ;
Get US Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Get IDU Long 0 ;
Get DUMMY Long 0 ;
Get DUMMY Long 0 ;
Log FN FO CS FOO FSO ;
Next TE ;


Script:
ImpType StandardTail ;
IDString 0 RFF ;
Set FT Long 8 ;
GoTo FT 0 ;
SavePos TailOffOff 0 ;
Get FT Long 0 ;
Get FC Long 0 ;
For T = 1 To FC ;
Math FT += 16 ;
GoTo FT 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FT 0 ;
Math FT += 9 ;
GoTo FT 0 ;
GetDString FN 11 0 ;
Get D Long 0 ;
SavePos FT 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
GoTo 12 0 ;
Get FNum Long 0 ;
Get DirOff Long 0 ;
GoTo DirOff 0 ;
For n = 1 To FNum ;
SavePos FNJump 0 ;
Math FNJump += 24 ;
Get FN String 0 ;
GoTo FNJump 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log FN FO FS FOO FSO ;
Next n ;


Script:
IDString 0 rsrc ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
Do ;
GetDString FILENAME 8 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
GoTo FILESTART 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
Do ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
Get FILESIZE Long 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
IDString 0 LiOnHeAd ;
SavePos FILESTART 0 ;
Math FILESTART += 32 ;
GoTo FILESTART 0 ;
Get FILESTART Long 0 ;
SavePos DUMMYL 0 ;
Math FILESTART += DUMMYL ;
Math FILESTART += 32 ;
GoTo FILESTART 0 ;
Get FILESTART Long 0 ;
SavePos TAILOFF 0 ;
Math FILESTART += TAILOFF ;
Math FILESTART += 32 ;
GoTo FILESTART 0 ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
Set DUMMYL Long DUMMYL ;
Math DUMMYL /= FILECNTL ;
SavePos FILESTART 0 ;
Do ;
GoTo FILESTART 0 ;
SavePos FILEJMP 0 ;
Math FILESTART += 2 ;
GoTo FILESTART 0 ;
GetDString FILENAME 254 0 ;
SavePos FILESTART 0 ;
Math FILESTART += 12 ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Set FILESTART Long FILEJMP ;
Get FILEJMP Long 0 ;
Set FILEOFF Long TAILOFF ;
Math FILEOFF += FILEJMP ;
Math FILESTART += DUMMYL ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
IDString 0 SARC ;
Get FILENUM Long 0 ;
SavePos DIRSTART 0 ;
For Z = 1 To FILENUM ;
Get FNSIZE Byte 0 ;
SavePos TEMP 0 ;
Math TEMP += FNSIZE ;
Math TEMP += 13 ;
GoTo TEMP 0 ;
Next Z ;
SavePos DATASTRT 0 ;
GoTo DIRSTART 0 ;
For F = 1 To FILENUM ;
Get FNSIZE Byte 0 ;
GetDString FNAME FNSIZE 0 ;
Get NULL Byte 0 ;
Get FOFFSET Long 0 ;
Get FSIZE Long 0 ;
Get FOOBAR Long 0 ;
Math FOFFSET += DATASTRT ;
Log FNAME FOFFSET FSIZE 0 0 ;
Next F ;


Script:
ImpType Standard ;
IDString 0 SBF0 ;
Set TEMP Long 20 ;
GoTo TEMP 0 ;
Get FILENUM Long 0 ;
For F = 1 To FILENUM ;
GetDSTring FNAME 16 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Get FOO Long 0 ;
Get BAR Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
Get FC Long 0 ;
Get D Long 0 ;
For TE = 1 To FC ;
SavePos FS 0 ;
GoTo D 0 ;
Get DD Long 0 ;
Get FSI Long 0 ;
GetDString FN 16 0 ;
SavePos FO 0 ;
Math FO += 16 ;
Log FN FO FSI 0 0 ;
GoTo FS 0 ;
Get D Long 0 ;
Next TE ;


Script:
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
Math FILESTART += 12 ;
Do ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
Math FILESTART += 20 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType SFileSize ;
GoTo EOF 0 ;
SavePos END 0 ;
GoTo SOF 0 ;
Set IDM String "SMPL" ;
Do ;
GetDString IDS 4 0 ;
If IDS <> IDM ;
CleanExit ;
Else ;
SavePos FS 0 ;
Get FiSi Long 0 ;
GetDString FName 8 0 ;
SavePos FO 0 ;
Math FiSi -= 16 ;
Log FName FO FiSi 0 FS ;
Math FO += FiSi ;
GoTo FO 0 ;
EndIf ;
SavePos POS 0 ;
While POS < END ;


Script:
Set DUMMYL Long 1024 ;
Set FILEJMP Long 2048 ;
SavePos FILESTART 0 ;
GoTo EOF 0 ;
SavePos E 0 ;
Do ;
GoTo FILESTART 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
GoTo DUMMYL 0 ;
Get FILESIZE Long 0 ;
Set D Long FILESIZE ;
Math D += FILEJMP ;
SavePos DUMMYL 0 ;
Math FILESIZE -= FILEOFF ;
Math FILEOFF += FILEJMP ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While D < E ;


Script:
IDString 0 DSFX ;
Get FILECNTL Long 0 ;
Get D Long 0 ;
Get F Long 0 ;
SavePos FILESTART 0 ;
Math FILESTART += 8 ;
GoTo EOF 0 ;
SavePos TA 0 ;
Math TA -= F ;
Math TA += 1 ;
Do ;
GoTo FILESTART 0 ;
SavePos FSO 0 ;
Get FILESIZE Long 0 ;
SavePos FOO 0 ;
Get FILEOFF Long 0 ;
Math FILESTART += 16 ;
GoTo TA 0 ;
Get FILENAME String 0 ;
SavePos TA 0 ;
Log FILENAME FILEOFF FILESIZE FOO FSO ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Get FileNum Long 0 ;
Math FileNum -= 1 ;
For T = 1 To FileNum ;
Get Offset Long 0 ;
Get D Long 0 ;
Get D Long 0 ;
SavePos J 0 ;
Get Size Long 0 ;
Math Size -= Offset ;
Log "" Offset Size 0 0 ;
GoTo J 0 ;
Next T ;
Get Offset Long 0 ;
GoTo EOF 0 ;
SavePos Size 0 ;
Math Size -= Offset ;
Log "" Offset Size 0 0 ;


Script:
ImpType SFileSize ;
IDString 0 VXBG ;
Get DirSize Long 0 ;
Set MaxSize Long 8 ;
Math MaxSize += DirSize ;
Set FO Long MaxSize ;
Do ;
Get FN String 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Log FN FO FS 0 FSO ;
Math FO += FS ;
SavePos CO 0 ;
While CO < MaxSize ;


Script:
IDString 0 SMK2 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILECNTL Long 0 ;
Set FILESTART Long 104 ;
Set FILEJMP Long FILECNTL ;
Math FILEJMP *= 4 ;
Math FILEJMP += FILECNTL ;
Math FILEJMP += 104 ;
Do ;
Set FILEOFF Long FILEJMP ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math FILEJMP += FILESIZE ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Get FC Long 0 ;
ImpType Standard ;
For A = 1 To FC ;
SavePos FS 0 ;
Get FN String 0 ;
Math FS += 40 ;
GoTo FS 0 ;
SavePos Foo 0 ;
Get Fo Long 0 ;
SavePos Fso 0 ;
Get Fsi Long 0 ;
Log FN Fo Fsi Foo Fso ;
Next A ;


Script:
Get TAILOFF Long 0 ;
Do ;
GoTo TAILOFF 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
SavePos TAILOFF 0 ;
Log "" FILEOFF FILESIZE 0 0 ;
While NotEOF <> 0 ;


Script:
Get FC Int 0 ;
Set TAIL Long FC ;
Math TAIL *= 8 ;
GoTo EOF 0 ;
SavePos END 0 ;
Math END -= TAIL ;
Math END += 1 ;
GoTo END 0 ;
Set OFF Long 4 ;
For T = 1 To FC ;
Get FN Long 0 ;
Get SIZE Long 0 ;
Log FN OFF SIZE 0 0 ;
Math OFF += SIZE ;
Next T ;


Script:
IDString 0 srf1 ;
Get FILELNGH Long 0 ;
ReverseLong FILELNGH ;
Get HEADLNGH Long 0 ;
ReverseLong HEADLNGH ;
SavePos FILESTART 0 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 4 0 ;
Get SUBCOUNT Long 0 ;
ReverseLong SUBCOUNT ;
For T = 1 To SUBCOUNT ;
Get SUBNAME Long 0 ;
ReverseLong SUBNAME ;
String FILENAME += SUBNAME ;
Get FILEOFF Long 0 ;
ReverseLong FILEOFF ;
Get FILESIZE Long 0 ;
ReverseLong FILESIZE ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
String FILENAME -= SUBNAME ;
Next T ;
SavePos FILESTART 0 ;
While FILESTART < HEADLNGH ;


Script:
ImpType Standard ;
Get NOF Long 0 ;
Set SHIFT Long 136 ;
Math SHIFT *= NOF ;
Math SHIFT += 4 ;
For I = 1 to NOF ;
SavePos T 0 ;
Get PN String 0 ;
Math T += 128 ;
Goto T 0 ;
SavePos OFO 0 ;
Get FO Long 0 ;
Math FO += SHIFT ;
SavePos OFL 0 ;
Get FL Long 0 ;
Log PN FO FL OFO OFL ;
NEXT I ;


Script:
ImpType Standard ;
ComType ZLib1 ;
Get D Long 0 ;
Get FC Long 0 ;
Get HS Long 0 ;
Get D2 Long 0 ;
For T = 1 To FC ;
SavePos OSOff 0 ;
Get OSize Long 0 ;
SavePos CSizeOff 0 ;
Get CSize Long 0 ;
SavePos OffOff 0 ;
Get Offset Long 0 ;
Get NSize Long 0 ;
GetDString FN NSize 0 ;
SavePos C 0 ;
Set JP Long NSize ;
Math NSize += 4 ;
Math NSize /= 4 ;
Math NSize *= 4 ;
Math NSize -= JP ;
Math C += NSize ;
GoTo C 0 ;
CLog FN Offset CSize OffOff CSizeOff OSize OSOff ;
Next T ;


Script:
ImpType Standard ;
Get FNum Long 0 ;
SavePos S 0 ;
Math S += 12 ;
GoTo S 0 ;
For T = 1 To FNum ;
GetDString FN 16 0 ;
Get D Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Get D Long 0 ;
Log FN FO FS FOO FSO ;
Next T ;


Script:
ImpType Standard ;
IDString 0 RS2 ;
Get FOOBAR Byte 0 ;
Get FILENUM Long 0 ;
For X = 1 To FILENUM ;
Get FNSIZE Long 0 ;
GetDString FNAME FNSIZE 0 ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next X ;


Script:
ImpType Standard ;
Set S Long 60 ;
GoTo S 0 ;
Get ST Long 0 ;
SavePos T 0 ;
Math T += 12 ;
GoTo T 0 ;
Get TS Long 0 ;
Get FC Long 0 ;
For B = 1 To FC ;
GoTo ST 0 ;
GetDString Na 80 0 ;
SavePos ST 0 ;
SavePos T 0 ;
Math T += 4 ;
GoTo T 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Math ST += 24 ;
GoTo TS 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
Math TS += 8 ;
Log Na FO FS FOO FSO ;
Next B ;


Script:
ImpType StandardTail ;
GoTo EOF 0 ;
SavePos END 0 ;
Math END -= 19 ;
GoTo END 0 ;
SavePos END 0 ;
Get D Long 0 ;
SAvePos TailOffOff 0 ;
Get TailOff Long 0 ;
Get ArSize Long 0 ;
GoTo TailOff 0 ;
Get FileNum Int 0 ;
Set T Long 0 ;
Do ;
Get SSize Byte 0 ;
GetDString FN SSize 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
Get D Long 0 ;
SavePos D 0 ;
Math T += 1 ;
Log FN FO FS FOO FSO ;
While D < END ;


Script:
IDString 0 VCE0 ;
Do ;
FindLoc FILEOFF String INFO 0 ;
Math FILEOFF += 12 ;
GoTo FILEOFF 0 ;
Get FILESIZE Long 0 ;
Math FILEOFF -= 12 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While NotEOF <> 0 ;


Script:
ImpType Standard ;
IDString 0 BIG4 ;
Get D Long 0 ;
Get FC Long 0 ;
ReverseLong FC ;
Get D Long 0 ;
SavePos FS 0 ;
For T = 1 To FC ;
GoTo FS 0 ;
SavePos FOO 0 ;
Get FO Long 0 ;
ReverseLong FO ;
SavePos FSO 0 ;
Get FSI Long 0 ;
ReverseLong FSI ;
Get FN String 0 ;
SavePos FS 0 ;
Log FN FO FSI FOO FSO ;
Next T ;


Script:
Get D Long 0 ;
SavePos FST 0 ;
Get FS Long 0 ;
Set FO Long 512 ;
Log "" FO FS 0 0 ;
Set FN Long 512 ;
Math FN /= 4 ;
Math FN -= 1 ;
For T = 1 To FN ;
GoTo FST 0 ;
Get FO Long 0 ;
Math FO += 512 ;
SavePos FST 0 ;
Get FS Long 0 ;
If FS = 0 ;
GoTo EOF 0 ;
SavePos FS 0 ;
Math FS += 1 ;
Math FS -= FO ;
Log "" FO FS 0 0 ;
Set T Long FN ;
Else ;
Math FS -= FO ;
Log "" FO FS 0 0 ;
EndIf ;
Next T ;


Script:
IDString 0 VOL ;
Set FILESTART Long 16 ;
Math FILESTART += 12 ;
FindLoc FILEJMP String voli 0 ;
Math FILEJMP += 12 ;
Set TAILOFF Long 0 ;
Do ;
GoTo FILEJMP 0 ;
Get FILEOFF Long 0 ;
Math FILEOFF += 8 ;
Get FILESIZE Long 0 ;
If FILESIZE = 0 ;
CleanExit ;
EndIf ;
Get DUMMYL Int 0 ;
Get DUMMYL Int 0 ;
Math DUMMYL -= TAILOFF ;
Math TAILOFF += DUMMYL ;
SavePos FILEJMP 0 ;
Math FILEJMP += 2 ;
GoTo FILESTART 0 ;
GetDString FILENAME DUMMYL 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While FILESIZE <> 0 ;


Script:
IDString 0 VPVP ;
Get DUMMYL Long 0 ;
Get TAILOFF Long 0 ;
Get FILECNTL Long 0 ;
SavePos FILESTART 0 ;
GoTo TAILOFF 0 ;
Do ;
Get D Long 0 ;
Get FILESIZE Long 0 ;
Get FILENAME String 0 ;
Set FILEOFF Long FILESTART ;
Math TAILOFF += 44 ;
GoTo TAILOFF 0 ;
Math FILESTART += FILESIZE ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Get DUMMYL Long 0 ;
ReverseLong DUMMYL ;
Set FILECNTL Long DUMMYL ;
Math FILECNTL /= 12 ;
Set FILESTART Long 0 ;
Do ;
GoTo FILESTART 0 ;
Get DUMMYL Long 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
ReverseLong DUMMYL ;
ReverseLong FILEOFF ;
ReverseLong FILESIZE ;
GoTo DUMMYL 0 ;
GetDString FILENAME 9 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
Set FILECNTL Long 0 ;
Set FILESTART Long 0 ;
Do ;
Math FILESTART += 250 ;
Math FILESTART += 10 ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Get FILEOFF Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While NotEOF <> 0 ;


Script:
Do ;
GetDString FNAME 20 0 ;
Get FSIZE Long 0 ;
If FSIZE = 0 ;
CleanExit ;
EndIf ;
Get FOOBAR Long 0 ;
Get FOOBAR Long 0 ;
SavePos FOFFSET 0 ;
Log FNAME FOFFSET FSIZE 0 0 ;
Math FOFFSET += FSIZE ;
GoTo FOFFSET 0 ;
While NotEOF <> 0 ;


Script:
GoTo 4 0 ;
Get FNum Long 0 ;
GoTo 40 0 ;
Get DirOffset Long 0 ;
GoTo 52 0 ;
Get FNOffset Long 0 ;
GoTo 60 0 ;
Get FirstFO Long 0 ;
Math DirOffset += 20 ;
For n = 1 to FNum ;
GoTo DirOffset 0 ;
Get FO Long 0 ;
Math FO += FirstFO ;
Get FS Long 0 ;
Math DirOffset += 48 ;
GoTo FNOffset 0 ;
Get FNOffset String 0 ;
SavePos FN 0 ;
Log FN FO FS 0 0 ;
Next n ;


Script:
ImpType Standard ;
IDString 0 IWAD ;
Get FC Long 0 ;
SavePos TailOffOff 0 ;
Get TO Long 0 ;
GoTo TO 0 ;
For TE = 1 To FC ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
GetDString FN 8 0 ;
Log FN FO FS FOO FSO ;
Next TE ;


Script:
Do ;
FindLoc OFF String BIK 0 ;
Set JP Long OFF ;
Math JP += 4 ;
GoTo JP 0 ;
Get SIZE Long 0 ;
Math SIZE += 4 ;
Log "" OFF SIZE 0 0 ;
While NotEOF <> 0 ;


Script:
ComType ZLib1 ;
IDString 0 WAD ;
Get DUM Long 0 ;
Get DUM Long 0 ;
Get FNUM Long 0 ;
For T = 1 To FNUM ;
Get DUM Long 0 ;
Get FEO Long 0 ;
Get DUM Long 0 ;
SavePos EO 0 ;
GoTo FEO 0 ;
Get JP Int 0 ;
SavePos SS 0 ;
Math SS += JP ;
Get UCS Long 0 ;
Get DUM Long 0 ;
Get B Byte 0 ;
SavePos S 0 ;
Math SS -= S ;
GetDString FN SS 0 ;
SavePos FO 0 ;
Set FSI Long UCS ;
CLog FN FO FSI 0 0 UCS 0 ;
GoTo EO 0 ;
Next T ;


Script:
ImpType Standard ;
IDString 0 WAD3 ;
Get FC Long 0 ;
SavePos TailOffOff 0 ;
Get TO Long 0 ;
GoTo TO 0 ;
For TE = 1 To FC ;
SavePos FOO 0 ;
Get FO Long 0 ;
SavePos FSO 0 ;
Get FS Long 0 ;
GetDString FN 8 0 ;
Log FN FO FS FOO FSO ;
Next TE ;


Script:
Get DUMMYL Long 0 ;
Get FILECNTL Int 0 ;
Get DUMMYI Int 0 ;
SavePos FILESTART 0 ;
Set FILECNTL Long 0 ;
Do ;
GoTo FILESTART 0 ;
Get FILEJMP Long 0 ;
SavePos FILESTART 0 ;
GoTo FILEJMP 0 ;
Get FILESIZE Long 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Script:
ImpType Standard ;
IDString 0 XAF ;
Set TEMP Long 40 ;
GoTo TEMP 0 ;
Get FILENUM Long 0 ;
Set FNAMEX Long FILENUM ;
Math FNAMEX *= 8 ;
Math FNAMEX += 64 ;
Set TEMP Long 64 ;
GoTo TEMP 0 ;
For F = 1 To FILENUM ;
SavePos FOFFSETX 0 ;
Get FOFFSET Long 0 ;
SavePos FSIZEX 0 ;
Get FSIZE Long 0 ;
SavePos NEXTFILE 0 ;
GoTo FNAMEX 0 ;
GetDString FNAME 260 0 ;
SavePos FNAMEX 0 ;
GoTo NEXTFILE 0 ;
Log FNAME FOFFSET FSIZE FOFFSETX FSIZEX ;
Next F ;


Script:
IDString 0 ZFS3 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get TAILSIZEB Long 0 ;
Get FILECNTL Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILEJMP Long 0 ;
SavePos FILESTART 0 ;
Set TAILOFF Long FILECNTL ;
Math TAILOFF /= TAILSIZEB ;
Set TAILOFF Long TAILSIZEB ;
Math TAILOFF *= TAILOFF ;
Set DUMMYL Long TAILOFF ;
Set TAILOFF Long FILECNTL ;
Math TAILOFF -= DUMMYL ;
Set DUMMYL Long 0 ;
Do ;
Math DUMMYL += 1 ;
GoTo FILESTART 0 ;
GetDString FILENAME 16 0 ;
Get FILEOFF Long 0 ;
Math FILESTART += 24 ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Math FILESTART += 12 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
While DUMMYL <> TAILSIZEB ;
If EXTRCNT = FILECNTL ;
CleanExit ;
EndIf ;
GoTo FILEJMP 0 ;
Get FILEJMP Long 0 ;
SavePos FILESTART 0 ;
Set DUMMYL Long FILECNTL ;
Math DUMMYL -= EXTRCNT ;
Set FILEOFF Long TAILOFF ;
Math FILEOFF /= DUMMYL ;
Set FILEOFF Long TAILOFF ;
Math FILEOFF *= FILEOFF ;
Set FILESIZE Long DUMMYL ;
Math FILESIZE /= TAILSIZEB ;
Set FILESIZE Long TAILSIZEB ;
Math FILESIZE *= FILESIZE ;
Set TAILSIZEB Long FILESIZE ;
Math TAILSIZEB += FILEOFF ;
Set DUMMYL Long 0 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 16 0 ;
Get FILEOFF Long 0 ;
Math FILESTART += 24 ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Math FILESTART += 12 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math DUMMYL += 1 ;
While DUMMYL <> TAILSIZEB ;
If EXTRCNT = FILECNTL ;
CleanExit ;
EndIf ;
GoTo FILEJMP 0 ;
Get FILEJMP Long 0 ;
SavePos FILESTART 0 ;
Set DUMMYL Long FILECNTL ;
Math DUMMYL -= EXTRCNT ;
Set FILEOFF Long TAILOFF ;
Math FILEOFF /= DUMMYL ;
Set FILEOFF Long TAILOFF ;
Math FILEOFF *= FILEOFF ;
Set FILESIZE Long DUMMYL ;
Math FILESIZE /= TAILSIZEB ;
Set FILESIZE Long TAILSIZEB ;
Math FILESIZE *= FILESIZE ;
Set TAILSIZEB Long FILESIZE ;
Math TAILSIZEB += FILEOFF ;
Set DUMMYL Long 0 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 16 0 ;
Get FILEOFF Long 0 ;
Math FILESTART += 24 ;
GoTo FILESTART 0 ;
Get FILESIZE Long 0 ;
Math FILESTART += 12 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math DUMMYL += 1 ;
While DUMMYL <> TAILSIZEB ;


Script:
IDString 0 NORK ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get DUMMYL Long 0 ;
Get FILESTART Long 0 ;
Get FILESTART Long 0 ;
Math DUMMYL -= FILESTART ;
Set FILECNTL Long DUMMYL ;
Math FILECNTL /= 24 ;
Do ;
Math FILESTART += 1 ;
GoTo FILESTART 0 ;
Get DUMMYL Long 0 ;
ReverseLong DUMMYL ;
GetDString FILENAME DUMMYL 0 ;
Get FILEOFF Long 0 ;
Get FILESIZE Long 0 ;
SavePos FILESTART 0 ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;


Source: http://aluigi.altervista.org/quickbms.htm
Script:
# Borderlands 2 PCK
# script for QuickBMS http://quickbms.aluigi.org

idstring "AKPK"
get INFO_SIZE long
get DUMMY long
get XSIZE long
get DUMMY long
get DUMMY long
get DUMMY long
getdstring DUMMY XSIZE
do
    get FILES long
while FILES == 0
get DUMMY long

for i = 0 < FILES
    get DUMMY long  # 1
    get SIZE long
    get OFFSET long
    get DUMMY long
    get DUMMY long
    log "" OFFSET SIZE
next i


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

get DAT_SIZE asize
for OFFSET = 0 < DAT_SIZE
    goto OFFSET
    idstring "XFLE"
    getdstring DUMYM 2
    getdstring NAME 0x7e
    get OFFSET long
    get SIZE long
    get DUMMY long
    get XSIZE long
    log NAME OFFSET SIZE
    math OFFSET += SIZE
next


Source: http://forum.xentax.com/viewtopic.php?f=10&t=11266
Script:
get size asize
math size - 0xC
goto size
get files short
get FTsize long
get DATAsize long
goto DATAsize

for i = 0 < files
   get FULLNAME basename
   log MEMORY_FILE 0 0
   savepos offset
   getdstring dummy 0x14
   get size long
   get size2 long
   get NAMEsize long
   getdstring dummy 0xA
   savepos TMP
   get key byte
   goto TMP
   if key <= 0x80
      set key = 0x80
   endif
   get FILEoffset long
   math FILEoffset + 0x1e
   getdstring name NAMEsize
   putdstring name NAMEsize MEMORY_FILE
   filexor key MEMORY_FILE
   goto 0x00 MEMORY_FILE
   getdstring name NAMEsize MEMORY_FILE
   filexor ""
   string FULLNAME + "/"
   string FULLNAME + name
   log FULLNAME FILEoffset size
next i


Source: http://aluigi.altervista.org/bms/yoyogames.bms
Script:
# YoYo Games data.win (script 0.1.1)
#   IFF WAD file format
# script for QuickBMS http://quickbms.aluigi.org

quickbmsver "0.6.5"

math GENERIC_DUMP_FIXED_SIZE_ENABLED = 0    # keep it disabled for the moment

get FULL_SIZE asize
for CHUNK_OFFSET = 0 < FULL_SIZE
    getdstring CHUNK_NAME 4
    get CHUNK_SIZE long
    savepos CHUNK_OFFSET

    xmath CHUNK_LIMIT "CHUNK_OFFSET + CHUNK_SIZE"
    print "CHUNK %CHUNK_NAME% %CHUNK_OFFSET|x% %CHUNK_SIZE|x%"
    
    math FILES = 0
    
      if CHUNK_NAME == "FORM"   # the main chunk
        math FULL_SIZE = CHUNK_LIMIT
        math CHUNK_SIZE = 0

    elif CHUNK_NAME == "GEN8"

    elif CHUNK_NAME == "OPTN"

    elif CHUNK_NAME == "EXTN"

    elif CHUNK_NAME == "SOND"
        math SIZE = 0x24
        callfunction GENERIC_DUMP_FIXED_SIZE 1

    elif CHUNK_NAME == "SPRT"
        math GET_OFFSET = 0
        math GET_NAME   = 1
        math GET_NAME2  = 0
        math GET_SIZE   = 0
        callfunction DUMP_ENTRIES 1

    elif CHUNK_NAME == "BGND"
        math SIZE = 0x14
        callfunction GENERIC_DUMP_FIXED_SIZE 1

    elif CHUNK_NAME == "PATH"

    elif CHUNK_NAME == "SCPT"
        math SIZE = 0x8
        callfunction GENERIC_DUMP_FIXED_SIZE 1

    elif CHUNK_NAME == "FONT"

    elif CHUNK_NAME == "TMLN"

    elif CHUNK_NAME == "OBJT"
        math GET_OFFSET = 0
        math GET_NAME   = 1
        math GET_NAME2  = 0
        math GET_SIZE   = 0
        callfunction DUMP_ENTRIES 1

    elif CHUNK_NAME == "ROOM"
        math GET_OFFSET = 0
        math GET_NAME   = 1
        math GET_NAME2  = 1
        math GET_SIZE   = 0
        callfunction DUMP_ENTRIES 1

    elif CHUNK_NAME == "DAFL"

    elif CHUNK_NAME == "TPAG"

    elif CHUNK_NAME == "CODE"
        math GET_OFFSET = 0
        math GET_NAME   = 1
        math GET_NAME2  = 0
        math GET_SIZE   = 1
        callfunction DUMP_ENTRIES 1

    elif CHUNK_NAME == "VARI"

    elif CHUNK_NAME == "FUNC"

    elif CHUNK_NAME == "STRG"
        math FILES = -1
        get STRINGS long
        for i = 0 < STRINGS
            get DUMMY long
        next i
        for i = 0 < STRINGS
            get STRING_SIZE long
            math STRING_SIZE + 1
            slog "STRG.txt" -1 STRING_SIZE
        next i

    elif CHUNK_NAME == "TXTR"
        callfunction COLLECT_ENTRIES 1
        for i = 0 < FILES
            getarray OFFSET 0 i
            goto OFFSET
            get DUMMY long  # 1
            get OFFSET long
            putarray 0 i OFFSET
        next i
        
        math j = 0
        for i = 0 < FILES
            getarray OFFSET 0 i
            math j += 1
            getarray NEXT_OFFSET 0 j
            xmath SIZE "NEXT_OFFSET - OFFSET"
            putarray 1 i OFFSET
            putarray 2 i SIZE
            putarray 3 i "."
        next i

    elif CHUNK_NAME == "AUDO"
        callfunction COLLECT_ENTRIES 1
        for i = 0 < FILES
            getarray OFFSET 0 i
            goto OFFSET
            get SIZE long
            savepos OFFSET
            putarray 1 i OFFSET
            putarray 2 i SIZE
            putarray 3 i "."
        next i
    else
        print "Chunk %CHUNK_NAME% not supported"
    endif
    
    if FILES == 0
        # dump the whole chunk
        string NAME p= "%s/%s" CHUNK_NAME "."
        log NAME CHUNK_OFFSET CHUNK_SIZE

    elif FILES > 0
        for i = 0 < FILES
            getarray OFFSET 1 i
            getarray SIZE   2 i
            getarray NAME   3 i
            string NAME p= "%s/%s" CHUNK_NAME NAME
            log NAME OFFSET SIZE
        next i
    endif
    # FILES < 0 means that we don't want to extract files
    
    math CHUNK_OFFSET += CHUNK_SIZE
    goto CHUNK_OFFSET
next

startfunction COLLECT_ENTRIES
    math j = 0
    get FILES long
    for i = 0 < FILES
        get OFFSET long
        if OFFSET != 0
        if OFFSET u< CHUNK_LIMIT
            putarray 0 j OFFSET
            math j += 1
        endif
        endif
    next i
    putarray 0 j CHUNK_LIMIT
    math FILES = j
endfunction

startfunction DUMP_ENTRIES
    set NAME string "."

    callfunction COLLECT_ENTRIES 1
    
    for i = 0 < FILES
        getarray OFFSET 0 i
        goto OFFSET
        if GET_NAME != 0
            get NAME_OFF long
        endif
        if GET_NAME2 != 0
            get NAME2_OFF long
        endif
        if GET_SIZE != 0
            get SIZE long
            putarray 2 i SIZE
        endif
        if GET_OFFSET != 0
            get OFFSET long
        else
            savepos OFFSET
        endif
        if GET_NAME != 0
            goto NAME_OFF
            get NAME string
        endif
        if GET_NAME2 != 0
            goto NAME2_OFF
            get NAME2 string
            if NAME2 != ""
                string NAME += /
                string NAME += NAME2
            endif
        endif
        putarray 0 i OFFSET
        putarray 3 i NAME
    next i

    math j = 0
    for i = 0 < FILES
        getarray OFFSET 0 i
        math j += 1
        getarray NEXT_OFFSET 0 j
        xmath SIZE "NEXT_OFFSET - OFFSET"
        math SIZE -= 4      # NAME_OFF
        putarray 1 i OFFSET
        if GET_SIZE != 0
            getarray SIZE 2 i
        endif
        putarray 2 i SIZE
        #putarray 3 i NAME  # already set
    next i
endfunction

startfunction GENERIC_DUMP_FIXED_SIZE
    if GENERIC_DUMP_FIXED_SIZE_ENABLED != 0
        get FILES long
        for i = 0 < FILES
            get DUMMY long
        next i
        savepos OFFSET
        for i = 0 < FILES
            putarray 1 i OFFSET
            putarray 2 i SIZE
            putarray 3 i "."
            math OFFSET + SIZE
        next i
    endif
endfunction


Source: http://aluigi.altervista.org/bms/install4j.bms
Script:
# install4j extractor
# script for QuickBMS http://quickbms.aluigi.org

get EXT extension
if EXT == "dmg"
    print "you must extract all the *.dat files located in *Installer.app/Contents/Resources/app using 7-zip or another tool, then open these dat files with this script"
    cleanexit
endif

endian big
if EXT == "dat"
    math ARCHIVES = 1
    get ARCHIVE_SIZE asize
    putarray 0 0 ARCHIVE_SIZE
else
    # looks like this signature is fixed
    findloc OFFSET string "\xe8\xe4\x13\xd5" ""
    if OFFSET == ""
        findloc OFFSET string "0.dat\0" ""
        if OFFSET == ""
            print "Error: this file doesn't seem an install4j archive"
            cleanexit
        endif
        math OFFSET -= 2    # NAMESZ
        math OFFSET -= 4    # ARCHIVES
        math OFFSET -= 4    # SIGN
    endif
    goto OFFSET

    get SIGN long
    get ARCHIVES long
    for i = 0 < ARCHIVES
        get NAMESZ short
        getdstring NAME NAMESZ
        get DUMMY long
        get ARCHIVE_SIZE long
        putarray 0 i ARCHIVE_SIZE
    next i
endif
endian little

for i = 0 < ARCHIVES
    getarray ARCHIVE_SIZE 0 i
    savepos ARCHIVE_OFFSET
    getdstring SIGN 2
    if SIGN == "PK"
        # copy in the memory file
        log MEMORY_FILE ARCHIVE_OFFSET ARCHIVE_SIZE
    else
        # lzma
        comtype lzma86head
        clog MEMORY_FILE ARCHIVE_OFFSET ARCHIVE_SIZE ARCHIVE_SIZE
    endif

    # zip
    get zip_filesize asize              MEMORY_FILE
    for offset = 0 < zip_filesize
        get PK_SIGN long                MEMORY_FILE
        if PK_SIGN != 0x04034b50
            break
        endif
        get ver             short       MEMORY_FILE
        get flag            short       MEMORY_FILE
        get method          short       MEMORY_FILE
        get modtime         short       MEMORY_FILE
        get moddate         short       MEMORY_FILE
        get crc             long        MEMORY_FILE
        get comp_size       long        MEMORY_FILE
        get uncomp_size     long        MEMORY_FILE
        get name_len        short       MEMORY_FILE
        get extra_len       short       MEMORY_FILE
        getdstring name     name_len    MEMORY_FILE
        getdstring extra    extra_len   MEMORY_FILE
        savepos offset                  MEMORY_FILE

        if method == 0
            Log name offset uncomp_size MEMORY_FILE
        else
            if method == 8
                ComType deflate
            elif method == 1
                ComType unshrink
            elif method == 6
                ComType explode
            elif method == 9
                ComType deflate64
            elif method == 12
                ComType bzip2
            elif method == 14
                ComType lzmaefs
            elif method == 21
                ComType XMemDecompress
            elif method == 98
                ComType ppmd
            elif method == 99
                print "this script doesn't support AES encryption"
                cleanexit
            else
                print "unsupported compression method %method%"
                cleanexit
            endif
            CLog name offset comp_size uncomp_size MEMORY_FILE
        endif

        math offset += comp_size
        goto offset                     MEMORY_FILE
    next

    math ARCHIVE_OFFSET += ARCHIVE_SIZE
    goto ARCHIVE_OFFSET
next i


Source: http://aluigi.altervista.org/quickbms.htm
Script:
# Artifex Mundi *.cub (script 0.3.1)
#   Enigmatis
#   The Secret Order
# script for QuickBMS http://quickbms.aluigi.org

getdstring SIGN 3
goto 0
if SIGN != "cub"
    getvarchr TMP SIGN 0
    math TMP ^ 'c'
    filexor TMP
endif
idstring "cub\0"
get VER string
get FILES long
getdstring DUMMY 0x100
if FILES == 0
    get CUB_SIZE asize
    savepos OFFSET
    for OFFSET = OFFSET < CUB_SIZE
        callfunction DUMP 1
        math OFFSET += SIZE
        goto OFFSET
    next
else
    for i = 0 < FILES
        callfunction DUMP 1
    next i
endif

startfunction DUMP
    getdstring NAME 0x100
    if VER == "1.0"
        get OFFSET long
        get SIZE long
    else
        get OFFSET longlong
        get SIZE longlong
    endif

    savepos TMP
    goto OFFSET
    get SIGN long
    if SIGN == 0x12345678
        get DUMMY long
        get DUMMY long
        get DUMMY long
        get DUMMY short
        get NUM long
        math OLD_OFFSET = OFFSET
        savepos OFFSET
        xmath OFFSET "OFFSET + (NUM * 16)"
        xmath SIZE "SIZE - (OFFSET - OLD_OFFSET)"
    endif
    goto TMP

    log NAME OFFSET SIZE
endfunction


