Skip to content

Read an E01 acquisition as a source and carve its media - #42

Merged
abrignoni merged 2 commits into
mainfrom
feat/e01-carve-source
Sep 9, 2026
Merged

abrignoni merged 2 commits into
mainfrom
feat/e01-carve-source

Conversation

@abrignoni

@abrignoni abrignoni commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

Adds EnCase/EWF acquisitions (.E01 and its numbered segments) as a fourth source kind. An acquisition holds a disk rather than a list of members, so its media is carved by signature and each hit is registered by the offset it was found at, which is what a tar member already records.

  • Recognised by the EWF signature before the zip and tar checks, so the first segment opens the set and the extension is never consulted.
  • Reference mode reads a carved file back by seeking into the reconstructed disk; staging writes it out in pieces, since a carved video can be gigabytes.
  • Carved rows carry no date. The image file's own modification time belongs to the copy on this machine, not to the carved file.
  • Relink and unstage check the acquisition instead of a member list: media size, the hash the acquiring tool recorded, and every recorded extent lying inside it. source_status counts the segments still on disk, so a missing later segment shows as changed.
  • ewfprobe and mediacarve are vendored verbatim under gleapp/vendor/, both MIT and standard library only. The suite asserts their hashes; tools/check_vendored.py compares against an upstream checkout.

Measured on a 232.9 GiB acquisition of a Windows drive, 15 segments, written by FTK Imager: 118,930 files in 23 minutes at 435 MB, nothing copied out. On a 28.6 GiB single-segment acquisition, 43 images in 136 seconds, processed with zero errors on a 612 KB case.

12 new tests with an in-suite EWF writer, each of five deliberate breaks turning a different one red.

🤖 Generated with Claude Code

An extraction archive is a list of members. A computer acquisition is a disk, so
there is nothing to enumerate: the acquired disk is scanned for image and video
signatures and each hit is registered by the offset it was found at. Everything
after that is the machinery a tar already uses, because member_offset is a byte
offset either way.

- archive_format recognises the EWF signature before the zip and tar checks, so a
  set is opened from its first segment and the extension is never consulted.
- Reference mode reads a carved file back by seeking to its offset in the
  reconstructed disk; staging writes it out in pieces, since a carved video can
  be gigabytes.
- Carved rows carry no date. The image file's own modification time is a property
  of the copy on this machine and would read as the carved file's date in every
  report column that shows one.
- Relink and unstage have no member list to check, so they check the acquisition:
  media size and the hash the acquiring tool recorded, plus every recorded extent
  lying inside it. source_status also counts the segments still on disk, so a
  missing later segment shows as changed rather than reading fine until something
  asks for bytes that live in it.
- ewfprobe and mediacarve are vendored verbatim under gleapp/vendor with their
  provenance in vendored.json; both are MIT and standard library only. The suite
  asserts their hashes, and tools/check_vendored.py compares against an upstream
  checkout and rewrites the record after a deliberate re-vendor.

Measured on a 232.9 GiB acquisition of a Windows drive, 15 segments, written by
FTK Imager: 118,930 files registered in 23 minutes at 435 MB, reference mode,
nothing copied out. On a 28.6 GiB single-segment acquisition, 43 images in 136
seconds, then processed with zero errors on a case of 612 KB.

Co-Authored-By: Claude Opus 5 <[email protected]>
@abrignoni
abrignoni force-pushed the feat/e01-carve-source branch from 3dd5b06 to 345e9c0 Compare September 9, 2026 01:59
A vendored file is a copy, kept byte-identical to what upstream published and
checked against a recorded hash by the suite. Its style is not this repo's to
change: editing one to satisfy a linter is the edit the vendoring convention
exists to prevent, and the next re-vendor would revert it anyway. Two warnings in
the two copies were failing the gate on this branch for exactly that reason.

The vendor package's own __init__.py stays in the set, because that file is ours.

Also silences an import-error on the test helper beside the suite. pytest puts
that directory on the path; whether pylint resolves it depends on the interpreter
it runs under, and on 3.14 it does not.

Co-Authored-By: Claude Opus 5 <[email protected]>
@abrignoni
abrignoni merged commit ed1c32c into main Sep 9, 2026
8 checks passed
@abrignoni
abrignoni deleted the feat/e01-carve-source branch September 9, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant