Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't open zip file Unhandled exception: Unsupported zip archive [ZippyError] (deflate64) #11

Open
bung87 opened this issue Mar 30, 2021 · 6 comments

Comments

@bung87
Copy link

bung87 commented Mar 30, 2021

https://github.com/bung87/finder/tree/zippy

I previously use std zip lib which works fine and test passed, when switch to zippy I got Unhandled exception: Unsupported zip archive [ZippyError]

the zip file compression through mac context menu, am on
platform: macOS
nim version: 1.4.4

@guzba
Copy link
Owner

guzba commented Mar 30, 2021

This happens when the general purpose value has the "data descriptor" bit set. I do not support this now. I've not seen a zip archive with it used. How did you create a the zip archive with this flag set? I'd be curious to see if I can reproduce that and add support and tests for this flag being set.

https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

@bung87
Copy link
Author

bung87 commented Mar 30, 2021

I checked the general purpose flag , echo tobin(generalPurposeFlag.int,16) on mac outputs 0000000000001000
https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT described as
Bit 4: Reserved for use with method 8, for enhanced
deflating.

I compressed directory through mac context menu Compress menu item , don't know the underling software flags.
you can check Archive.zip under tests folder , it extract fine with std zip lib and mac The Unarchiver

@guzba
Copy link
Owner

guzba commented Mar 30, 2021

Hm, it looks like Mac is writing Zip64 files sometimes. I know I've tested with Mac archives that worked fine in the past.

Zip64 are different from standard Zip files even though they share an extension. Zip64 is generally supported in most places. There isn't much for docs on this and they are not clear as to what exactly 'enhanced deflating" is. I'm assuming it means Deflate64 instead of standard Deflate for compression.

Deflate64 is not the same as standard Deflate. It is different enough to require quite a bit of work and is not something I plan to work on in the short term, sorry.

@bung87
Copy link
Author

bung87 commented Mar 30, 2021

After google found deflate64 also called "enhanced deflate" is PKWare proprietary, that's why I can't find any open source implementation.

@guzba
Copy link
Owner

guzba commented Mar 31, 2021

It's interesting that Mac is generating zip archives with enhanced deflate. If we learn more we can add it to this issue. I'm going to add "deflate64" to the issue title too quick.

@guzba guzba changed the title can't open zip file Unhandled exception: Unsupported zip archive [ZippyError] can't open zip file Unhandled exception: Unsupported zip archive [ZippyError] (deflate64) Mar 31, 2021
@bung87
Copy link
Author

bung87 commented Mar 31, 2021

yeah , I think std zip module can work because its zip header point to PKWare's header not the open source zlib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants