onekey-sec / unblob

Extract files from any kind of container formats
https://unblob.org
Other
2.16k stars 80 forks source link

fix(handler): add support for zip64 values in Central Directory Headers #820

Closed nyuware closed 6 months ago

nyuware commented 6 months ago

ZIP64 is the standard that replaces zip, its designated to "fix" the 4gb size limit of zip. In the format, it means that some values can be changed to FFFF, for example : offset_of_cd or central_directory_size can be 0xFFFFFFFF, indicating it's a zip64.

Some time last week, some zip files were not being extracted, after analysis it seemed that their central directory also had FFFF values.

So in this PR, I added a new definition, is_zip64_cd, to check if the corresponding values indicate zip64

New integration tests are also added, we simply use zip -fz to create those zip64 files.

Fixes #819

qkaiser commented 6 months ago

@nyuware Your changes are also making some unit tests fail, specifically the ones running on corrupt ZIP files. Please investigate why.