Validate DXContainers and mapped PE section bounds in call_evidence #130
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/131"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by alexander-src on 2026-11-21T16:47:24Z.
Change
Align
tools/call_evidence.py'sshader_containers()withtools/resource_inventory.py's DXContainer validation rules (commitsfadc3cdande69639d) and require mapped PE section extents before recording a container or size/pointer pair:resource_inventory.parts()instead of the duplicate ascending-offset loop so valid DXContainers with unordered part-offset tables are indexed (and theirRTS0root header extracted) while containers with overlapping physical parts or duplicate FourCC tags are rejected before they can breaktools/probe_roots.py.pe.get_rva_from_offset()calls with_mapped_rva(pe, offset, length)backed bype.get_section_by_offset(), skipping containers or(size, pointer)pairs that fall in unmapped PE overlays, headers, zero-PointerToRawDatasections, or cross past section bounds instead of raisingTypeErrorwhenget_rva_from_offset()returnsNone(or returning bogus header RVAs on small overlays below the first section'sVirtualAddress).tests/dxcontainer_part_offsets_check.pyexercising unordered directories with anRTS0header, duplicate FourCC rejection, overlapping part rejection, and unmapped overlays at both< 0x1000and> 0x1000file offsets.Verification
Tested on Linux x86_64 (
Python 3.14,pefile) at commit2a3f6ec(based onfd1ff2a):python3 -B tests/dxcontainer_part_offsets_check.py -v: 5 tests passed (includingtest_call_evidence_matches_dxcontainer_rules_and_skips_unmapped_bytesfor both0x200and0x1200section sizes).python3 -B tests/script_state_check.py: 3 tests passed.python3 -B tests/bcpack_check.py: 3 tests passed.python3 -B tests/resource_ranges_check.py: 3 tests passed.python3 -B tests/layout_chunks_check.py: passed (layout chunk summary ok).python3 -B tests/intake/paths_check.py: passed.Evidence and follow-up
All new test inputs are synthetic byte buffers generated in
tests/dxcontainer_part_offsets_check.py(original MIT-licensed code, no third-party binaries or game assets).The Windows C++ build and
dumpbininvocation path incall_evidence.inspect()were not run locally on Linux and remain covered by Windows CI.AI-assisted: yes.