Repository navigation
PE: tests for delay-import parsing (names, ordinals, IAT bounds) - #2731
Vedoxdev123 wants to merge 1 commit into
Conversation
parse_delay_imports had no unit test in victory-pe; delay imports were only reached through the loader's load_probe fixture and the census's synthetic ImageInfo. Add four tests on a synthetic image: - a delay-load directory lists its DLL, a name import (with hint) and an ordinal import, with the IAT slot RVA of each, and adds nothing to the normal imports; - an image without the directory has no delay imports; - an IAT whose last slot ends exactly at SizeOfImage is accepted; - one byte further, and an IAT at the 4 GiB limit, are refused as malformed. Tests only; no change to the parser. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
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 |
|
Independent native Linux verification of
Commands for the original head: cargo test -p victory-pe --locked --offline -- --skip parses_own_test_binary --skip rva_to_file_offset_maps_entry_point --skip rva_to_file_offset_rejects_offsets_past_4_gib --skip rejects_iat_outside_image
cargo clippy -p victory-pe --all-targets --all-features --locked --offline -- -D warningsThe 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. |
|
Independent Windows 11 verification and review of Verification (
|
|
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). |
|
Automated triage for the maintainers. Adds four unit tests for Generated by Claude Code |
|
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 Tested
Not tested
AI use
|
Dukestar69
left a comment
There was a problem hiding this comment.
Reviewed and verified locally on Windows 11 x64:
cargo test -p victory-pe -- --test-threads=1: 40 passed, 0 failed (including all 4 new delay-import tests: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, anda_delay_iat_running_past_the_image_is_rejected).cargo clippy -p victory-pe --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
parse_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