mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:10:52 +01:00
[PR #437] [MERGED] EXE-SHA-PREFLIGHT: add an executable identity preflight #488
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#488
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/437
Author: @bobcatchris
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @QemmHD
Base:
main← Head:exe-sha-preflight📝 Commits (1)
49c8101exe_sha: one command that says whether your copy is the file the notes were written against📊 Changes
3 files changed (+300 additions, -0 deletions)
View changed files
📝
docs/design.md(+11 -0)➕
tests/test_exe_sha.py(+130 -0)➕
tools/exe_sha.py(+159 -0)📄 Description
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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.