EXE-SHA-PREFLIGHT: add an executable identity preflight #437
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/437"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by bobcatchris on 2026-11-24T05:19:37Z.
Claimed in the coordination issue as: EXE-SHA-PREFLIGHT
What and why
Contributors run tools against their own copy of the game, but nothing currently checks that those copies are the same image the measurements were made on. A truncated or patched executable still reports as found, and every RVA a note quotes is then quietly measured against something else.
This adds
tools/exe_sha.py, a small offline preflight that prints the size and SHA-256 of the image it is given, compares them with the manifest's optionalexpected_exe_size/expected_exe_sha256fields (or with--expect SHA256), exits non-zero on a mismatch, checks the size before hashing so a truncated image is reported cheaply, and can emit JSON or the manifest keys for scripts.docs/design.mdnow lists it first in the day-one setup sequence.No game data, keys, or decryption are included. Tests use synthetic files and the repository's existing manifest keys only.
Tested
python -I tests/test_exe_sha.py— 11 tests OKpython -I tests/test_docs_cli_flags.py— 4 tests OKpython -I tests/test_docs_links.py— 16 tests OKpython -m compileall -q tools tests— OKgit diff --check— cleanGPUs tested: n/a (CPU-only CLI and unit tests)
AI-assisted: yes
Checklist
mainand merges cleanly.Imported from ubiquitarianism/leonida. Originally posted by QemmHD on 2026-11-24T08:51:55Z.
Merging. Why merged: adds a read-only, standard-library-only check that a contributor's executable matches the recorded size and SHA-256 (no hashes of the game embedded; nothing downloaded).
Why it's good: security-reviewed; tested on Windows 11 + RTX 4070 SUPER on main
1c93c86: clean merge, exe_sha tests 9 -> 20 passed; the repo-consistency set stays 563/563 with 0 failures.AI-assisted (Claude Code, Claude Opus 5.5).