pe_inspect: parse and validate PE export forwarders table (OLD-9768) #693

Merged
abnalstlll-byte merged 4 commits from upstream-pr/693 into main 2026-12-02 10:40:13 +00:00
abnalstlll-byte commented 2026-11-24 12:16:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T12:16:27Z.


Related issues: #14, #17, #18 (restoring old upstream PR 9768, author restoration for draft PR #45).

What and why

Restores original pull request OLD-9768 authored by @abnalstlll-byte:

  • Extends \ ools/pe_inspect.py\ with full support for PE Export Address Table (EAT) forwarder validation.
  • Detects and resolves forwarder RVA ranges pointing into the export directory section.
  • Validates forwarder target syntax (\DLL.Symbol\ and \DLL.#Ordinal) and ensures forwarders conform to
    untime/src/pe_loader.cpp\ contracts.
  • Python 3.11+ string formatting compatibility.
  • Comprehensive synthetic test coverage in \ ests/test_pe_inspect.py\ (69/69 PASS).

Tested

  • Windows 11 x64, Python 3.14 / 3.12:
    • \python -I tests/test_pe_inspect.py: 69/69 PASS.
    • \python -I scripts/check_no_game_data.py\ on changed files: PASS.
  • Clean merge against \ubi/main\ (0 conflicts).

Checklist

  • No proprietary payloads, game-derived files, keys, or protection workarounds.
  • Standard library only (\python -I).
  • Preserves author attribution and original PR commit provenance.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5471967900 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/693). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T12:16:27Z. --- Related issues: #14, #17, #18 (restoring old upstream PR 9768, author restoration for draft PR #45). ### What and why Restores original pull request **OLD-9768** authored by @abnalstlll-byte: - Extends \ ools/pe_inspect.py\ with full support for PE Export Address Table (EAT) forwarder validation. - Detects and resolves forwarder RVA ranges pointing into the export directory section. - Validates forwarder target syntax (\DLL.Symbol\ and \DLL.#Ordinal\) and ensures forwarders conform to \ untime/src/pe_loader.cpp\ contracts. - Python 3.11+ string formatting compatibility. - Comprehensive synthetic test coverage in \ ests/test_pe_inspect.py\ (69/69 PASS). ### Tested - Windows 11 x64, Python 3.14 / 3.12: - \python -I tests/test_pe_inspect.py\: 69/69 PASS. - \python -I scripts/check_no_game_data.py\ on changed files: PASS. - Clean merge against \ubi/main\ (0 conflicts). ### Checklist - [x] No proprietary payloads, game-derived files, keys, or protection workarounds. - [x] Standard library only (\python -I\). - [x] Preserves author attribution and original PR commit provenance.
abnalstlll-byte commented 2026-11-25 21:35:31 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T21:35:31Z.


Rebased cleanly onto latest \main\ (\e34ff17e9), clearing stale base CI failures. Verified: all 78 tests in \ est_pe_inspect.py\ pass.

AI-assisted (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7175280560 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/693#issuecomment-7175280560). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T21:35:31Z. --- Rebased cleanly onto latest \main\ (\e34ff17e9\), clearing stale base CI failures. Verified: all 78 tests in \ est_pe_inspect.py\ pass. AI-assisted (Claude Code)
MoonEyes commented 2026-11-28 02:48:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T02:48:26Z.


Hi @abnalstlll-byte, thanks for this pull request. It currently conflicts with main (conflicting file(s): tests/test_pe_inspect.py, tools/pe_inspect.py), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7232605806 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/693#issuecomment-7232605806). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T02:48:26Z. --- Hi @abnalstlll-byte, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `tests/test_pe_inspect.py`, `tools/pe_inspect.py`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
aslan2142 commented 2026-12-01 11:44:28 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:44:28Z.

Review: CHANGES_REQUESTED


This PR cannot merge in its current state:

  • Merge conflicts with main in tools/pe_inspect.py and tests/test_pe_inspect.py.
  • Failing CI (translator-tests, stdlib-tests-linux, macos-python, check).

Please rebase onto current main and re-run CI to green.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130563606 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/693#pullrequestreview-6130563606). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:44:28Z. **Review:** CHANGES_REQUESTED --- This PR cannot merge in its current state: - **Merge conflicts** with `main` in `tools/pe_inspect.py` and `tests/test_pe_inspect.py`. - **Failing CI** (`translator-tests`, `stdlib-tests-linux`, `macos-python`, `check`). Please rebase onto current `main` and re-run CI to green. *(AI-assisted review.)*
MoonEyes commented 2026-12-02 07:13:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T07:13:26Z.


This PR has not moved since 25 November and conflicts with main in tools/pe_inspect.py and tests/test_pe_inspect.py (main added resources_markdown(), unverified imports and system-DLL notes in the same places). I opened #3060, which is main merged with this head: your commits are kept, and so is what main added. This PR stays open until a maintainer decides. If you rebase it yourself, say so and I will close #3060.

AI-assisted (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7337923077 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/693#issuecomment-7337923077). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T07:13:26Z. --- This PR has not moved since 25 November and conflicts with `main` in `tools/pe_inspect.py` and `tests/test_pe_inspect.py` (`main` added `resources_markdown()`, unverified imports and system-DLL notes in the same places). I opened #3060, which is `main` merged with this head: your commits are kept, and so is what `main` added. This PR stays open until a maintainer decides. If you rebase it yourself, say so and I will close #3060. AI-assisted (Claude Code)
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
ProjectLeonida/mandy!693
No description provided.