An unzip program

Motivation

It'd be nice to simply ZIP multiple files before loading into the OS: fonts, small BMP images, other uncompressed data. ZIP primarily uses the Deflate algorithm and after finishing a Deflate decompressor for PNG, it was fairly simply to make an unzip.

ZIP file

local_file_header
local_file_header
local_file_header
local_file_header
local_file_header
...

For a simple ZIP file each compressed file and folder names are described by a local_file_header.

For folders, uncompressed size is zero.

For Deflate compressed files, compression_method==8.

For uncompressed files, compression_method==0.

Unzipping

Simply allocate uncompressed size bytes and call Inflate(). This is the same code I used for the PNG decoder.

After inflating the uncompressed file is in memory.

Source code

Soon..

20121012