tools: validate numeric scan/probe arguments #2203

Open
github-bot wants to merge 2 commits from github-bot/gh-2203 into main AGit
Owner

@⁠whoalin1 on GitHub · 2026-11-26 05:41 UTC · original
whoalin1:waves-arg-exit2 → main · +61 −2 · 4 files · 2 commits · open

Summary

  • catch ValueError when parsing --waves, so --waves 32,abc follows the existing bad-argument path and exits 2
  • add a regression test requiring exit 2, the usage error and no traceback

Item: TEST-BUFFER-BOUNDS-WAVES-ARG

This carries forward the still-uncarried fix in old-pr/9807, originally written by nino-exe, reapplied and verified on current main.

Tests

Under the local machine coordination lock:

  • control from origin/main: python -I buffer_bounds_probe.py --waves 32,abc exits 1 with ValueError traceback
  • patched tree: python -I tests/test_buffer_bounds_probe.py — 6 tests, OK
  • python -m compileall -q tools/buffer_bounds_probe.py tests/test_buffer_bounds_probe.py — pass
  • git diff --check — pass

No game files or GPU.

AI-assisted with Devin.

Consolidated numeric-argument validation

This branch now also includes the small numeric CLI validation fix formerly opened as #2206: find_hash_lookup rejects a negative --window and a non-positive --top, and clamps truncated PE section sizes before scanning. The consolidation is cherry-pick a33822ab2; no additional code was written. Both changes are small argument-validation fixes with independent regression tests.

**@⁠whoalin1** on GitHub · 2026-11-26 05:41 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2203) `whoalin1:waves-arg-exit2` → `main` · +61 −2 · 4 files · 2 commits · open ## Summary - catch `ValueError` when parsing `--waves`, so `--waves 32,abc` follows the existing bad-argument path and exits 2 - add a regression test requiring exit 2, the usage error and no traceback Item: TEST-BUFFER-BOUNDS-WAVES-ARG This carries forward the still-uncarried fix in old-pr/9807, originally written by nino-exe, reapplied and verified on current main. ## Tests Under the local machine coordination lock: - control from `origin/main`: `python -I buffer_bounds_probe.py --waves 32,abc` exits 1 with `ValueError` traceback - patched tree: `python -I tests/test_buffer_bounds_probe.py` — 6 tests, OK - `python -m compileall -q tools/buffer_bounds_probe.py tests/test_buffer_bounds_probe.py` — pass - `git diff --check` — pass No game files or GPU. AI-assisted with Devin. ## Consolidated numeric-argument validation This branch now also includes the small numeric CLI validation fix formerly opened as #2206: `find_hash_lookup` rejects a negative `--window` and a non-positive `--top`, and clamps truncated PE section sizes before scanning. The consolidation is cherry-pick `a33822ab2`; no additional code was written. Both changes are small argument-validation fixes with independent regression tests.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:22:12 +00:00
Author
Owner

@⁠real-rusher on GitHub · 2026-11-26 10:06 UTC · original

Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_buffer_bounds_probe.py: 6 tests OK. The PR's test file against main's tools/buffer_bounds_probe.py: 1 failure, so the new test fails on main and passes with the fix. compileall clean.

AI-assisted: yes (Claude Code)

**@⁠real-rusher** on GitHub · 2026-11-26 10:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2203#issuecomment-7188917782) Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_buffer_bounds_probe.py: 6 tests OK. The PR's test file against main's tools/buffer_bounds_probe.py: 1 failure, so the new test fails on main and passes with the fix. compileall clean. AI-assisted: yes (Claude Code)
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-26 10:32 UTC · original

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_buffer_bounds_probe.py: 6 passed (main: 5 passed).

(AI-assisted test run; output checked by hand.)

**@⁠DeadlyChirp** on GitHub · 2026-11-26 10:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2203#issuecomment-7189500261) Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_buffer_bounds_probe.py`: 6 passed (main: 5 passed). (AI-assisted test run; output checked by hand.)
github-bot changed title from buffer_bounds_probe: reject non-numeric waves as a bad argument to tools: validate numeric scan/probe arguments 2026-11-26 13:33:25 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2203/head:github-bot/gh-2203'
git switch 'github-bot/gh-2203'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2203'
git switch 'github-bot/gh-2203'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2203'
git switch 'github-bot/gh-2203'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2203'
git switch 'main'
git merge --squash 'github-bot/gh-2203'
git switch 'main'
git merge --ff-only 'github-bot/gh-2203'
git switch 'main'
git merge 'github-bot/gh-2203'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.