PE: read long-format import descriptors #963
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/963"
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 Marvisak/VIctory. Originally posted by enzoduarte1 on 2026-11-24T14:33:08Z.
What
ImportLibrary::parseonly understood short-format import objects. Long-format import libraries (the ones whose archive members start with a 20-byte descriptor and no inline strings) were counted inother_membersbut yielded no imports at all.This patch recognizes that descriptor form, walks the following COFF members, and recovers the DLL from
__IMPORT_DESCRIPTOR_<dll>plus exports from__imp_<name>symbols. Type, ordinal/hint and name-decoration bits are read from the descriptor header, matching the short-format rules already used by theobjectcrate. Short imports and unrecognized members keep their previous behaviour.Tested
x86_64-pc-windows-gnu(no MSVC linker on this machine).cargo test -p victory-pe --lib -- --test-threads=1: 11 passed, 0 failed.cargo check --workspace: clean, no new warnings.rustfmt --edition 2024 --check crates/victory-pe/src/implib.rsandgit diff --check: clean.cargo xtask policy: 154 files ok. No game files or data taken from them were added.Checklist
cargo fmt --all --checkandcargo test --workspacepass — the workspace has pre-existing formatting diffs and the loader fixture needs MSVC/DELAYLOAD, which MinGW rejects here; the changed crate and a fullcargo check --workspaceare clean.cargo xtask policypasses. The change adds no game files or data taken from them (docs/asset-policy.md).Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T14:46:09Z.
Review: APPROVED
Tested
adeb9ff4on Windows 11, RTX 5070, MSVC:cargo test -p victory-pe11 passed, including the long-format import library tests.__IMPORT_DESCRIPTOR_<dll>and names from__imp_<name>, matches how link.exe lays out long-format import libraries. Short-format parsing is unchanged.implib.rs:125, "thisifstatement can be collapsed".AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:13:14Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
adeb9ff:cargo test -p victory-pepasses, 11 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:28:49Z.
Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed