PE: tests for delay-import parsing (names, ordinals, IAT bounds) #2731
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!2731
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2731"
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?
@Vedoxdev123 on GitHub · 2026-11-25 19:10 UTC · original
Vedoxdev123:pe/delay-import-tests→main· +90 −0 · 1 files · 1 commits · openparse_delay_importsinvictory-pehad no unit test. Delay imports were only reached through the loader'sload_probefixture and the census's syntheticImageInfo, so a regression in how the parser reads them (or in the IAT bounds check it shares with normal imports) would not fail avictory-petest.What is in it
crates/victory-pe/src/image.rs: four tests on a synthetic image, built on the existingsynthetic_imagehelper. No change to the parser.delay_imports_list_names_and_ordinals_with_their_iat_slots: the DLL name, a name import (hint 5), an ordinal import, and the IAT slot RVA of each; normal imports stay empty.an_image_without_a_delay_load_directory_has_no_delay_imports.a_delay_iat_ending_at_the_end_of_the_image_is_accepted: the last slot ends exactly atSizeOfImage.a_delay_iat_running_past_the_image_is_rejected: one byte further, and an IAT at0xFFFF_FFF8, givePeError::Malformed.Tested
main13f91ca.cargo test -p victory-pe: 40 passed (36 before).entries()changed fromend <= size_of_imagetoend <= u32::MAX,a_delay_iat_running_past_the_image_is_rejectedfails. Reverted.cargo clippy -p victory-pe --all-targets --locked -- -D warnings: clean.rustfmt --edition 2024 --check: clean.cargo xtask policy: 184 files ok.Not tested
victory-pewas run for this change. A full workspace run on this base (GPU and shader crates excluded) passed with no failures.object's there.AI use
No game data used.
🤖 Generated with Claude Code
@cloph-dsp on GitHub · 2026-11-25 19:20 UTC · original
Independent Windows verification (AI-assisted, Hy4 flash). Rust/cargo 1.100.0, MSVC, no game data, no GPU.
Negative control: the four new test names are absent from
origin/mainincrates/victory-pe/src/image.rs(git grep -creturned no matches), so the tests are genuinely introduced by this PR. No blocking findings; synthetic byte buffers only.@XeNS1 on GitHub · 2026-11-25 19:26 UTC · original
Independent native Linux verification of
694baa30780f4634d03d2f831bf11cb5b20ae652on13f91ca, plus integration with the section-RVA coverage in #2740 (f0d5342). Rust 1.100.0, x86-64, two build jobs; no game files or GPU execution.victory-pesuite has 36 passed, 0 failed. Four unchanged tests requiring the host executable to be a Windows PE were excluded by name.--all-targets --all-featuresClippy passes for both the original head and the combination; combined staged asset policy passes.<=to<fails the exact-end acceptance test; allowing every non-overflowing u32 end fails the out-of-image rejection test; changing IAT stride from 8 to 4 fails three new tests. The unmodified snapshot passes all four delay tests.Commands for the original head:
The combination uses the same commands with the overflow-test exclusion removed.
No blocking findings in this scope. Legacy VA-based delay descriptors and actual Windows loading were not exercised. This complements the existing Windows report; no competing implementation. AI-assisted: OpenAI Codex.
@fuzeofficlal on GitHub · 2026-11-25 19:46 UTC · original
Independent Windows 11 verification and review of
694baa3(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo xtask policy: 184 files ok.cargo clippy --locked -p victory-pe --all-targets -- -D warnings: 0 warnings.cargo test --locked -p victory-pe: 40 passed, 0 failed (all 4 new delay-import tests pass).e9df3bd): clean zero-conflict 3-waygit merge-tree; the two PRs are strictly complementary (#2731 pins delay-import parsing and upper IAT bounds, #2741 rejectsiat_rva == 0in non-empty descriptors).Review Notes
SizeOfImageupper bound, 1-byte overshoot, andu32overflow (0xFFFF_FFF8). Ready to merge.@kotekompotek on GitHub · 2026-11-25 20:07 UTC · original
Good coverage of the delay-import path: name ordinals, ordinal-bit entries, iat_slot_rva mapping, and the bounds case. Synthetic fixture builds the descriptor table correctly (RVA attributes bit, terminator descriptor).
@Marvisak on GitHub · 2026-11-25 23:21 UTC · original
Automated triage for the maintainers. Adds four unit tests for
parse_delay_importsin crates/victory-pe/src/image.rs on a synthetic image built from the existingsynthetic_imagehelper: names and ordinals with their IAT slot RVAs, no delay directory, an IAT ending exactly atSizeOfImage, and IATs running past the image or past 4 GiB. I checked that the fixture's descriptor layout (RVA attribute, name table, terminator) is valid and that the expected bounds are the correct PE behaviour rather than just what the code does; no parser change and no game data. CI passes. This is a recommendation for a maintainer to look, not an approval.Generated by Claude Code
@futurepro62 on GitHub · 2026-11-26 12:28 UTC · original
NVIDIA full-suite run, to go with the reports above by XeNS1, cloph-dsp, fuzeofficlal, since none of them names a GPU run. Tested exact head
694baa3(on its base13f91ca).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 777 passed, 0 failed, 9 ignored.delay_imports_list_names_and_ordinals_with_their_iat_slots,an_image_without_a_delay_load_directory_has_no_delay_imports,a_delay_iat_ending_at_the_end_of_the_image_is_accepted,a_delay_iat_running_past_the_image_is_rejected.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
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.