[PR #2206] [CLOSED] find_hash_lookup: validate scan window and result limit #2210

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2206
Author: @whoalin1
Created: 11/26/2026
Status: ❌ Closed

Base: main ← Head: hashlookup-args-validation


📝 Commits (1)

  • 965d91b find_hash_lookup: validate scan window and result limit

📊 Changes

2 files changed (+50 additions, -1 deletions)

View changed files

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

📄 Description

Summary

  • reject a negative --window and a non-positive --top with ValueError, which the CLI already turns into a clean exit-2 error
  • clamp each PE section's declared raw size to the bytes actually present before scanning or computing section coverage
  • add synthetic regressions for direct rank() validation, CLI exit behavior, zero-window behavior and truncated raw sections

Item: TEST-FIND-HASH-LOOKUP-ARGS

This carries forward the still-uncarried fix in old-pr/9792, originally written by abnalstlll-byte, reapplied and verified on current main.

Tests

Under the local machine coordination lock:

  • before the fix, the new tests fail: negative window and non-positive top are accepted, bad CLI arguments do not produce the intended exit-2 error, and the raw-section size is not clamped
  • after the fix: python -I tests/test_find_hash_lookup.py — 10 tests, OK
  • python -m compileall -q tools/find_hash_lookup.py tests/test_find_hash_lookup.py — pass
  • git diff --check — pass

No game files or GPU.

AI-assisted with Devin.


🔄 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/2206 **Author:** [@whoalin1](https://github.com/whoalin1) **Created:** 11/26/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `hashlookup-args-validation` --- ### 📝 Commits (1) - [`965d91b`](https://github.com/ubiquitarianism/leonida/commit/965d91bae91ea43646d25da6798b1f55057fae85) find_hash_lookup: validate scan window and result limit ### 📊 Changes **2 files changed** (+50 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_find_hash_lookup.py` (+41 -0) 📝 `tools/find_hash_lookup.py` (+9 -1) </details> ### 📄 Description ## Summary - reject a negative `--window` and a non-positive `--top` with `ValueError`, which the CLI already turns into a clean exit-2 error - clamp each PE section's declared raw size to the bytes actually present before scanning or computing section coverage - add synthetic regressions for direct `rank()` validation, CLI exit behavior, zero-window behavior and truncated raw sections Item: TEST-FIND-HASH-LOOKUP-ARGS This carries forward the still-uncarried fix in old-pr/9792, originally written by abnalstlll-byte, reapplied and verified on current main. ## Tests Under the local machine coordination lock: - before the fix, the new tests fail: negative `window` and non-positive `top` are accepted, bad CLI arguments do not produce the intended exit-2 error, and the raw-section size is not clamped - after the fix: `python -I tests/test_find_hash_lookup.py` — 10 tests, OK - `python -m compileall -q tools/find_hash_lookup.py tests/test_find_hash_lookup.py` — pass - `git diff --check` — pass No game files or GPU. AI-assisted with Devin. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:25 +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#2210
No description provided.