Expand description
Container-format detection (magic-sniff) — which decoder a disk image needs.
disk4n6 analyses a Read + Seek view of a disk. Most evidence arrives
wrapped in a container (E01, VHD/VHDX, VMDK, QCOW2, AFF4, DMG); this sniffs
the magic so an opener can pick the right decoder. The magics come from the
forensicnomicon knowledge modules (single source of truth). A flat raw/dd
image has no wrapper and is analysed in place.
Structs§
- Opened
Image - A decoded, analysable disk image.
Enums§
- Container
Format - A detected disk-image container format.
- Open
Error - Failure opening/decoding an image.
Traits§
- Read
Seek - Anything that can be both read and seeked — the disk view
analyse_diskconsumes. A blanket impl covers everyRead + Seek, so a decoder’s reader or a plainFileboth box intoBox<dyn ReadSeek>.
Functions§
- detect
- Sniff the container format from a disk image’s
header(its first bytes, ideally ≥512) andfooter(its last 512 bytes — VHD’sconectixcookie and DMG’skolytrailer live at the end of the file). - open
- Open
path, sniff its container format, and return a decodedRead + Seekdisk view: raw images pass through; E01/EWF is decoded; other recognized containers returnOpenError::Unsupported. - sniff
- Sniff the container format of a seekable image: read its header and trailing
footer, classify via
detect, and rewind the reader to 0 for the caller. A sub-512-byte image is read without a footer.