Repository navigation
Ingest a full-file-system extraction zip as a source - #18
Merged
Merged
Conversation
Mobile extractions arrive as one zip holding the device filesystem under a single root folder, tens of gigabytes, with a large minority of members carrying no extension. Every step of the pipeline reads a file through a filesystem path, so a member has to be on disk to be hashed, thumbnailed or viewed. This adds a third Source kind, archive, detected by extension or magic ahead of the folder branch, which had been registering a zip as one file. gleapp/archive.py enumerates the central directory, strips the single root folder, sniffs every extension-less member from its first 16 bytes without extracting it, and stages media (or everything, with include_other) under <case>/staged/ as <slug>/<2 hex>/<sha1 of the member path>.<ext>. Flat and hashed because the codebase has no Windows long-path handling and members nest 20 levels deep, because case-variant names must not collide on a case-insensitive volume, and because member names carrying control characters must never reach the filesystem. path is the staged file, rel_path the member path minus the root, orig_path the member as stored. Timestamps come from the zip's extended field when present and the DOS date otherwise, and the meta table records which, per source, with the archive's own SHA-256 when a UFED .ufd sidecar is beside it. Encrypted members are skipped and counted; __MACOSX entries are ignored everywhere, including in the root computation. Measured on registered images. Android, 14.2 GiB: 3,934 media registered in 6.0 s, of which only 1,085 were media by extension, 463 MiB staged, all timestamps from the extended field, every staged file byte-equal to its central-directory size, processed in 16 s with 97 errors that are all streaming-cache fragments the pipeline already labels. iOS, 12.1 GiB: 43,918 registered in 27.7 s, 3.3 GiB staged, all timestamps DOS. Tests build a synthetic zip covering the root strip, both timestamp sources, a case-variant pair, an extension-less image, a control-character name, a 300-character path, __MACOSX junk, a member flagged encrypted in the finished bytes, a .ufd sidecar, and include_other. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a third source kind,
archive, so a full-file-system extraction zip can be ingested directly:python gleapp.py -c case ingest EXTRACTION_FFS.zip, the same path through the web launcher. Before this a zip fell into the folder branch and was registered as one file.gleapp/archive.pyenumerates the central directory, strips the single root folder, sniffs every extension-less member from its first 16 bytes without extracting it, and stages media (or everything withinclude_other) under<case>/staged/as<slug>/<2 hex>/<sha1 of member path>.<ext>. Flat and hashed because there is no Windows long-path handling here and members nest 20 levels deep, because case-variant names must not collide on a case-insensitive volume, and because names carrying control characters must never reach the filesystem.pathis the staged file,rel_paththe device path with the root stripped,orig_paththe member as stored. Timestamps use the zip's extended field when present and the DOS date otherwise;metarecords which per source, plus the archive's SHA-256 when a UFED.ufdsidecar is beside it. Encrypted members are skipped and counted;__MACOSXis ignored everywhere.Measured on registered images. Android, 14.2 GiB: 3,934 media registered in 6.0 s, only 1,085 of them media by extension, 463 MiB staged, every staged file byte-equal to its central-directory size, processed in 16 s. The 97 processing errors are all ExoPlayer
.exofragments, audio-only.m4aand empty cache files, labeled by the pipeline's existing messages. iOS, 12.1 GiB: 43,918 registered in 27.7 s, 3.3 GiB staged.Tests build a synthetic zip covering the root strip, both timestamp sources, a case-variant pair, an extension-less image, a control-character name, a 300-character path,
__MACOSXjunk, a member flagged encrypted in the finished bytes, a.ufdsidecar, andinclude_other. The suite runs on Windows in CI, which is the proof for the flat layout.Follow-ups, not here: tar and tar.gz through the same shape; a registered-but-unstaged mode; Android storage-view awareness in stacking; audio-only ISOBMFF sniffed as video, which predates this change.
🤖 Generated with Claude Code