PE: skip unused export slots instead of reporting them at RVA 0 #75
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!75
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/75/head"
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?
@tedin7 on GitHub · 2026-11-24 00:15 UTC · original
tedin7:vic-pe-export-holes→main· +74 −0 · 1 files · 1 commits · merged 2026-11-24 00:33 UTCWhat
parse_exportsnow skips export address-table slots whose address is 0.Why
An address of 0 marks an unused slot (a gap in the ordinals, as in DLLs built with holes or
NONAMEranges). The Windows loader does not treat these as exports.object'sExportTable::exports()still lists them, soImageInfo::exportsreported phantom entries withrva: Some(0)(the image base) and no name. Anything that resolves or lists exports fromImageInfo(e.g.victory inspect) would see them. Forwarded exports are unaffected (a forwarder address is always inside the export directory, never 0).Tested
New unit test
unused_export_slots_are_not_exportsbuilds a synthetic in-memory PE32+ (no game or retail data) with ordinal base 1 and three slots: "alpha", a hole, "gamma".Linux x86_64,
cargo test -j4 -p victory-pe:(None, 2, Some(0))cargo clippy -p victory-pe --tests: cleanrustfmt --checkon image.rs: cleanThe 4 existing tests that parse the host executable (
parses_own_test_binary,rva_to_file_offset_maps_entry_point,rejects_iat_outside_image,dump_tls) fail on Linux because the host is an ELF binary. This is pre-existing and unrelated to this change.Not run: Windows runtime and GPU.
@DaviTostes on GitHub · 2026-11-24 00:24 UTC · original
Tested
9a5cbbestacked on #39 on Arch Linux x86_64, rustc 1.98.1: pass.cargo test --workspace: 156 passed, 0 failed, 3 ignored; merge with #39 clean.#[test]s for the export-address slots, included in that run.AI-assisted (DeepSeek V4.1 Flash coding agent).