Skip to main content

Crate zip_core

Crate zip_core 

Source
Expand description

Forensic-grade ZIP reader.

The headline capability is deflate-block-indexed random access: a forensic image stored in a ZIP (an E01 Defl:N entry at ~0% compression) is, at the deflate level, a run of stored blocks (BTYPE=00). Those blocks are byte-aligned, so the uncompressed entry can be addressed at any offset by seeking directly to the right block — without inflating from the start. This lets a downstream reader (e.g. the EWF parser) random-access a multi-GB image inside a ZIP with no temp extraction and no repeated decompression.

Genuinely-compressed entries fall back to a correctness-preserving full decompress (no worse than extracting the entry), so the type is universal.

Structs§

ArchiveSummary
Container-level offsets/counts, for the forensic analyzer’s structural audits (trailing data, spanning, etc.). Returned by ZipArchive::summary.
EntryLayout
One entry’s raw structural layout: the central-directory and local-file-header copies of its fields plus offsets, for cross-checking (tamper detection).
HeaderFields
Header fields as recorded in one header copy (central directory OR local file header). Exposed via ZipArchive::structural_view for the forensic seam.
StoredZipEntry
A random-access view over one uncompressed ZIP entry.
ZipArchive
A parsed ZIP archive over a seekable reader.
ZipFile
A decoding reader over one ZIP entry. Implements Read, yielding decompressed bytes and verifying CRC-32 at EOF (fail loud on mismatch).

Enums§

CompressionMethod
ZIP compression method, mirroring zip-rs CompressionMethod for the common methods plus an Unknown(raw) that preserves the offending value.
FormatError
Structural defects in a ZIP container. Each variant preserves the offending value/location (CLAUDE.md “Show the unrecognized value”).
ZipCoreError
Errors from opening or reading a ZIP entry.

Functions§

open_entry
Open a single entry of a ZIP archive for random access.