Extract/deflate zlib without knowing extracted size

Programming related discussions related to game research
happydance
Posts: 81
Joined: Sun Jul 10, 2016 11:07 am

Extract/deflate zlib without knowing extracted size

Post by happydance »

is it possible to create a bms script Extract/deflate zlib without knowing extracted size like how offzip works? I cant use offzip since some files are not extracted properly (some are cut) and the TOC is encrypted and I got no clue how to decrypt it.

I tried this, jus by giving it a big extract files, it works with some but fails on most

Code: Select all

log MEMORY_FILE 0 0
clog MEMORY_FILE OFFSET ZSIZE 0x1000000
GetDString EXT 0x3 MEMORY_FILE
string NAMEZ p= "%s_%05d.%s" NAME i EXT
get EXTRACT_SIZE ASIZE MEMORY_FILE
log NAMEZ 0 EXTRACT_SIZE MEMORY_FILE


not sure if there is a proper computation to be done, can anyone help?
happydance
Posts: 81
Joined: Sun Jul 10, 2016 11:07 am

Re: Extract/deflate zlib without knowing extracted size

Post by happydance »

Never mind... it seems the zsize im giving it is wrong and I really need to decrypt the TOC to get the proper zsize, size and offsets

any idea where should I start to decrypt the TOC of this file format?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Extract/deflate zlib without knowing extracted size

Post by aluigi »

Regarding the decompression with unknown compressed/decompressed size, use: comtype unzip_dynamic