mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:15:52 +01:00
[PR #358] OLD-8041, OLD-8404: leonida_mods checks the executable and DLLs by SHA-256 before starting gta6rt #409
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#409
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/358
Author: @ItsMrDubey
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:verify-exe-sha256📝 Commits (1)
f35a1c4leonida_mods: run checks the executable and package DLLs against the version manifest before starting gta6rt📊 Changes
6 files changed (+231 additions, -12 deletions)
View changed files
📝
docs/modding.md(+5 -1)📝
game/xbox-1.0.2.1.json(+3 -1)📝
tests/test_leonida_mods.py(+79 -0)📝
tests/test_manifest_verifier.py(+22 -0)📝
tools/leonida_mods.py(+70 -3)📝
tools/manifest_verifier.py(+52 -7)📄 Description
Claimed in the coordination issue as: OLD-8041, OLD-8404 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121328982)
What and why
Old OLD-8041 / OLD-8404 asked for the executable (and its DLLs) to be checked by SHA-256 before the runtime loads them. On main nothing did:
make_game.pychecks sizes only (hashes only with--full, viamanifest.py) and never launchesgta6rt; the only Python path that starts it istools/leonida_mods.py(runand the window's launch buttons, both throughruntime_command), which handed<game>/game_scarlett_master.exeand--game-dirtogta6rtunchecked;runtime/src/pe_loader.cppmaps the DLLs fromgame_dirwith no hash check. Also,game/xbox-1.0.2.1.jsonlisted the 16 package DLLs but not the executable.Now:
tools/manifest_verifier.py: newcheck_files([(path, size, sha256)], cache_path): size first, then the existing streamedsha256_file; the first mismatch raises one line,<file>: size is N bytes, expected Mor<file>: SHA-256 is <actual>, expected <expected>. The cache reuses--cache's stamp/file-id rules and file format; the "only cache a stable, not-just-written file" rule moved into_stable_stamp(), shared withverify_manifest.tools/leonida_mods.py: before startinggta6rt(CLIrunand GUI launch; not--print), picks thegame/xbox-*.jsonwhoseMicrosoftGame.Configmatches the copy, checks every manifest DLL present in the game folder and the executable, caching passes in<port>/verified_files.json, and refuses withnot starting gta6rt: <file>: ...otherwise.game/xbox-1.0.2.1.json:expected_exe_size/expected_exe_sha256, the values already published indocs/runtime_imports.md("The retail executable (RT-5)"). Top-level keys, notfiles, somake_game checkstill accepts a package without the executable. If maintainers would rather not carry them, dropping the two keys leaves the DLL check working and the exe unchecked.Mods: mods are
mod.jsonarchetype swaps read by the runtime; none modifies the executable or DLLs, so mod workflows are unaffected. The existing--image("a stand-in executable") is the opt-out: an image named there is not checked (DLLs still are), and a game folder that matches no version manifest needs--imageto launch. No new flag or env var.Tested
Windows 11, Python 3.11.9, no GPU needed.
python -I tests/test_leonida_mods.py: 15 OK (5 newLaunchCheckTests: synthetic manifest + fake files; matching start + cache hit without rehashing, changed DLL refused with one-line error, changed exe refused by size,--imagestand-in skips the exe but not DLLs, unknown version refused,--printreads nothing). Before the fix: 5 errors.python -m pytest tests/test_manifest_verifier.py -k check_files: new test passes; fails on main (nocheck_files).python -m pytestover every test file that imports either module or reads the version manifest (test_manifest_verifier, test_leonida_mods, test_docs_repo_paths, test_make_game_dry_run/platform/preflight, test_shell_launchers, test_windows_process_priority): 219 passed, 11 skipped, 22 failed; the same 22 fail on origin/main without this change.python -I scripts/check_no_game_data.pyon every changed file: clean.AI-assisted: yes
Checklist
docs/design.md.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.