Read raw disk images and E01 acquisitions with -t raw · abrignoni/iLEAPP@809b19d · GitHub
Skip to content

Commit 809b19d

Browse files
abrignoniclaude
andcommitted
Read raw disk images and E01 acquisitions with -t raw
A disk image (.img, .dd, .bin, or any numbered segment of a split set) or an EnCase/EWF .E01 acquisition is now an input. The image is read in place through qnxprobe and ewfprobe, vendored verbatim under scripts/vendor/ and guarded by a manifest check in CI; its NTFS, FAT32, exFAT, ext2/3/4, HFS+, APFS, QNX6, QNX4, ETFS, EFS and QNX IFS volumes are walked once for their names and only the files an artifact's pattern selects leave the image. scripts/raw_image.py holds the seeker and is byte-identical across the LEAPP cores. The entry point gains the -t choice, the dispatch branch and a finally that releases the seeker on every exit; the GUI maps the conventional image extensions onto raw and lists them in its file dialog; the corpus validator honours an entry-level input_type. Tests stage the NTFS, FAT32 and exFAT fixtures and check every byte against hash lists written by other readers, and build an E01 set and a split set from the same fixture. The frozen CLI is smoke-tested on the NTFS fixture. admin/scripts/check_vendored.py now reads the manifest for every vendored copy, checks each copy's hash and fetches the upstream file at its recorded commit; a copy that opens with a vendoring banner is compared below the banner. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent 3ad7043 commit 809b19d

25 files changed

Lines changed: 11972 additions & 439 deletions

‎.github/workflows/python_lint.yml‎

Lines changed: 8 additions & 7 deletions

‎.github/workflows/test_builds.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,23 @@ jobs:
9999
dist_build\ileapp.exe -t fs -i smoke_in -o smoke_out
100100
if ($LASTEXITCODE -ne 0) { exit 1 }
101101
102+
# A raw image is read through the vendored reader imported as a module, which
103+
# is the path a frozen build is most likely to break: an earlier design ran the
104+
# reader as a subprocess through sys.executable, and in a bundle that is the
105+
# tool itself, so -t raw could never work frozen and nothing smoke-tested it.
106+
- name: Smoke test the frozen CLI on a raw image
107+
shell: pwsh
108+
run: |
109+
New-Item -ItemType Directory -Path smoke_raw_out | Out-Null
110+
python -c "import gzip, shutil; shutil.copyfileobj(gzip.open('admin/test/data/raw_images/ntfs-fixture.img.gz'), open('smoke_in/ntfs-fixture.img', 'wb'))"
111+
dist_build\ileapp.exe -t raw -i smoke_in\ntfs-fixture.img -o smoke_raw_out
112+
if ($LASTEXITCODE -ne 0) { exit 1 }
113+
$log = Get-ChildItem -Path smoke_raw_out -Recurse -Filter "Screen_Output.html" | Select-Object -First 1
114+
if (-not $log) { Write-Error "no run log was written"; exit 1 }
115+
if (-not (Select-String -Path $log.FullName -Pattern "walked lba0: 4" -Quiet)) {
116+
Write-Error "the frozen build did not walk the NTFS fixture"; exit 1
117+
}
118+
102119
- name: Verify the parser is bundled inside the frozen CLI
103120
# The artifact must read tracev3 natively on the examiner's machine with
104121
# nothing else installed. A onefile exe unpacks at runtime, so check the
@@ -176,6 +193,15 @@ jobs:
176193
echo placeholder > smoke_in/placeholder.txt
177194
dist_build/ileapp -t fs -i smoke_in -o smoke_out
178195
196+
# Same on Linux: the frozen build has to read a raw image through the vendored
197+
# reader imported as a module, and the run log has to show the walk.
198+
- name: Smoke test the frozen CLI on a raw image
199+
run: |
200+
mkdir smoke_raw_out
201+
python -c "import gzip, shutil; shutil.copyfileobj(gzip.open('admin/test/data/raw_images/ntfs-fixture.img.gz'), open('smoke_in/ntfs-fixture.img', 'wb'))"
202+
dist_build/ileapp -t raw -i smoke_in/ntfs-fixture.img -o smoke_raw_out
203+
grep -rq "walked lba0: 4" smoke_raw_out --include="Screen_Output.html" || { echo "the frozen build did not walk the NTFS fixture"; exit 1; }
204+
179205
- name: Verify the parser is bundled inside the frozen CLI
180206
# The workpath subfolder is named after the spec file: ileapp_Linux here,
181207
# not ileapp as on Windows.

‎README.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,16 @@ The output folder must exist before running. Source builds report a `-dev` versi
205205

206206
```
207207
python ileapp.py -t zip -i /path/to/extraction.zip -o /path/to/output/
208+
python ileapp.py -t raw -i /path/to/acquisition.E01 -o /path/to/output/
208209
```
209210

211+
`raw` reads a disk image (`.img`, `.dd`, `.bin`, or any numbered `.001` segment of
212+
a split set), or an EnCase/EWF `.E01` acquisition and the segments beside it, in
213+
place: no mounting and no administrator rights. Its NTFS, FAT32, exFAT, ext2/3/4,
214+
HFS+, APFS, QNX6, QNX4, ETFS, EFS and QNX IFS volumes are searched directly, and
215+
only the files an artifact asks for are read out of the image. The GUI picks
216+
`raw` on its own for those extensions. See `admin/docs/raw_image_input.md`.
217+
210218
**GUI:**
211219

212220
```

‎admin/docs/raw_image_input.md‎

Lines changed: 122 additions & 0 deletions

0 commit comments

Comments
 (0)