mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:00:52 +01:00
[PR #2318] inline_scan: follow a list copied before the cursor load (INLINE-SCAN-COPY-BEFORE-LOAD) #2323
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2323
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2318
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/inline-scan-copy-before-load📝 Commits (1)
1efc629inline_scan: follow a list copied before the cursor load (INLINE-SCAN-COPY-BEFORE-LOAD)📊 Changes
2 files changed (+45 additions, -3 deletions)
View changed files
📝
tests/test_inline_scan.py(+38 -0)📝
tools/inline_scan.py(+7 -3)📄 Description
Claimed in the coordination issue as: INLINE-SCAN-COPY-BEFORE-LOAD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7193762634)
What and why
tools/inline_scan.pyexists to say whether every inline command-list write checks the cursor limit; "UNCHECKED 0" is the answer the day-one check indocs/design.mdreads as "a cursor-at-limit layer sees every command".classify()walks backwards from a store-backmov [rbx+18h],raxand accepted the cursor loadmov rax,[rcx+18h]only if rcx was already known to hold the list at that point of the walk. Whenthisis copied first:the walk meets the load before the copy, so the load was taken for another structure's
+18h,load_tracedwas False and the write was reported asunrelated. The summary saidUNCHECKED 0and counted it among the "cursor-like stores with no list field nearby". The same write with the list in rbx throughout, or with the copy after the load, is UNCHECKED, and the checked form of this exact shape is already a test (test_list_copied_to_another_register_is_followed), found only because the compare pass runs forwards over the final register set.The load's base is now recorded and checked after the walk, against every register the list was copied through. A load from a register that never held the list still marks the site as another structure. Checked sites do not depend on the load, so the change can only move a site from
unrelatedtoUNCHECKED; the counts indocs/d3d12_command_objects.md(every DLL site checked) cannot change, but I could not re-run them here (no game files).Tested
Windows 11, Python 3.14.7, synthetic dumpbin-style listings only:
python -I tests/test_inline_scan.py: 16 tests OK. Newtest_list_copied_before_the_cursor_load_is_still_uncheckedruns the unchecked write with the copy before and after the load; onmainthe copy-before-load case fails (listis False), with the fix both are UNCHECKED with the cursor traced and size 0x10. Newtest_cursor_loaded_from_another_structure_is_not_a_listkeeps a load through a register that is never a copy of the list (rsi) out of the list sites.python -I tests/test_cpu_feature_scan.py(importsinline_scan) OK; the test of open #536 (test_inline_scan_extra.py) also passes on this branch.python -m compileall;scripts/check_no_game_data.pyon both files.read_linesandmainin the same file (different topic).GPUs tested: n/a (CPU-only tool)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.