Honor ADAT extent limits and validate headers before table reads #3
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!3
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3"
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:18 UTC · original
yefan911:fix/adat-parser-bounds→main· +161 −4 · 3 files · 1 commits · openextent_bank(..., limit=...)checks the caller's extent limit for computed chunk tables, but both suffix-scan paths return their recovered extent without that check. A generated bank declaring a bank-relative extent of0x1800is accepted withlimit=0x1000for flags0xff25and0xff61, and for the fallback layouts of0xff21and0xff02.Apply the same limit check to the recovered table's maximum extent. Reject the whole bank when it exceeds the limit, preserving the longest-table selection and existing alignment behavior.
Also move count validation before table dispatch and before the legacy info-table read, and reject header regions outside the caller's limit or
MAX_BANKbefore following them. Previously, scanned variants accepted zero or excessive stream counts, and a malformed header could cause a large read request before rejection.Seven tests use generated in-memory headers and a recording reader to cover all computed/scanned/fallback table paths, out-of-limit records before a valid final suffix, exact-limit extents at nonzero file offsets, invalid counts, oversized header reads, and valid legacy counts including
MAX_STREAMS. The new rejection regressions fail on the original implementation.Validation with Python 3.13.5 on Windows:
python tests/test_adat_bounds.py— 7 tests pass.python tests/test_extraction_tools.py— PASS.python tests/test_robustness.py --rounds 200— PASS (231 generated inputs).git diff --check— clean.This is independent of #2 and targets parser validation rather than candidate scanning. All fixtures are generated synthetic bytes; no GTA VI archives, executables, assets, dumps, or private SDK material were accessed or included. No game-runtime validation is claimed.
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.