Files
ImHex-Patterns/patterns
Nicolás Alvarez 01a1bd0d9f patterns/zip: Change how the end of central directory record is found (#60)
Previously, the zip pattern was searching for the end-of-central-directory
header signature (50 4B 05 06) by searching the entire file for it. This is
*very* slow for large files, and risks false positives since those bytes
could randomly appear in compressed data. I had this happen on the first
large (>2GB) zip file I tried.

I'm now checking for the EOCD signature at exactly 22 bytes from the end of
the file (in the common case there is no zip comment), and if that fails
I search for it in the last 64KB of the file (in case there *is* a comment
at the end of the EOCD, which can't be larger than 64KB). This is much
faster, and fixes loading my zip file where it was spuriously finding the
signature in the wrong place.

This still has a low risk of false positives (what if the comment has the
50 4B 05 06 bytes? what if there is a short comment but the signature
appears in the last 64KB of compressed data?), but I don't know what's the
"right" way to find the EOCD, or how proper zip-reading tools handle the
ambiguity...
2022-11-19 18:05:26 +01:00
..
2022-08-27 12:41:59 +02:00
2021-03-30 20:55:14 +02:00
2022-09-07 14:42:38 +02:00
2022-03-01 17:02:32 +01:00
2022-07-26 08:48:01 +02:00
2022-02-19 17:57:01 +01:00
2020-12-12 00:29:36 +01:00
2022-09-08 13:29:55 +02:00
2022-08-29 15:02:08 +02:00
2022-08-29 15:23:43 +02:00
2022-02-13 01:05:44 +01:00
2022-08-31 15:08:32 +02:00