Commit Graph

6 Commits

Author SHA1 Message Date
e78ca1ee90 Merge pull request #2318 from syfyra/fix/inline-scan-copy-before-load
inline_scan: follow a list copied before the cursor load (INLINE-SCAN-COPY-BEFORE-LOAD)
2026-12-01 16:18:30 +01:00
2de87e5ea1 inline_scan test: pass --base=-0x1000 so argparse reaches _parse_base 2026-11-27 19:55:01 +08:00
757ffc364b inline_scan: support UTF-8 BOM, clean up dumpbin Popen on early close, and validate --base 2026-11-26 19:59:20 +08:00
1efc629096 inline_scan: follow a list copied before the cursor load (INLINE-SCAN-COPY-BEFORE-LOAD)
classify() walks back from a cursor store-back and took the load
`mov rax,[rcx+18h]` as the list's cursor only if rcx was already in
`bases` at that point. A copy `mov rbx,rcx` that comes before the load is
met after it on the way back, so the load counted as another structure's
+18h, the site lost load_traced and an unchecked write of that shape was
reported as `unrelated`: the summary said "UNCHECKED 0" for a write that
never checks. A checked write of the same shape was already found,
because the compare pass runs forwards over the final `bases`.

Record the load's base and check it once the walk has collected every
register the list was copied through. A load from a register that never
held the list is still another structure, as before.

Tested: new test_list_copied_before_the_cursor_load_is_still_unchecked
(fails before the fix for the copy-before-load order, passes after) and
test_cursor_loaded_from_another_structure_is_not_a_list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-26 12:28:44 +01:00
d4dfcea7bd fix(tools): inline_scan exits 2 when it reads no instructions
An empty file, a text file that is not a dumpbin listing, or a PE dumpbin
prints no code for gave "list sites 0: checked 0, UNCHECKED 0" and exit 0,
the same as a clean image. The scan now counts the instructions it reads,
prints the count, and exits 2 with a message when there are none.
2026-11-22 20:19:45 +00:00
ca438076bc feat(tools): inline_scan finds inline command-list writes and whether each checks the cursor limit
The package's DLLs check before every inline write (BVH builder 196/196, FSR 9/9), so a layer that keeps
the cursor at the limit sees every command. Whether the game's executable does the same was open until it is
available; inline_scan answers it in one pass over a dumpbin listing. Baseline in d3d12_command_objects.md,
day-one step in design.md.
2026-11-22 19:37:55 +00:00