Adds read-extraction for Xbox 360 STFS container packages#9
Merged
Conversation
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.
STFS extraction
xtafkit extract-stfs <PACKAGE>for streaming Xbox 360 STFS containers (CON / LIVE / PIRS) to a local directory.--to <DIR>overrides the destination;--dry-runlists the entries with sizes and totals;--jsonemits machine-readable output for both dry-run and post-extract modes.--to) is./<DisplayName>/taken straight from the STFS header — no catalog lookup, no[TitleID]suffix. The per-packagedisplay_nameis consistently more specific than the title-id catalog mapping (notably for XBLIG, where every indie game shares the same system title-id and the catalog can only return a generic bucket name)."STFS type 0 (read-write) not supported yet"error rather than producing wrong output.0xAAblocks, L1 every0x70E4, L2 every0x4AF768. Inline boundary tests pin offsets at0xA9,0xAA,0x70E3,0x70E4against literal hex values and assert strict monotonicity across boundaries.(N % 0xAA) * 24 + 0x15). Walk is capped atused_blocksiterations to reject malformed cyclic chains, mirroring the existing FAT cycle rejection involume.rs.extract_to_host: rejects cyclicparent_indexreferences and out-of-range parent pointers; refuses to overwrite existing output files.Library API additions
fatxlib::stfssubmodules:volume_descriptor,block_translator,file_entry,extract. Existing header parsing (StfsHeader,parse_header,MIN_HEADER_BYTES) moved intofatxlib::stfs::headerand re-exported at the namespace root — no breaking changes for existing callers.fatxlib::stfs::StfsPackage::{open, header, volume, entries, read_block_chain, read_file}— read API for STFS packages.read_file<W: Write>streams through a writer; no full-file buffering even for multi-hundred-MiB packages.fatxlib::stfs::extract::extract_to_host(&mut StfsPackage, &Path, Option<ProgressFn>) -> Result<ExtractReport>— top-level walk + write, with progress callback shape matching the existing XISO extract ((rel_path, file_size, total_bytes_so_far)).fatxlib::stfs::extract::ExtractReport—{ files, directories, bytes }returned on success.Testing / maintenance
(X)tractonly when the package contains adefault.xexfile (the only reliable signal that loose extraction produces something useful for alt-dashboards). Fallback: gate oncontent_type == 0x000D0000. The CLIextract-stfsis unrestricted.