[PR #2203] tools: validate numeric scan/probe arguments #2207

Open
opened 2026-11-26 21:20:24 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2203
Author: @whoalin1
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: waves-arg-exit2


📝 Commits (2)

  • 974629a buffer_bounds_probe: reject non-numeric waves as a bad argument
  • a33822a find_hash_lookup: validate scan window and result limit

📊 Changes

4 files changed (+61 additions, -2 deletions)

View changed files

📝 tests/test_buffer_bounds_probe.py (+7 -0)
📝 tests/test_find_hash_lookup.py (+41 -0)
📝 tools/buffer_bounds_probe.py (+4 -1)
📝 tools/find_hash_lookup.py (+9 -1)

📄 Description

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.


🔄 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/2203 **Author:** [@whoalin1](https://github.com/whoalin1) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `waves-arg-exit2` --- ### 📝 Commits (2) - [`974629a`](https://github.com/ubiquitarianism/leonida/commit/974629a7c026111fb10260a32a54a6d543cffcb7) buffer_bounds_probe: reject non-numeric waves as a bad argument - [`a33822a`](https://github.com/ubiquitarianism/leonida/commit/a33822ab20b96af571a5be25e67115919efa5c44) find_hash_lookup: validate scan window and result limit ### 📊 Changes **4 files changed** (+61 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_buffer_bounds_probe.py` (+7 -0) 📝 `tests/test_find_hash_lookup.py` (+41 -0) 📝 `tools/buffer_bounds_probe.py` (+4 -1) 📝 `tools/find_hash_lookup.py` (+9 -1) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#2207
No description provided.