Tuesday, 16 April 2013

Extracting ZLIB compressed data from any file

This is very usefull for analysing file formats that contain compressed data.

You can use a handy tool by Luigi Auriemma found here http://aluigi.altervista.org/mytoolz.htm#offzip

Extract it and put it in a directory somewhere, for example

Make sure you choose a drive with lots of space.

In the directory, make a bat file called extract.bat
With these contents

mkdir %1.out\
offzip -a %1 %1.out\ 0

this will make a directory for your extracted data to go into so things don't get messy it will be the file name with .out at the end of it.
Then it will instruct offzip to find all compressed data it can in your file and extract the parts out into the directory made. It will start from offset 0

You can see the address the compressed data was found at in its filename.

Quite handy.

I also came across a great blog here, http://www.se7ensins.com/forums/threads/tut-how-to-mod-darksiders-using-offzip-and-packzip.153898/
Which shows how you can, extract->Edit->pack back in to edit game save files.


  1. Compressed zlib data starts with an x character.
    And in most archive formats it will have some idea of the files compressed and uncompressed sizes probably right before the compressed data.

  2. This comment has been removed by a blog administrator.