tools: validate numeric scan/probe arguments #2203
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2203"
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 whoalin1 on 2026-11-26T05:41:23Z.
Summary
ValueErrorwhen parsing--waves, so--waves 32,abcfollows the existing bad-argument path and exits 2Item: 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:
origin/main:python -I buffer_bounds_probe.py --waves 32,abcexits 1 withValueErrortracebackpython -I tests/test_buffer_bounds_probe.py— 6 tests, OKpython -m compileall -q tools/buffer_bounds_probe.py tests/test_buffer_bounds_probe.py— passgit diff --check— passNo 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_lookuprejects a negative--windowand a non-positive--top, and clamps truncated PE section sizes before scanning. The consolidation is cherry-picka33822ab2; no additional code was written. Both changes are small argument-validation fixes with independent regression tests.Imported from ubiquitarianism/leonida. Originally posted by real-rusher on 2026-11-26T10:06:31Z.
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)
Imported from ubiquitarianism/leonida. Originally posted by DeadlyChirp on 2026-11-26T10:32:23Z.
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.)
Imported from ubiquitarianism/leonida. Originally posted by sodove on 2026-11-28T09:15:04Z.
#2203 | head
a33822ab20b96af571a5be25e67115919efa5c44|python3 -I tests/test_buffer_bounds_probe.py -v,python3 -I tests/test_find_hash_lookup.py -v| red: 16 tests, 8 assertion failures | green: 16 passed | Red → greenThe baseline returned the wrong CLI status for invalid numeric input and failed the scan-argument checks.
Pinned main
4938673668d807bf365b61284bf22b1ff8d02cc4, merged into the PR head. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Full suite: not run. AI-assisted: OpenAI Codex. Batch claim.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T04:50:25Z.
Checked
a33822ab2againstmainef3299584on Windows 11 10.0.26300: it does not merge (git merge-tree --write-tree), so I ran no tests.tools/find_hash_lookup.py.ac2c3d335(2026-11-24, "find_hash_lookup: clamp raw section sizes and validate window and top parameters") already clamps the raw section size and validateswindow/top, with its own wording.mainalready, partly still needed (STALE, needs a rebase):find_hash_lookup.pypart is covered byac2c3d335.--wavesfix intools/buffer_bounds_probe.pyis not:mainstill runsint()on each item with notry, so--waves 32,abcends in a traceback.find_hash_lookuphunks and keepbuffer_bounds_probe.pywith its test.AI-assisted (Claude Code).
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T14:19:06Z.
Merged at head
ccb3726. Tested by others on earlier heads: real-rusher (Ubuntu 24.04) and sodove (WSL), the new test fails on main and passes with the PR; DeadlyChirp (Windows 11) 6/6. Gap: nobody re-ran it onccb3726after the find_hash_lookup rebase. Could someone runpython -I tests/test_buffer_bounds_probe.pyandtests/test_find_hash_lookup.pyon current main and post the result? AI-assisted: yes.Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:46:30Z.
Re-checked after the merge, on
mainbd643e46e(Windows 11 10.0.26300, Python 3.12.4, CPU only): passes on main.python -I tests/test_buffer_bounds_probe.py: 6 tests OK.python -I tests/test_find_hash_lookup.py: 14 tests OK.AI-assisted (Claude Code).