PE loader: reject unreadable export forwarders #1125
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1134"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by anakatt on 2026-11-24T12:18:00Z.
I reject an unreadable PE export forwarder instead of treating its RVA as an ordinary export address. Previously, a missing string terminator caused the forwarder data's address to enter the owned export tables.
What is in it
pe.rs: propagate a failed forwarder-string read asNone, with a contract comment.OwnedExportslookups.Tested
I ran debug tests on Windows 11 Pro ARM64 10.0.26100.1742 in UTM (4 GiB RAM, virtual
virt-10.0CPU, Red Hat VirtIO GPU DOD), using Rust 1.100.0x86_64-pc-windows-msvcand Visual Studio 2022 Build Tools. The guest used main47efa2ecea0a12934719ae69b81930cf02a4b1c3plus the source changes committed asaeb5ca72aa4b6f7fc4ecaad2c8225c1dff59e6e7.cargo test --locked -p xcl --lib pe::tests::unterminated_forwarders_are_not_export_addresses -- --exact:Some(Rva(4156))instead ofNone.SKIPPEDoutput.Not tested
I have not run the full workspace suite, native x64 Windows hardware, D3D12 GPU execution or a real game title. This verifies PE parsing and owned export lookup, not loading a malformed DLL into a game process.
Regression run
Not run. This remains a draft pending the required real-title
xcl-smokeblocks from main and this PR's clean head, using the same title and duration.AI use
I used omp (
openai-codex/gpt-6-astra) to investigate, implement the fix and regression, run the Windows test, and prepare this PR.Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T12:41:03Z.
Hardware test report — commit
aeb5ca7Verified clean merge with
main(47efa2e) onaeb5ca72aa4b6f7fc4ecaad2c8225c1dff59e6e7: pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace --no-fail-fast -- --test-threads=4:742 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none), includingpe::tests::unterminated_forwarders_are_not_export_addressesand all 11pe::testsRegression run
main(47efa2e):PR (
aeb5ca7):Not tested
XCL_D3D12_DEBUG=1; gameplay past the menusAI use: Antigravity (Google DeepMind), Gemini (exact version string not exposed in runtime environment) — ran the workspace test suite and 60 s retail smoke check on the hardware above and formatted this report.
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T14:35:00Z.
A run on Linux under Wine.
Tested
x86_64-pc-windows-gnu.aeb5ca7as it is (based on47efa2e), no uncommitted changes. The lib test binary runs under Wine, one test per process (--exact).pe::tests::unterminated_forwarders_are_not_export_addresses: ok, no SKIPPED.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T08:02:16Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:40:20Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:53:32Z.
Triage (#1607) – head
aeb5ca7No open or merged PR makes the same change: the other open PE loader PRs (#700, #1367, #1397 and others) do not touch
Pe::export_target, and main still turns an unreadable forwarder string intoExportTarget::Rvapointing inside the export directory.The fix in
pe.rs:export_target(Some(self.cstr_at(rva)?)) drops such an export fromOwnedExportsinstead, and the test covers both File and Mapped layouts. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.