exeschema: meta struct schemas from the executable's parser table #394

Manually merged
github merged 2 commits from gh-pr/394/head into gh-pr/394/base 2026-11-26 20:32:56 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-26 18:49 UTC · original
holdmysocks:claude/exe-schema → master · +439 −0 · 1 files · 2 commits · merged 2026-11-26 20:20 UTC

Adds a research example, exeschema, that reads the parser struct table out of the game executable.

For every meta struct the game can load it gives the name hash, size, flags, base struct and members (name hash, offset, type and sub type). For struct members, and for the elements of arrays and maps, it also gives the struct they refer to. Output is JSON. Struct hashes given on the command line are also printed as flattened layouts, with base members first.

The format is documented at the top of the file. Nothing in it is hard-coded to one build: the constructor and base-link functions are picked as the most common call targets.

Results on the current executable:

  • 19,178 structs, 77,044 members, 9,254 base links and 8,292 struct references;
  • 553 member records (0.7%) don't fit the usual record shape and are reported as they are;
  • checked against the schemas in the levels' meta files: 233 of those 234 structs are in the table, and with bases followed all 1,421 of their members are found, with matching types.

Not covered: enum value tables, and names. Hashes are named through the existing names dictionary, so most still print as hex.

Tested by running it on the executable and comparing with the file schemas. It is an example only, so nothing else changes.

**@⁠holdmysocks** on GitHub · 2026-11-26 18:49 UTC · [original](https://github.com/holdmysocks/SixNG/pull/394) `holdmysocks:claude/exe-schema` → `master` · +439 −0 · 1 files · 2 commits · merged 2026-11-26 20:20 UTC Adds a research example, `exeschema`, that reads the parser struct table out of the game executable. For every meta struct the game can load it gives the name hash, size, flags, base struct and members (name hash, offset, type and sub type). For struct members, and for the elements of arrays and maps, it also gives the struct they refer to. Output is JSON. Struct hashes given on the command line are also printed as flattened layouts, with base members first. The format is documented at the top of the file. Nothing in it is hard-coded to one build: the constructor and base-link functions are picked as the most common call targets. Results on the current executable: - 19,178 structs, 77,044 members, 9,254 base links and 8,292 struct references; - 553 member records (0.7%) don't fit the usual record shape and are reported as they are; - checked against the schemas in the levels' meta files: 233 of those 234 structs are in the table, and with bases followed all 1,421 of their members are found, with matching types. Not covered: enum value tables, and names. Hashes are named through the existing names dictionary, so most still print as hex. Tested by running it on the executable and comparing with the file schemas. It is an example only, so nothing else changes.
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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:32:56 +00:00
github manually merged commit 4bc5f3430e into gh-pr/394/base 2026-11-26 20:32:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.