exeschema: enum value tables and more struct references #400

Manually merged
github merged 4 commits from github-bot/gh-400 into gh-pr/400/base 2026-11-27 00:40:12 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-26 19:14 UTC · original
holdmysocks:claude/exe-schema-enums → master · +129 −10 · 1 files · 4 commits · merged 2026-11-26 22:43 UTC

Builds on #394. This PR includes #394's commit until that one lands; the new change is the second commit.

  • Enums: enum and bitset member records point at a small enum object. It holds the enum's name hash, its value count and a pointer to a table of {value name hash, value} entries (12 bytes each, ending with {0, -1, -1}). The output is now {"structs": [...], "enums": [...]}. Each enum member gives its enum's hash, and flattened layouts print each enum's values. The current executable has 2,469 enums with 34,123 values.
  • More struct references: a second store form in the getters (mov rcx, rax; ...; mov [x], rcx) raises the struct references from 8,292 to 10,059. The map extensions array, for example, now resolves to its base struct.
  • --work <dir>: names hashes from that work folder's name dictionary as well as the built-in lists.

Tested by running it on the executable. The entity def's priority level and LOD level enums and the archetype asset type come out with 4, 7 and 5 values, matching the known GTA V enums (their names are in #399).

**@⁠holdmysocks** on GitHub · 2026-11-26 19:14 UTC · [original](https://github.com/holdmysocks/SixNG/pull/400) `holdmysocks:claude/exe-schema-enums` → `master` · +129 −10 · 1 files · 4 commits · merged 2026-11-26 22:43 UTC Builds on #394. This PR includes #394's commit until that one lands; the new change is the second commit. - **Enums:** enum and bitset member records point at a small enum object. It holds the enum's name hash, its value count and a pointer to a table of {value name hash, value} entries (12 bytes each, ending with {0, -1, -1}). The output is now `{"structs": [...], "enums": [...]}`. Each enum member gives its enum's hash, and flattened layouts print each enum's values. The current executable has 2,469 enums with 34,123 values. - **More struct references:** a second store form in the getters (`mov rcx, rax; ...; mov [x], rcx`) raises the struct references from 8,292 to 10,059. The map extensions array, for example, now resolves to its base struct. - **`--work <dir>`:** names hashes from that work folder's name dictionary as well as the built-in lists. Tested by running it on the executable. The entity def's priority level and LOD level enums and the archetype asset type come out with 4, 7 and 5 values, matching the known GTA V enums (their names are in #399).
New research example. It finds each struct's registration code, reads the
static header and member records, and links base structs and the structs
of struct, array and map members. Output is JSON, plus flattened layouts
for any struct hashes given on the command line.
Enum and bitset members point at an enum object with the enum's name
hash and a table of {value name hash, value} entries; the output now
lists every enum with its values and names each member's enum. A
second store form in the getters (mov rcx, rax; ...; mov [x], rcx)
adds about 1,800 struct references. --work names hashes from a work
folder's dictionary.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:33:24 +00:00
github-bot changed target branch from master to gh-pr/400/base 2026-11-27 00:40:11 +00:00
github manually merged commit 77951b1afa into gh-pr/400/base 2026-11-27 00:40:12 +00:00
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-26 22:07 UTC · original

Added: names for member types 0x22–0x24. Also merged master, which now has #394.

Schema check against every meta resource in every indexed archive (about 250 K resources):

  • 1,294 of the 1,296 distinct file structs are in the executable's tables. The other two are small structs in two anim files.
  • 4,508,800 struct layouts across files match the executable exactly: size, and every member's hash and offset. Another 2,153 don't, spread over 49 structs. 29 of those structs also have files that match exactly.
    • The mismatches come from older files: data.rpf beside the newer packs.rpf copy of the same struct, and a few story and restofworld resources.
    • The other cause is file members the current executable no longer has (56 members).
  • Member types agree for every file type code. File struct type 0x05 is an embedded struct; its struct hash matches the executable's reference in 823 of 831 cases. The other 8 are members the executable lists with no struct reference, and the file fills them in. Type 0x07 is a pointer.
  • New type names:
    • 0x22 = id64: 8 bytes, file type 0x08. It is the id of entity and archetype definitions and is used for Entity references.
    • 0x23 = vec2_8: two floats at 4-byte offsets, file type 0x30.
    • 0x24 = quatv: 16 bytes, file type 0x34, always Rotation.
    • 0x25–0x27 occur in no meta file and stay unnamed.
  • Known issue: 20 of the 9,254 base links point to the struct itself, which is a getter-detection miss. None of those 20 structs appears in a meta file.
**@⁠holdmysocks** on GitHub · 2026-11-26 22:07 UTC · [original](https://github.com/holdmysocks/SixNG/pull/400#issuecomment-7204380213) Added: names for member types 0x22–0x24. Also merged master, which now has #394. Schema check against every meta resource in every indexed archive (about 250 K resources): - **1,294 of the 1,296 distinct file structs are in the executable's tables.** The other two are small structs in two anim files. - **4,508,800 struct layouts across files match the executable exactly**: size, and every member's hash and offset. Another 2,153 don't, spread over 49 structs. 29 of those structs also have files that match exactly. - The mismatches come from older files: data.rpf beside the newer packs.rpf copy of the same struct, and a few story and restofworld resources. - The other cause is file members the current executable no longer has (56 members). - Member types agree for every file type code. File struct type 0x05 is an embedded struct; its struct hash matches the executable's reference in 823 of 831 cases. The other 8 are members the executable lists with no struct reference, and the file fills them in. Type 0x07 is a pointer. - **New type names:** - 0x22 = `id64`: 8 bytes, file type 0x08. It is the `id` of entity and archetype definitions and is used for `Entity` references. - 0x23 = `vec2_8`: two floats at 4-byte offsets, file type 0x30. - 0x24 = `quatv`: 16 bytes, file type 0x34, always `Rotation`. - 0x25–0x27 occur in no meta file and stay unnamed. - **Known issue:** 20 of the 9,254 base links point to the struct itself, which is a getter-detection miss. None of those 20 structs appears in a meta file.
This discussion has been locked. Commenting is limited to contributors.
No description provided.