Read the RPF9 table of contents (toc, toc-extract) #224

Manually merged
github merged 2 commits from gh-pr/224/head into gh-pr/224/base 2026-11-26 20:19:28 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 00:02 UTC · original
holdmysocks:claude/rpf9-toc → master · +1294 −18 · 6 files · 2 commits · merged 2026-11-25 00:15 UTC

What this adds

  • sixng toc <archive> [--files]: reads an archive's table of contents and prints its columns (name hash, element size, count) and file entries (offset, stored and unpacked size, flags). Archives stored inside the archive are followed.
  • sixng toc-extract [archives] --out <dir>: writes the files the carving index cannot read to <out>/toc_files/<archive>[@offset]/<offset>.<ext> with an index.jsonl. Each file is checked: every zlib stream must end cleanly, the size must equal the one in the table, and all stored bytes must be used.

Both commands need Windows x64, a CPU with AVX2 and the game executable in the game folder. On other platforms they return a clear error and nothing else changes.

Code

  • rpf9toc.rs: the table model (sections, columns, row index, file entries), chunk unpacking and six tests on synthetic archives. Platform independent.
  • gamecipher.rs: the Windows x64 back end; a stub elsewhere.
  • rpf9.rs: header comments brought up to date. No field or output changes.

Checked

  • Whole install: 652 files written, 0 failures, about 30 s; all identical to an independent reference extraction.
  • cargo test --release --locked passes on Windows (218 core, 24 CLI).
  • The non-Windows build was not checked locally; CI covers it.

Not done

  • Listing, search and export still use the carving index.
  • Four columns of the table are unread, as is the 20-byte entry column some inner archives use (added in #232).
  • The README is unchanged apart from removing the outdated table-of-contents row.
**@⁠holdmysocks** on GitHub · 2026-11-25 00:02 UTC · [original](https://github.com/holdmysocks/SixNG/pull/224) `holdmysocks:claude/rpf9-toc` → `master` · +1294 −18 · 6 files · 2 commits · merged 2026-11-25 00:15 UTC ## What this adds - `sixng toc <archive> [--files]`: reads an archive's table of contents and prints its columns (name hash, element size, count) and file entries (offset, stored and unpacked size, flags). Archives stored inside the archive are followed. - `sixng toc-extract [archives] --out <dir>`: writes the files the carving index cannot read to `<out>/toc_files/<archive>[@offset]/<offset>.<ext>` with an `index.jsonl`. Each file is checked: every zlib stream must end cleanly, the size must equal the one in the table, and all stored bytes must be used. Both commands need Windows x64, a CPU with AVX2 and the game executable in the game folder. On other platforms they return a clear error and nothing else changes. ## Code - `rpf9toc.rs`: the table model (sections, columns, row index, file entries), chunk unpacking and six tests on synthetic archives. Platform independent. - `gamecipher.rs`: the Windows x64 back end; a stub elsewhere. - `rpf9.rs`: header comments brought up to date. No field or output changes. ## Checked - Whole install: 652 files written, 0 failures, about 30 s; all identical to an independent reference extraction. - `cargo test --release --locked` passes on Windows (218 core, 24 CLI). - The non-Windows build was not checked locally; CI covers it. ## Not done - Listing, search and export still use the carving index. - Four columns of the table are unread, as is the 20-byte entry column some inner archives use (added in #232). - The README is unchanged apart from removing the outdated table-of-contents row.
sixng toc lists an archive's columns and file entries, following archives stored inside it. sixng toc-extract writes the files the carving index cannot read, each checked against its zlib checksums and the size in the table. Both need Windows x64 and the game executable in the game folder; other platforms get a clear error.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:19:27 +00:00
github manually merged commit e4b377cf39 into gh-pr/224/base 2026-11-26 20:19:28 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.