pe: map mutated images in child processes and require named results #181
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!181
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/181/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?
@raulmoracode on GitHub · 2026-11-21 18:04 UTC · original
raulmoracode:pe/mutation-harness→main· +183 −0 · 3 files · 1 commits · merged 2026-11-21 18:11 UTCChange
Adds
cpu_native_mutation, which maps mutated copies of the source-built PE fixtures in child processes and requires a named result.tests/cpu/native_map_check.pypatches specific fields by hand. This test instead applies a fixed list of single-field edits to the header, the first section header, the export, import and base-relocation directories, plus three truncations. Each case runs in its own process, so an access violation or a hang is reported by the parent as a failed case instead of ending the suite.A case is accepted when the child exits normally and prints either
MAP_OKor one of the namedMapStatusvalues with a non-empty detail. The parent fails on a crash, a timeout, an unknown status, or a status that disagrees with the returned base. The control case applies no edit and must map.Fixes #180
Verification
Commit
023f857on Windows 10 22H2 build 19045.6466, VS Build Tools 2022 17.14, MSVC 14.44.35207, Windows SDK 10.0.26100, CMake 4.4.4, Python 3.12.10.Result:
46 cases across
cpu_register_probeandcpu_import_original: no crash, no timeout, and every rejection carried a detail string.Negative control for the harness itself: with the mapper replaced by a three-line DLL whose
pe_map_imagedereferences null, the parent reportsand exits non-zero. The harness therefore detects the failure mode it exists for.
Evidence and follow-up
The edits are computed with
pefilefrom the built fixtures:DOS_HEADER,FILE_HEADER,OPTIONAL_HEADER, the first section header, and data directories 0, 1 and 5. No random input and no corpus.This covers the map and release path. It does not call
pe_map_export, so the export-lookup crash class in #163 is not exercised here; that becomes possible once #167 merges, and the child can then resolve an export before releasing.Checklist
AI-assisted.