pe_inspect: parse and validate PE export forwarders table #45

Open
github-bot wants to merge 1 commit from github-bot/gh-45 into main AGit
Owner

@⁠Andretuta on GitHub · 2026-11-24 02:06 UTC · original
ubiquitarianism:old-pr/9768 → main · +270 −16 · 2 files · 1 commits · draft

Carried over from old PR 9768 by abnalstlll-byte in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch old-pr/9768, exactly that PR's last commit. All carried-over PRs are listed in #17.
Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it.
abnalstlll-byte: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one.


Original description (mentions and #N references are disabled; the numbers refer to the old repository):

Parse and validate PE export forwarders in tools/pe_inspect.py.

What and why

PE exports can contain forwarder RVAs pointing into other DLLs. This change:

  • Parses export forwarder strings within the export directory bounds.
  • Validates export forwarder RVAs against the pe_loader contract.
  • Adds comprehensive unit test coverage in tests/test_pe_inspect.py (69/69 pass).

Verification

  • python -I tests/test_pe_inspect.py -> 69/69 pass.
  • python -I scripts/check_no_game_data.py -> clean (zero game data).
  • git diff --check -> clean.
  • Python standard library only, Windows / cross-platform compatible.

AI-assisted.

**@⁠Andretuta** on GitHub · 2026-11-24 02:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/45) `ubiquitarianism:old-pr/9768` → `main` · +270 −16 · 2 files · 1 commits · draft > Carried over from **old PR 9768** by `abnalstlll-byte` in the original Leonida repository, which went private on 23 Nov 2026. The code is the branch `old-pr/9768`, exactly that PR's last commit. All carried-over PRs are listed in #17. > Opened as a draft, and the CI runs the opening started were cancelled so 250 PRs don't fill the queue. Re-run CI here when you review it. > `abnalstlll-byte`: this is your work. Feel free to take it over, by pushing to the branch or opening your own PR and closing this one. --- Original description (mentions and `#N` references are disabled; the numbers refer to the old repository): Parse and validate PE export forwarders in `tools/pe_inspect.py`. ### What and why PE exports can contain forwarder RVAs pointing into other DLLs. This change: - Parses export forwarder strings within the export directory bounds. - Validates export forwarder RVAs against the `pe_loader` contract. - Adds comprehensive unit test coverage in `tests/test_pe_inspect.py` (69/69 pass). ### Verification - `python -I tests/test_pe_inspect.py` -> 69/69 pass. - `python -I scripts/check_no_game_data.py` -> clean (zero game data). - `git diff --check` -> clean. - Python standard library only, Windows / cross-platform compatible. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:42:13 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 08:02 UTC · original

Verified clean and ready for review: 69/69 tests pass under python -I tests/test_pe_inspect.py, zero game data, conforms to PE loader contract.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 08:02 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/45#issuecomment-7125658935) Verified clean and ready for review: 69/69 tests pass under python -I tests/test_pe_inspect.py, zero game data, conforms to PE loader contract.
This pull request has changes conflicting with the target branch.
  • tests/test_pe_inspect.py
  • tools/pe_inspect.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/45/head:github-bot/gh-45'
git switch 'github-bot/gh-45'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-45'
git switch 'github-bot/gh-45'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-45'
git switch 'github-bot/gh-45'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-45'
git switch 'main'
git merge --squash 'github-bot/gh-45'
git switch 'main'
git merge --ff-only 'github-bot/gh-45'
git switch 'main'
git merge 'github-bot/gh-45'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.