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

Open
opened 2026-11-26 20:18:52 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/693
Author: @abnalstlll-byte
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: feat/exe-export-forwarders


📝 Commits (4)

  • 64fae57 pe_inspect: validate Export Address Table entries and forwarder targets against pe_loader contract
  • 2438de1 pe_inspect: extract pipe escaping outside f-string for Python 3.11 compatibility
  • 0abe25d pe_inspect: validate forwarder target syntax, intra-module loops, and PE header bounds
  • 54cac1a pe_inspect: gracefully reject non-x64 machine architectures in exception directory validation

📊 Changes

2 files changed (+733 additions, -19 deletions)

View changed files

📝 tests/test_pe_inspect.py (+336 -0)
📝 tools/pe_inspect.py (+397 -19)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/693 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/exe-export-forwarders` --- ### 📝 Commits (4) - [`64fae57`](https://github.com/ubiquitarianism/leonida/commit/64fae575422f628ace60ecd4e92ace3d4c0cd35a) pe_inspect: validate Export Address Table entries and forwarder targets against pe_loader contract - [`2438de1`](https://github.com/ubiquitarianism/leonida/commit/2438de196930ac205df0aa38e46c2a07bf3b2206) pe_inspect: extract pipe escaping outside f-string for Python 3.11 compatibility - [`0abe25d`](https://github.com/ubiquitarianism/leonida/commit/0abe25d2998a25215c286bc660a3087d012980bf) pe_inspect: validate forwarder target syntax, intra-module loops, and PE header bounds - [`54cac1a`](https://github.com/ubiquitarianism/leonida/commit/54cac1a019c2d6249ccd53491501d1c66f914275) pe_inspect: gracefully reject non-x64 machine architectures in exception directory validation ### 📊 Changes **2 files changed** (+733 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_pe_inspect.py` (+336 -0) 📝 `tools/pe_inspect.py` (+397 -19) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#733
No description provided.