KOFXIII: unpacking cps
Posted: Sun Jun 19, 2011 5:33 am
The contents of this post was deleted because of possible forum rules violation.
Code: Select all
# The King of Fighters XIII CPS unpacker
# script for QuickBMS http://aluigi.org/papers.htm#quickbms
idstring "TEXLIST\0"
get MAX_OFFSET long
get DUMMY long
for i = 0
savepos OFFSET
if OFFSET >= MAX_OFFSET
cleanexit
endif
getdstring TYPE 8
get FULLZSIZE long
get DUMMY long
get DUMMY long
get ZIP long
get FULLZSIZE long
get DUMMY long
get CHUNKS long
get DUMMY long
math SIZE = 0x10000
savepos NEXT_OFF
math TMP = CHUNKS
math TMP *= SIZE
putvarchr MEMORY_FILE TMP 0
log MEMORY_FILE 0 0
append
for j = 0 < CHUNKS
get ZSIZE long
savepos OFFSET
clog MEMORY_FILE OFFSET ZSIZE SIZE
math OFFSET += ZSIZE
goto OFFSET
next j
append
get NAME basename
string NAME += "_"
string NAME += TYPE
string NAME += i
get SIZE asize MEMORY_FILE
log NAME 0 SIZE MEMORY_FILE
math NEXT_OFF += FULLZSIZE
goto NEXT_OFF
next i