pe_inspect: parse and validate x64 pdata exception directory table (OLD-7796) #698

Closed
abnalstlll-byte wants to merge 3 commits from upstream-pr/698 into main
abnalstlll-byte commented 2026-11-24 12:17:26 +00:00 (Migrated from github.com)

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


Related issues: #14, #18 (restoring old upstream PR 7796).

What and why

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

  • Extends \ ools/pe_inspect.py\ with full support for parsing the x64 .pdata\ runtime function exception directory table (\IMAGE_RUNTIME_FUNCTION_ENTRY).
  • Decodes BeginAddress, EndAddress, and UnwindInfoAddress RVAs, asserting monotonicity and valid section containment.
  • Parses \UNWIND_INFO\ structures (version, flags, prolog size, unwind code count, frame register and offset).
  • Comprehensive unit test coverage in \ ests/test_pe_inspect.py.

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:5471982585 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/698). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T12:17:26Z. --- Related issues: #14, #18 (restoring old upstream PR 7796). ### What and why Restores original pull request **OLD-7796** authored by @abnalstlll-byte: - Extends \ ools/pe_inspect.py\ with full support for parsing the x64 \.pdata\ runtime function exception directory table (\IMAGE_RUNTIME_FUNCTION_ENTRY\). - Decodes BeginAddress, EndAddress, and UnwindInfoAddress RVAs, asserting monotonicity and valid section containment. - Parses \UNWIND_INFO\ structures (version, flags, prolog size, unwind code count, frame register and offset). - Comprehensive unit test coverage in \ ests/test_pe_inspect.py\. ### 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:34:17 +00:00 (Migrated from github.com)

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


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

AI-assisted (Claude Code)

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

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


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:7232607002 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/698#issuecomment-7232607002). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T02:48:32Z. --- 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:33 +00:00 (Migrated from github.com)

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

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:6130565049 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/698#pullrequestreview-6130565049). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:44:33Z. **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 11:39:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T11:39:37Z.


Closing: this pull request no longer applies to current main (merge conflict in tools/pe_inspect.py and tests/test_pe_inspect.py), and open pull requests that have fallen out of step with main are being closed so the list stays workable. If you still want this change, rebase it on current main and reopen it (or open a new pull request); it will be looked at again.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7344228716 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/698#issuecomment-7344228716). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T11:39:37Z. --- Closing: this pull request no longer applies to current `main` (merge conflict in `tools/pe_inspect.py` and `tests/test_pe_inspect.py`), and open pull requests that have fallen out of step with `main` are being closed so the list stays workable. If you still want this change, rebase it on current `main` and reopen it (or open a new pull request); it will be looked at again. AI-assisted (Claude Code).

Pull request closed

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!698
No description provided.