Add a mutation harness for the PE mapper #180
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#180
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
Question
Can the PE mapper be exercised against malformed images without ending the test suite, and does every malformed image produce a named result instead of a crash or a hang?
Evidence so far
tests/cpu/native_map_check.pypatches a handful of specific fields: the entry point, the import directorySize, the delay-import directory and one export address slot. Header corruption, section-table corruption, relocation-table corruption and truncated files are not covered.Proposal
A
cpu_native_mutationtest that applies a fixed list of single-field edits and three truncations to the source-built fixtures. Each case runs in its own process and prints eitherMAP_OKor one of the namedMapStatusvalues with a detail string. The parent fails the case on a crash, a timeout, an unknown status, or a status that disagrees with the returned base.The mutation list is fixed offsets computed with
pefile, not random input, so every run is reproducible and no corpus is needed.Completion condition
ctest --preset dev --no-tests=error -R '^cpu_native_mutation$' -Vpasses onmain, and the same test fails when the mapper is replaced by one that crashes. That control was demonstrated with a three-line mapper DLL that dereferences null.Required environment
x64 Windows, MSVC, CMake/Ninja, Python 3.11 or newer with
pefile. No game files.AI-assisted.