PE: checked offsets in rva_to_file_offset and layout, remove dbg_tls #30
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!30
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/30/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?
@AndyLatimer on GitHub · 2026-11-23 23:27 UTC · original
AndyLatimer:fix/pe-rva-offset-overflow→main· +37 −18 · 2 files · 2 commits · merged 2026-11-24 00:33 UTCTwo small checked-arithmetic fixes and a test cleanup in
victory-pe:ImageInfo::rva_to_file_offset(image.rs): switchess.file_offset + deltatochecked_addso a section header withPointerToRawDatanear 4 GiB returnsNoneinstead of overflowingu32(panic in debug builds, wrapped offset in release). Adds regression testrva_to_file_offset_rejects_offsets_past_4_gib.layout.rs): switchesread_u32,read_u64,optional_header_offset,file_header_offsetanddata_directory_offsetto checked arithmetic so extreme offsets returnNoneinstead of overflowing. Adds regression testreads_reject_overflowing_offsets.image.rs): removes the leftover print-onlydbg_tls::dump_tlstest (TLS presence is already asserted inparses_own_test_binary).Testing
cargo test -p victory-pe: 6 passed, 0 failed.cargo clippy -p victory-pe --all-targets: 0 warnings.cargo xtask policy: pass (148 files).@DaviTostes on GitHub · 2026-11-24 00:00 UTC · original
Could not run the Linux check for this head: it conflicts with #39 (the PR that makes the workspace build and test on Linux), so it cannot be stacked without a rebase.
crates/victory-pe/src/image.rs, in themod tests/dbg_tlsregion. This PR removes the leftoverdbg_tlstest and checks layout offsets; #39 adds#[cfg(windows)]gates aroundown_imageand the tests that read the running binary. Both touch the same block.A rebase of this branch onto #39 (or a version of it after #39 lands) would let me run
cargo test --workspacehere and report the result.AI-assisted (DeepSeek V4.1 Flash coding agent).
@lordon1a on GitHub · 2026-11-24 00:20 UTC · original
Verified
ef22723e8on Windows 11 (x86_64-pc-windows-gnullvm,rustc 1.100.0, applied cleanly tomain@35b054ec0): pass.cargo xtask policy: 150 files okcargo test -p victory-pe: 6 passed, 0 failed (+1 new checked-offset test).AI-assisted.