Repository navigation
Conversation
AurumCarlos
reviewed
Nov 26, 2026
AurumCarlos
left a comment
There was a problem hiding this comment.
Thanks for splitting it out, the diff is now just the parse_exports hunk. A few loose ends:
- The description still mentions
rejects_export_address_below_image_base, but this PR adds no test. Either drop that line, or add a test that really feeds an out-of-range address (the old one passed on the valid path, see my note on #3165). - As noted on #3165,
objectgivesimage_base + rvawith a 32-bit RVA, so this can't trigger today. "Preventing integer overflow" would read better as a defensive check. - #3165 is still open with the same title and the other hunks; closing it (or retitling it for what's left) would avoid two PRs for #2412.
- The new lines look longer than
rustfmtallows;cargo fmtshould reflow them.
Dukestar69
approved these changes
Nov 26, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
Reviewed the diff and verified locally on Windows 11 x64:
- Replacing
address.wrapping_sub(image_base) as u32withchecked_sub(image_base)+u32::try_fromcleanly rejects out-of-range export addresses withPeError::Malformedinstead of silently truncating/wrapping. cargo test -p victory-pe -- --test-threads=1: 36 passed, 0 failed.cargo clippy -p victory-pe --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #2412: Export address validation now uses checked_sub() instead of wrapping_sub(), preventing integer overflow when an export address is below image_base or exceeds u32::MAX.
Changes:
Added test rejects_export_address_below_image_base verifying that an export address below image_base is rejected.