Skip to content

unzip a zip file loaded in a buffer and decompress it

Notifications You must be signed in to change notification settings

vonzorich/unziptomemory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

unziptomemory

unzip compressed buffer to memory. Derived from gzip source code.

Compilation:

    gcc -D_GNU_SOURCE main.c inflate.c

usage:

list files in the zip archive:

            bzero(&zip);
            zip.inbuf = CompressedDataBufer;
            zip.inbufsiz = CompressedDataBufferSize;
            unzip(&zip, NULL);

get decompressed data size for given file "foo/bar"

            bzero(&zip);
            zip.inbuf = CompressedDataBufer;
            zip.inbufsiz = CompressedDataBufferSize;
            unzip(&zip, "foo/bar");

decompresse given file "foo/bar"

            bzero(&zip);
            zip.inbuf = CompressedDataBufer;
            zip.inbufsiz = CompressedDataBufferSize;
            zip.outbuf = malloc(DecompressedDataSize);
            unzip(&zip, "foo/bar");

About

unzip a zip file loaded in a buffer and decompress it

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages