Unzip a zip file using zlib

后端 未结 3 1653
轻奢々
轻奢々 2020-12-05 08:49

I have an archive.zip which contains two crypted \".txt\" files. I would like to decompress the archive in order to retrieve those 2 files.

Here\'s what I\'ve done

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-05 09:00

    zip is a file format that wraps header and trailer information around compressed data streams in order to represent a set of files and directories. The compressed data streams are almost always deflate data streams, which can in fact be generated and decoded by zlib. zlib also provides the crc32 function which can be used to generate and check the crc values in the zip wrapper information.

    What zlib does not do by itself is decode and deconstruct the zip structure. You can either write your own code to do that using the specification (not very hard to do), or you can use the minizip routines in the contrib/minizip directory of the zlib distribution, which provides functions to open, access, and close zip files.

提交回复
热议问题