DOC-MODDING-CONSTANTS: the constant search in docs/modding.md gives nothing on this image #406

Closed
github-bot wants to merge 1 commit from gh-pr/406/head into gh-pr/406/base
Owner

@⁠fiestorra on GitHub · 2026-11-24 04:44 UTC · original
fiestorra:carry/modding-constants → main · +15 −2 · 1 files · 1 commits · closed without merging

Claimed in the coordination issue as: DOC-MODDING-CONSTANTS (claim comment).

What this changes

Step 1 of the lookup-finding recipe in docs/modding.md presents the constant search as the route to the archetype lookup: "The player model id 0xE472B687 should appear as an immediate in the code that sets up the story player."

On the 1.0.2.1 image it gives nothing, and the row should say so before someone spends an afternoon looking for it:

  • neither 0xE472B687 nor 0xD7C0CDFF is in the executable at all. All 120,181,760 bytes were read and searched as 4-byte little-endian, 4-byte big-endian, decimal text and hex text: 0 hits for each form. Re-run today, same result.
  • the image has no delay-load directory (data directory 13 is zero), so the ids cannot arrive through an import table either.
  • tools/find_hash_lookup.py reports the same thing on its own: 0 occurrence(s) in code, "no direct call follows any of the hashes".
  • the ids are real and the game's own tables carry them: 24 occurrences across the package's root archives (data.rpf 1, packs.rpf 3, anim.rpf 4, navmeshes.rpf 10, movies.rpf 6; little-endian except a few big-endian ones in anim.rpf, navmeshes.rpf and movies.rpf), measured 2026-11-23.

So the constants are the right keys and they are simply not in the code: on this build step 2 (the shape) is what has to find the function. The row now says that, with the counts and the dates.

The image is the one this repository already documents: docs/embedded_shaders.md :44 records it as 120,181,760 bytes with SHA-256 e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993, and Get-FileHash on the file I searched returns exactly that value, so the measurement is on the same image your own docs describe.

Evidence

Head 7e0f21ff6, one commit, docs/modding.md only, rebased onto ece4ba5b3.

  • py -3.13 -I -m unittest discover -s tests -p "test_docs_*.py" on this branch: Ran 47 tests in 44.733s / OK. The same command on clean ece4ba5b3: Ran 47 tests in 45.178s / OK. Same 47 tests, no failures on either side, so this PR changes no test outcome.
  • The replaced wording is what main says at docs/modding.md :133 and :137 right now (1. **Constant search.** The player model id 0xE472B687 should appear as an immediate… and 3. **Cross-check.** Called with 0xD7C0CDFF…), and step 3 is stated as something that "must return a valid archetype too", which cannot be reached from a hash that is never loaded.

No GPU is involved: the search was done on the executable bytes and on the package's archives, and the docs battery runs on the CPU. Hardware used: one desktop machine, Windows build 26300, CPython 3.13.14. Written with an AI assistant; the commands and the measurements above are reproducible as written.

Neighbour

I read #358 before claiming, and I know it edits docs/modding.md too (for the SHA-256 check in tools/leonida_mods.py). If you take that one first I will rebase this on it rather than ask you to resolve anything; my edit is confined to the three numbered steps quoted above.

Supersedes the branch carried in the private tracker as #7929, closed unmerged by the sweep.

**@⁠fiestorra** on GitHub · 2026-11-24 04:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/406) `fiestorra:carry/modding-constants` → `main` · +15 −2 · 1 files · 1 commits · closed without merging Claimed in the coordination issue as: `DOC-MODDING-CONSTANTS` ([claim comment](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)). ### What this changes Step 1 of the lookup-finding recipe in `docs/modding.md` presents the constant search as the route to the archetype lookup: "The player model id `0xE472B687` should appear as an immediate in the code that sets up the story player." On the 1.0.2.1 image it gives nothing, and the row should say so before someone spends an afternoon looking for it: * neither `0xE472B687` nor `0xD7C0CDFF` is in the executable at all. All 120,181,760 bytes were read and searched as 4-byte little-endian, 4-byte big-endian, decimal text and hex text: `0` hits for each form. Re-run today, same result. * the image has no delay-load directory (data directory 13 is zero), so the ids cannot arrive through an import table either. * `tools/find_hash_lookup.py` reports the same thing on its own: `0 occurrence(s) in code`, "no direct call follows any of the hashes". * the ids are real and the game's own tables carry them: 24 occurrences across the package's root archives (`data.rpf` 1, `packs.rpf` 3, `anim.rpf` 4, `navmeshes.rpf` 10, `movies.rpf` 6; little-endian except a few big-endian ones in `anim.rpf`, `navmeshes.rpf` and `movies.rpf`), measured 2026-11-23. So the constants are the right keys and they are simply not in the code: on this build step 2 (the shape) is what has to find the function. The row now says that, with the counts and the dates. The image is the one this repository already documents: `docs/embedded_shaders.md` :44 records it as 120,181,760 bytes with SHA-256 `e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993`, and `Get-FileHash` on the file I searched returns exactly that value, so the measurement is on the same image your own docs describe. ### Evidence Head `7e0f21ff6`, one commit, `docs/modding.md` only, rebased onto `ece4ba5b3`. * `py -3.13 -I -m unittest discover -s tests -p "test_docs_*.py"` on this branch: `Ran 47 tests in 44.733s` / `OK`. The same command on clean `ece4ba5b3`: `Ran 47 tests in 45.178s` / `OK`. Same 47 tests, no failures on either side, so this PR changes no test outcome. * The replaced wording is what `main` says at `docs/modding.md` :133 and :137 right now (`1. **Constant search.** The player model id 0xE472B687 should appear as an immediate…` and `3. **Cross-check.** Called with 0xD7C0CDFF…`), and step 3 is stated as something that "must return a valid archetype too", which cannot be reached from a hash that is never loaded. No GPU is involved: the search was done on the executable bytes and on the package's archives, and the docs battery runs on the CPU. Hardware used: one desktop machine, Windows build 26300, CPython 3.13.14. Written with an AI assistant; the commands and the measurements above are reproducible as written. ### Neighbour I read #358 before claiming, and I know it edits `docs/modding.md` too (for the SHA-256 check in `tools/leonida_mods.py`). If you take that one first I will rebase this on it rather than ask you to resolve anything; my edit is confined to the three numbered steps quoted above. Supersedes the branch carried in the private tracker as #7929, closed unmerged by the sweep.
"Day one: finding the hook" presents the constant search as the route to the
archetype lookup: `0xE472B687` "should appear as an immediate in the code that
sets up the story player". It does not appear. Over all 120,181,760 bytes of
`game_scarlett_master.exe` neither `0xE472B687` nor `0xD7C0CDFF` occurs as
4-byte little-endian, 4-byte big-endian, decimal text or hex text, and the image
has no delay-load directory (data directory 13 is zero), so there is no other way
for them to arrive; `tools/find_hash_lookup.py` already says `0 occurrence(s) in
code` and "no direct call follows any of the hashes", which I read as a tool
limitation until I checked the whole file. The ids themselves are real: the same
two values occur 24 times across the package's root archives (`data.rpf` 1,
`packs.rpf` 3, `anim.rpf` 4, `navmeshes.rpf` 10, `movies.rpf` 6), which is what docs/character_skeleton.md
measures. So step 1 cannot produce a candidate on this build, and the page now
says so and points at step 2 as the way in, keeping the constants as the keys the
lookup takes rather than dropping the method.

Measured 2026-11-23 on `main` `f3a7b0ffc` with the 1.0.2.1 image whose SHA-256
`e95020b2fa4a721db3df59fdecf75621730ac559d8835252f6c3b658d5a08993` the RT-5 page
names: `python -I tools/find_hash_lookup.py <exe>`, then a search of every byte
of the file in the four encodings. `py -3.13 -I -m unittest discover -s tests -p
"test_docs_*.py"`: 36 tests, 3 failures, the same three on untouched `main`
(already open as #7242). `test_exe_checklist.py`: 11 pass, as on `main`.

Coordinated in #7231: reported as a finding before writing it,
https://github.com/ItsNotRexed/Leonida/issues/7231#issuecomment-7108764021.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:58:19 +00:00
github-bot closed this pull request 2026-11-26 08:58:19 +00:00
Author
Owner

@⁠fiestorra on GitHub · 2026-11-24 12:19 UTC · original

Closing this. I am moving my work to a different project and will not continue on this repository, so I am not going to rebase or finish this branch. Nothing in it landed. The branch will be deleted shortly. Thanks to anyone who looked at it.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-11-24 12:19 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/406#issuecomment-7131271371) Closing this. I am moving my work to a different project and will not continue on this repository, so I am not going to rebase or finish this branch. Nothing in it landed. The branch will be deleted shortly. Thanks to anyone who looked at it. Written with an AI assistant.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.