Fix the PE relocation block validation #395

Open
meshahid973 wants to merge 1 commit from upstream-pr/395 into main
meshahid973 commented 2026-11-26 08:49:29 +00:00 (Migrated from github.com)

Imported from omonkeyz/xbox-emulator. Originally posted by meshahid973 on 2026-11-26T08:49:29Z.


Library / area: tombox-pe

Exports changed: None

Source of the behaviour: PE/COFF specification and existing parser bounds checks.

Adds relocation block validation to reject invalid sizes, truncated data and RVA overflows, with regression tests.

AI-assisted

  • cargo test -p tombox-pe passes
  • No game or console files and no binaries included
  • No fake success
<!-- greyfinch-sync:omonkeyz/xbox-emulator:issue:5506863320 --> Imported from [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator/pull/395). Originally posted by [meshahid973](https://github.com/meshahid973) on 2026-11-26T08:49:29Z. --- **Library / area:** tombox-pe **Exports changed:** None **Source of the behaviour:** PE/COFF specification and existing parser bounds checks. Adds relocation block validation to reject invalid sizes, truncated data and RVA overflows, with regression tests. _AI-assisted_ - [x] `cargo test -p tombox-pe` passes - [x] No game or console files and no binaries included - [x] No fake success
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/395:upstream-pr/395'
git switch 'upstream-pr/395'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/395'
git switch 'upstream-pr/395'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/395'
git switch 'upstream-pr/395'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/395'
git switch 'main'
git merge --squash 'upstream-pr/395'
git switch 'main'
git merge --ff-only 'upstream-pr/395'
git switch 'main'
git merge 'upstream-pr/395'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
omonkeyz/xbox-emulator!395
No description provided.