Code: Select all
#script by chrrox
#use quickbms
#http://aluigi.altervista.org/quickbms.htm
open FDSE "package_data.bin" 1
comtype zlib_noerror
goto 0x68 1
get FILES long 1
goto 0x80 1
get NSTART1 long 1
get LNKNAME1 long 1
get UNK long 1
get SEC3START long 1
math LNKNAME1 + 0x90
savepos TMP 1
goto LNKNAME1 1
get REMOVE string 1
string REMOVE + /
get LNKFILE string 1
string LNKFILE R REMOVE ""
open FDSE LNKFILE
goto TMP 1
for i = 0 < FILES
set MEMORY_FILE2 binary ""
set MEMORY_FILE3 binary ""
goto TMP 1
get HASH long 1
get UNK1 long 1
get NOFF long 1
get UNK2 long 1
get UNK3 long 1
get FLAG long 1
get UNK4 longlong 1
get UNK5 long 1
get UNK5 long 1
get FBASE long 1
savepos TMP 1
math NOFF + 0x90 1
math NOFF + NSTART1 1
goto NOFF 1
get NAME string 1
#print "%NAME%"
math FBASE * 0x20
math FBASE + 0x20
goto FBASE
get OFFSET longlong
get SIZE longlong
get ZSIZE longlong
get COMP longlong
#print "1 %OFFSET% %SIZE% %ZSIZE% %COMP%"
if SIZE > ZSIZE
log MEMORY_FILE2 OFFSET ZSIZE
append
do
get CSIZE long MEMORY_FILE2
savepos COFF MEMORY_FILE2
#print "Yay %SIZE% %COFF% %CSIZE%"
if SIZE > 0x4000
math CSIZE & 0x7FFF
#print "%COFF% %CSIZE%"
clog MEMORY_FILE3 COFF CSIZE 0x4000 MEMORY_FILE2
math SIZE - 0x4000
math COFF + CSIZE
goto COFF MEMORY_FILE2
padding 16 MEMORY_FILE2
else
math CSIZE & 0x7FFF
clog MEMORY_FILE3 COFF CSIZE SIZE MEMORY_FILE2
math SIZE - SIZE
endif
while SIZE > 0
append
get TSIZE asize MEMORY_FILE3
log NAME 0 TSIZE MEMORY_FILE3
else
log NAME OFFSET ZSIZE
endif
next i