These games are usually packed into one huge exe. Skipping past the PE stuff, I get to some data.
For this script, I'm sort of just roughly skipping all the PE related stuff to find the start of the actual data I want.
The data begins with the idstring "wwww"
Code: Select all
# Fusion resource
# just some rough skipping
startfunction read_PE
idstring "MZ"
goto 60
get PE_HEADER_OFS long
goto PE_HEADER_OFS
idstring "PE\x00\x00"
get machine short
get SECTIONS short
getdstring skip 12
get OPT_HEADER_SIZE short
get characteristics short
goto OPT_HEADER_SIZE 0 SEEK_CUR
for i = 0 < SECTIONS
getdstring name 8
print %name%
get virtSize long
get virtAddr long
get rawSize long
get rawOfs long
getdstring others 16
next i
math rawOfs += rawSize
goto rawOfs
endfunction
#skip PE stuff
callfunction read_PE
savepos START
print "data start: %START%"
# now at start of data
comtype unzip_dynamic
idstring "wwww"
get unk long
get table_Ofs long
get PAM_OFS long
math PAM_OFS += START
math PAM_OFS -= 32
get unk long
get null long
get null long
get unk long
print "Main PAMU archive: %PAM_Ofs%"
for i = 0
get len short
math len *= 2
getdstring UNAME len
set NAME UNICODE UNAME
get unk long
get SIZE long
savepos OFFSET
#print "%NAME% %OFFSET%"
clog NAME OFFSET SIZE SIZE
math OFFSET += SIZE
print %PAM_OFS%
if OFFSET == PAM_OFS
break
endif
goto OFFSET
next i
print %OFFSET%
# start PAMU archive
Some archives are different from others. I'm looking at one where there are filenames and the data is totally uncompressed. Others are zlib compressed and it seems like the filename and data are zlib compressed in two streams: first you decompress a chunk to get the file name, then you decompress another chunk to get the actual data with that file.
Though, not sure if that holds for all files.
Sample PAMU archive: http://www.mediafire.com/?k288j278kfyc7f9


