bojand / infer

Small crate to infer file and MIME type by checking the magic number signature
MIT License
299 stars 28 forks source link

Zip archive not recognized #52

Closed jdm closed 2 years ago

jdm commented 3 years ago

https://www.digitalmzx.com/download/544/c48ebe20995cd217d62776aeb4c90cb57872377a2c6e83cacc7d714360053e82/ is an archive that starts with 50 4b 30 30. The file command reports Zip archive data for it, and the macOS unarchiver opens it without issue. is_zip returns false for it, however.

jdm commented 3 years ago

Interestingly, immediately following those first four bytes is the expected 50 4b 03 04.

jdm commented 3 years ago

According to https://hybridego.net/m/entry/File-Header?category=185127 50 4b 30 30 50 4b 03 04 is a winzip archive.

jdm commented 3 years ago

https://stackoverflow.com/questions/12039237/how-to-check-if-zip-file-is-split-across-multiple-archives-using-pythons-zipfil explains why this difference exists.

marcospb19 commented 2 years ago

Related to #49? Hmm