Repository navigation
Conversation
absolute_refs, the queue-description windows and movabs_pairs stopped one step short: range(0, len - 8, 8), range(0, len - 16, 4) and range(len - 10) never reach the 8-byte slot, 16-byte window or 10-byte instruction that ends exactly at the section end. A GUID pointer, queue description or movabs GUID half there was silently dropped. Use len - 7, len - 15 and len - 9, the same "must fit entirely" bound rip_refs already uses, and test each scan on a hand-built PE32+ whose candidate ends its section. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 928633e on Windows 11, Python 3.12 (CPU only): pass
AI-assisted (Claude Code). |
|
Verified against main 1cc6e3c: merges cleanly; test_d3d12_guid_sites.py runs Ran 10 OK (re-run), and on a clean main worktree exactly the three new last-whole-slot tests fail — a clean differential. The bound fixes are correct at the edges (last valid start = len−N, alignment preserved on the 8-byte stride loop), and the tests assert concrete RVA/type values rather than just non-crash. Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Tested 928633e merged with main 5e54bda on Linux/Python 3.12.16: pass Merge was clean (tools/d3d12_guid_sites.py, tests/test_d3d12_guid_sites.py).
Diff read: three loop bounds that skipped the last whole item of a section are corrected: |
Claim: #6214 (comment) (finding + claiming, new item)
Cause
Three scans in
tools/d3d12_guid_sites.pystop one step before the end of the section they walk:tools/d3d12_guid_sites.py:248(absolute_refs):range(0, len(blob) - 8, 8)never reads the 8-byte slot atlen - 8. Section raw sizes are multiples of 8, so the last pointer of every data section was skipped.tools/d3d12_guid_sites.py:322(queue descriptions):range(0, len(blob) - 16, 4)skips the 16-byte window atlen - 16.tools/d3d12_guid_sites.py:229(movabs_pairs):range(len(blob) - 10)skips a 10-byteREX.W B8+r imm64that ends the code section.A GUID pointer, a
D3D12_COMMAND_QUEUE_DESCor a movabs GUID half in that last slot was dropped with no message. The tool's docstring says it "scans data sections for absolute 8-byte pointers" and reports "data windows referenced by code that parse as aD3D12_COMMAND_QUEUE_DESC".rip_refsin the same file already uses the right bound:range(len(blob) - 6)for a 7-byte instruction, with the comment "must fit entirely".Fix
Use
len(blob) - 7,len(blob) - 15andlen(blob) - 9, so the last whole slot is included. A truncated section still can't read past its bytes.Tests
tests/test_d3d12_guid_sites.pygets three new cases. Each is built with the file's ownpe32plus()/lea()builders and puts the candidate at the very end of its section: a queue description in the last 16 bytes of.rdata, an absolute pointer to a GUID in the last 8 bytes of.rdata, and amovabspair that ends.text. On origin/main all three fail with an empty result, and they pass with the fix.Tested on Linux, Python 3.14.8 (no GPU needed):
python -I tests/test_d3d12_guid_sites.py: 10 tests OK. Without the tool change, the 3 new tests fail.python -I tests/test_text_write_line_endings.pyOKpython -m compileall -q make_game.py tools testsOK,git diff --checkcleangit merge-treeagainst the open d3d12_guid_sites: an image, --header or --json path it cannot read is one ERROR line and exit 2 #5737 (same files, error handling only) merges cleanly.Synthetic inputs only, no game data.
AI-assisted (Claude Code).
🤖 Generated with Claude Code