Skip to content

Commit

Permalink
fix(zip): handle ZIP64 files missing indicators of ZIP64.
Browse files Browse the repository at this point in the history
Sometimes large zip files created with 7z are missing indicators that they're
ZIP64 (see is_zip64() implementation for details on heuristics we use to
detect ZIP64).

Since we can't rely on our heuristics, we simply fallback to ZIP64 if we
can't find ZIP32 EOCDs.
  • Loading branch information
qkaiser committed Jun 10, 2024
1 parent 9df71b6 commit 7a7780d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion unblob/handlers/archive/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ def calculate_chunk(self, file: File, start_offset: int) -> Optional[ValidChunk]
if offset == end_of_central_directory_offset:
break
else:
raise InvalidInputFormat("Missing EOCD record header in ZIP chunk.")
# if we can't find 32bit ZIP EOCD, we fall back to ZIP64
end_of_central_directory = self._parse_zip64(file, start_offset, offset)

has_encrypted_files = self.has_encrypted_files(
file, start_offset, end_of_central_directory
Expand Down

0 comments on commit 7a7780d

Please sign in to comment.