Skip to content

RPF9: exact TOC reading, named extraction and GUI integration - #145

Open
bosseurdinternet wants to merge 19 commits into
Two-Play:developfrom
bosseurdinternet:feat/rpf9-scarlett
Open

bosseurdinternet wants to merge 19 commits into
Two-Play:developfrom
bosseurdinternet:feat/rpf9-scarlett

Conversation

@bosseurdinternet

Copy link
Copy Markdown

RPF9 entries can now be listed and extracted using their decrypted TOC instead of inferred stream boundaries. For the analysed Scarlett 1.0.2.1 build, a known path such as common.rpf/data/ai/conversationlist.meta resolves to logical entry 19 and extracts its decoded content. Unknown names remain accessible through hash-based filenames.

This branch incorporates #144 (head 4f35767) and connects its GUI and format readers to the exact TOC. Its archive recovery scanner remains a fallback when no reference executable is available. The original #144 commits and attribution are preserved; this PR includes that work rather than presenting it as an independent implementation.

Changes

  • Parse bounded, decrypted metadata, column indirection, extents, resource flags, crypto descriptors and block tables; support streaming raw and decoded extraction, including selective TFIT-CTR and verified zlib blocks.
  • Extract the required cipher material from the user's reference executable through targeted reads. No game keys, executable bytes or archive fixtures are included.
  • Use TOC-backed GUI/VFS navigation for directly stored nested archives. Prefer RPF9 signatures over copied GTA V/RDR2 executable names and disable recovery payload scans in TOC mode.
  • Resolve candidate names with the native normalized hash; load rpf9-names.txt or RPF9_NAMES, and display unresolved entries as hash filenames. Keep ambiguous candidates and 32-bit-only hypotheses distinct.
  • Feed exact system/graphics resource partitions to model parsing, and add explicit texture decode budgets for standalone TTPF pools.
  • Add metadata/hash export examples, bounded local validation probes, GTA V name inventory and CPU dictionary examples, and portable Vulkan dictionary tools. Optional dictionaries, including GTA6-StringsDatabase, are obtained separately; source provenance and reproduction commands are documented.

Validation

  • 259 library tests passed across rage-rpf, rage-formats and openrage-app.
  • Six opt-in local RPF9 corpus tests passed, including named lookup, selective crypto, resource splits and nested metadata layouts.
  • Three TTPF tests passed, including rejection when the decode budget is too small. cargo fmt --all --check and diff whitespace checks passed.
  • CLI and GUI binaries built on Linux using Rust 1.98.1 with --ignore-rust-version and two build jobs. The GUI was launched successfully; exhaustive interactive rendering validation was not performed.
  • CLI lookup and extraction of conversationlist.meta succeeded. A bounded local probe parsed 16/16 model resources and exported 16/16 small textures (RGBA and BC1) to PNG, with a 32 MiB per-resource/chunk limit.
  • The portable Vulkan tools passed 1,054 CPU/GPU comparison vectors. A finite dictionary run matched 80,958 distinct 64-bit hashes covering 101,484 inventory entries; candidate matches do not prove original spelling or a complete path.

Scope and remaining limitations

  • Experimental, read-only support for the analysed Scarlett 1.0.2.1 build, requiring the user's executable. No archive editing/repacking or compatibility claim for other builds.
  • Metadata inventory covers 1,255,039 entries in 22 outer and 4,351 directly stored nested archives. This is not exhaustive payload decoding or discovery of every possible embedded container.
  • Entry decryption/decompression is implemented for supported codecs. However, direct nested navigation currently rejects child entries that themselves require decryption/decompression: automatically decoding such a child into a seekable backing store and opening it is not wired up yet.
  • Name/trailer recovery remains incomplete. Model fragments were not covered by the local model sample; skeletons, animation and LOD support remain incomplete. Some texture layouts, volumes, embedded-pool discovery and BCPack BC6H/BC7 remain unsupported or unvalidated.
  • PE reads are capped at 1 MiB, TOC metadata at 64 MiB, payload I/O uses 64 KiB chunks, and TOC preview reads are capped at 128 MiB. Extraction streams rather than allocating entire archives.

Full upstream CI, cross-platform validation and license-list checks remain for review; the local validation above does not claim those checks have passed.

Two-Play and others added 19 commits November 23, 2026 02:07
GTA VI's archives (RPF9) have an encrypted table of contents, and the keys
are only in the game's program. What is not encrypted is read without it:

- RPF9 as a recovery view: the data area is scanned once for zlib streams,
  Bink 2 videos and audio containers; files are named by their offset and
  sorted into folders by what they start with. The index is stored per
  archive and made in the background when the game is opened.
- A folder with GTA VI's archives counts as a game without a program and
  without keys. The setup says Open instead of Derive keys and can always
  be left.
- Audio: GTA VI's containers (two more tables, Opus instead of Vorbis),
  sounds and multi-channel streams, decoded with opus-rs.
- Metadata: PSIN with an LSCH schema and the RBF0 variant with 8-byte
  numbers, both as XML. Tables of zero-ended strings open as text.
- Textures: the texture pools (.ttpf) open as folders of 64 textures;
  2D textures, arrays and cube maps, with BCPack for BC1, BC3, BC4 and BC5.
  `openrage ttpf` counts and exports a pool.
- Models: drawables, fragments and drawable dictionaries open in the
  viewer, listed by their own names under models/, with the base colour
  texture of their materials from the texture pools.

Not read: BCPack for BC6H and BC7, volume textures, skeletons and
skinning, Bink 2 video (no free decoder), and everything that needs names
from the table of contents.

Format knowledge and its sources are in NOTICE.md (Leonida, rpf9-explorer,
Microsoft's silicon-rans tables).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
One conflict, in the CLI's early commands: `ttpf` from this branch and the
new `rebuild` check of `rpf8` from develop both stay.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Use decrypted metadata for nested archive navigation, native path lookup and bounded model resource reads. Add budgeted TTPF decoding, local probes and portable Vulkan dictionary tools. Keep recovery scanning separate when no reference executable is available.

This branch has not been deployed

No deployments
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.

2 participants