[PR #437] [MERGED] EXE-SHA-PREFLIGHT: add an executable identity preflight #488

Closed
opened 2026-11-26 20:18:03 +01:00 by 4ld0 · 0 comments
Owner

📋 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)

  • 49c8101 exe_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 optional expected_exe_size / expected_exe_sha256 fields (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.md now 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 OK
  • python -I tests/test_docs_cli_flags.py — 4 tests OK
  • python -I tests/test_docs_links.py — 16 tests OK
  • python -m compileall -q tools tests — OK
  • git diff --check — clean

GPUs tested: n/a (CPU-only CLI and unit tests)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No new translator rule.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/437 **Author:** [@bobcatchris](https://github.com/bobcatchris) **Created:** 11/24/2026 **Status:** ✅ Merged **Merged:** 11/24/2026 **Merged by:** [@QemmHD](https://github.com/QemmHD) **Base:** `main` ← **Head:** `exe-sha-preflight` --- ### 📝 Commits (1) - [`49c8101`](https://github.com/ubiquitarianism/leonida/commit/49c81019c75fc59da5a35d57977337ab7320c01a) exe_sha: one command that says whether your copy is the file the notes were written against ### 📊 Changes **3 files changed** (+300 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/design.md` (+11 -0) ➕ `tests/test_exe_sha.py` (+130 -0) ➕ `tools/exe_sha.py` (+159 -0) </details> ### 📄 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 optional `expected_exe_size` / `expected_exe_sha256` fields (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.md` now 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 OK - `python -I tests/test_docs_cli_flags.py` — 4 tests OK - `python -I tests/test_docs_links.py` — 16 tests OK - `python -m compileall -q tools tests` — OK - `git diff --check` — clean GPUs tested: n/a (CPU-only CLI and unit tests) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No new translator rule. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:18:03 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#488
No description provided.