RPF9 table record size: 9 or 10 bytes padded to 16, not 16 per record #1

Open
opened 2026-11-27 02:48:08 +00:00 by github-bot · 0 comments
Owner

@⁠JoshRob297 on GitHub · 2026-11-23 03:59 UTC · original

The table record size

docs/rpf9-container.md describes the archive as "two tables of 16-byte records", and notes that both table lengths are multiples of 16 in all 4,330 headers. I measured the record size on a shipping Xbox build and get 9 or 10 bytes per record, with the table padded up to a multiple of 16 — which would explain the alignment you observe without the record itself being 16 bytes.

Measurement

For each of the 22 top-level .rpf archives of the package I parsed the 64-byte header and checked:

stride   = 8 + byte_at_0x2C_low
region   = ceil(stride * w24 / 16) * 16

where w24 is the declared entry count at 0x24. Over the 22 archives:

  • 0x2C low byte is 1 in 15 archives → stride 9
  • 0x2C low byte is 2 in 7 archives → stride 10
  • the formula reproduces the table region 22/22

Your field table lists 0x2C as 4 bytes, flags 0x90F01 or 0x90F02. In my sample that holds exactly as stated, and the low byte of that field is the stride selector: 1 → 9 bytes, 2 → 10 bytes. So the flags field may be carrying the record width rather than an unrelated flag.

Two worked examples from the corpus:

levels.rpf   0x2C low = 2 · w24 = 2,078 → 10 × 2,078 = 20,780 → ceil(20,780/16)*16 = 20,784
anim.rpf     0x2C low = 2 · w24 =   265 → 10 ×   265 =  2,650 → ceil( 2,650/16)*16 =  2,656
shaders.rpf  0x2C low = 1 · w24 =     3 →  9 ×     3 =     27 → ceil(    27/16)*16 =     32

What I am not claiming

I did not decode the tables; they are enciphered in my build too. This is a geometric measurement of the region between the header and the payload, not a claim about the record contents, and it says nothing about the key.

Questions

  1. Does region = ceil((8 + flags_low) * w24 / 16) * 16 reproduce the table-1/table-2 boundary in your 4,330 headers? If your corpus disagrees anywhere, that is more interesting than agreement and I would like the counterexample.
  2. Is "16-byte records" in rpf9-container.md an earlier reading of the table length being a multiple of 16, or did you see something that rules out a 9/10-byte stride?

The 22 raw 64-byte headers, in five formats (binary, TSV, JSON, C++ and Python fixtures) with a test that re-derives the region from them, are published at https://github.com/JoshRob297/rpf9-research under raw/cabeceras/, so this is checkable without taking my word for it.

**@⁠JoshRob297** on GitHub · 2026-11-23 03:59 UTC · [original](https://github.com/SentinelInteractive/0x52504639/issues/1) ## The table record size `docs/rpf9-container.md` describes the archive as "two tables of 16-byte records", and notes that both table lengths are multiples of 16 in all 4,330 headers. I measured the record size on a shipping Xbox build and get **9 or 10 bytes per record**, with the table padded up to a multiple of 16 — which would explain the alignment you observe without the record itself being 16 bytes. ### Measurement For each of the 22 top-level `.rpf` archives of the package I parsed the 64-byte header and checked: ``` stride = 8 + byte_at_0x2C_low region = ceil(stride * w24 / 16) * 16 ``` where `w24` is the declared entry count at `0x24`. Over the 22 archives: - `0x2C` low byte is **1** in 15 archives → stride **9** - `0x2C` low byte is **2** in 7 archives → stride **10** - the formula reproduces the table region **22/22** Your field table lists `0x2C` as 4 bytes, flags `0x90F01` or `0x90F02`. In my sample that holds exactly as stated, and the **low byte of that field is the stride selector**: 1 → 9 bytes, 2 → 10 bytes. So the flags field may be carrying the record width rather than an unrelated flag. Two worked examples from the corpus: ``` levels.rpf 0x2C low = 2 · w24 = 2,078 → 10 × 2,078 = 20,780 → ceil(20,780/16)*16 = 20,784 anim.rpf 0x2C low = 2 · w24 = 265 → 10 × 265 = 2,650 → ceil( 2,650/16)*16 = 2,656 shaders.rpf 0x2C low = 1 · w24 = 3 → 9 × 3 = 27 → ceil( 27/16)*16 = 32 ``` ### What I am not claiming I did not decode the tables; they are enciphered in my build too. This is a geometric measurement of the region between the header and the payload, not a claim about the record contents, and it says nothing about the key. ### Questions 1. Does `region = ceil((8 + flags_low) * w24 / 16) * 16` reproduce the table-1/table-2 boundary in your 4,330 headers? If your corpus disagrees anywhere, that is more interesting than agreement and I would like the counterexample. 2. Is "16-byte records" in `rpf9-container.md` an earlier reading of the table length being a multiple of 16, or did you see something that rules out a 9/10-byte stride? The 22 raw 64-byte headers, in five formats (binary, TSV, JSON, C++ and Python fixtures) with a test that re-derives the region from them, are published at https://github.com/JoshRob297/rpf9-research under `raw/cabeceras/`, so this is checkable without taking my word for it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:48:08 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.