Fix duplicate archive index candidates at read boundaries #2
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lynxnathan--rage-tools-vi!2
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2"
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?
@yefan911 on GitHub · 2026-11-26 18:09 UTC · original
yefan911:fix/index-scan-boundaries→main· +96 −2 · 4 files · 1 commits · openBoth index scanners retain eight bytes between reads. That carries complete signatures into the next iteration, so an ADAT or KB2 signature near a read boundary is reported twice. For example, 16-byte reads with signatures at offsets 12 and 24 return
[12, 12, 24, 24];limit=2returns[12, 12]and misses the second distinct candidate.Keep only the incomplete signature suffix: three bytes for ADAT and two for KB2. This preserves signatures spanning reads without emitting complete matches again. The change leaves alignment filtering and range semantics intact.
Added six synthetic regression tests covering duplicate offsets, distinct-candidate limits, signatures split across reads as small as one byte, alignment filtering, empty input, and ADAT start/stop bounds. The new regressions fail against the original scanners.
Validation on Windows with Python:
python tests/test_index_scanning.py— 6 tests pass.python tests/test_extraction_tools.py— PASS.python tests/test_robustness.py --rounds 200— PASS (231 generated inputs).git diff --check— clean.All fixtures are generated synthetic bytes. No GTA VI archives, executables, assets, dumps, or private SDK material were accessed or included. This verifies scanner behavior only; no game-runtime or performance claim is made.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.