Scripts: read PE exports stored in image headers #1685
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1685
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1685"
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?
@jeroenhaentjens on GitHub · 2026-11-24 19:15 UTC · original
jeroenhaentjens:scripts/pe-header-exports→main· +43 −0 · 3 files · 1 commits · openscripts/re/pe_exports.pyraisesValueError: 0x200for exports stored in PE image headers. Resolve header RVAs directly, bounded bySizeOfHeadersand file length, before searching sections.What is in it
Tested
30852cf11b086bef9daaf8de3450122d2a0a3068; basec160d86ef2efe3a07e4dfb473e4fa72eafb413c0.CARGO_INCREMENTAL=0,CARGO_PROFILE_DEV_DEBUG=0,CARGO_PROFILE_TEST_DEBUG=0to limit disk usage.XCL_ADAPTER=nvidia;XCL_DXC_DIRpoints to DXC's x64 binaries.cargo build --workspace --locked: passed on PR and base.cargo test --workspace --locked --no-fail-fast -- --test-threads=4: final PR run 858 passed, 0 failed, 42 ignored; base run identical. Built-in test-title e2e tests passed.coherent_buffer_sanitizes_console_flags_and_statefailed itsVirtualFreeassertion atreal.rs:5825. The exact test passed alone (cargo test -p xcl --lib coherent_buffer_sanitizes_console_flags_and_state -- --test-threads=1 --nocapture); a full rerun passed with no source changes. Cause remains unconfirmed; this intermittent result is disclosed for maintainer review.gpu_geometry_wave32_prefix_count_over_a_maskandgpu_wave32_program_in_wave64_hardware(no native wave64);heap_window_out_of_memory_falls_back_to_the_switch_form(opt-in disabled).XCL_HEAP_WINDOWS=1:cargo test -p xcl --test gpu_compute_e2e heap_window_out_of_memory_falls_back_to_the_switch_form -- --exact --test-threads=1 --nocapture: 1 passed, 0 failed, no GPU skips, real NVIDIA backend confirmed.python -m unittest discover -s scripts -p 'test_*.py' -v: 17 passed, 0 failed, 0 skipped. New regression fails on unpatched main for both PE32/PE32+.git diff --check: passed; working tree clean.Regression run
Not tested
XCL_SAMPLE_*inputs supplied: tests that return early without sample data are not retail coverage, even when Cargo reports them as passed.AI use
@DavidM1911 on GitHub · 2026-11-24 21:47 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent single-test flake under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodifiedmain.)Thanks!
@RavenCurseBurg on GitHub · 2026-11-26 01:38 UTC · original · edited 2026-11-26 01:52 UTC
Tested
30852cf11b086bef9daaf8de3450122d2a0a3068against the same header RVA change ported onto #1814 (parent0180bf493cb1).I ran
python -B scripts/re/pe_exports.py <eight fixtures> %WINDIR%\System32\version.dll %WINDIR%\SysWOW64\version.dllwith all ten paths in one invocation on each revision. The two readers printed identical output for all ten files.FixtureValue, RVA0x1180.GetFileVersionInfoWandVerQueryValueW. I checked the optional header magic independently for each DLL.python -B -m unittest discover -s scripts -p "test_pe_exports.py"passed all 9 tests, with no failures or skips.Windows build 26100, i7-13700, Python 3.14.3. OpenAI Codex (GPT-6) ported the change and ran these read-only checks. No DLL was loaded; the runtime, GPU and game suite were not exercised.
@luckyteagirl on GitHub · 2026-11-26 05:36 UTC · original · reviewed
Could header string reads stop at
SizeOfHeadersas well as checking the starting RVA?off()accepts a name RVA inside the headers, butcstr()then scans the entire file for NUL. In the existing PE32 and PE32+ synthetic fixtures, movingHeaderExportto file offset0x3FCwithSizeOfHeaders=0x400still printsHeaderExport: onlyHeadis in the mapped headers and the suffix comes from unrelated.textbytes on disk. Carrying a mapped-region bound intocstr()would reject that name; fixed-width table reads need the same boundary check. Reproduced on exact head30852cf11b086bef9daaf8de3450122d2a0a3068; no DLL was loaded. AI-assisted review with Codex.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.