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

Archive cannot be unzipped with unzOpen_MZ but works with mz_zip_reader_open_file #822

Open
Coeur opened this issue Nov 11, 2024 · 2 comments · May be fixed by #827
Open

Archive cannot be unzipped with unzOpen_MZ but works with mz_zip_reader_open_file #822

Coeur opened this issue Nov 11, 2024 · 2 comments · May be fixed by #827

Comments

@Coeur
Copy link
Contributor

Coeur commented Nov 11, 2024

Books.zip

This archive can be opened with mz_zip_reader_open_file, but cannot be opened with unzOpen_MZ.

I also tried adding mz_zip_set_recover(handle, 1); to unzOpen_MZ, but that wasn't enough to succeed at opening the file.

It can be opened with native macOS Archive Utility (aka, double-click to open the zip file on macOS).

@pmqs
Copy link
Contributor

pmqs commented Nov 12, 2024

Not sure what the issue is with the Books.zip file, but both unzip and minizip command line can extract it fine. 7z will also extract the contents as well, but it complains about a Headers Error. Frustratingly, there is no more detail about what the issue is.

Nothing is jumping out at me that is strange with the contents of the zip file. Looks like a standard plain vanilla zip file that doesn't use any extended attributes.

@pmqs
Copy link
Contributor

pmqs commented Nov 12, 2024

I see what the problem is with the Books.zip file.

Below is a dump of the EOCD header from the zip file. The Entries in this disk field is set to 70. The Total Entries field is set to 35, which matches the number of entries in the zip file.

For a single part zip file the Entries in this disk and Total Entries value should be identical

4D435 4D438 00004 50 4B 05 06 END CENTRAL HEADER    06054B50 (101010256)
4D439 4D43A 00002 00 00       Number of this disk   0000 (0)
4D43B 4D43C 00002 00 00       Central Dir Disk no   0000 (0)
4D43D 4D43E 00002 46 00       Entries in this disk  0046 (70)
4D43F 4D440 00002 23 00       Total Entries         0023 (35)
4D441 4D444 00004 85 0C 00 00 Size of Central Dir   00000C85 (3205)
4D445 4D448 00004 B0 C7 04 00 Offset to Central Dir 0004C7B0 (313264)
4D449 4D44A 00002 00 00       Comment Length        0000 (0)

When I changed the Entries in this disk field to35 a 7z t Books.zip didn't show any errors.

@Coeur Coeur linked a pull request Nov 13, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants