Repository navigation
Conversation
…other version of a shimmed contract Windows resolves an api-ms name without its last version segment, but shims::find matches the exact dll!name, so an import through another version of a registered contract binds to the host. tools/shim_aliases.py reads the SHIM_TABLE rows and an image's import tables and lists those imports; docs/shim_aliases.md records the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Ran the requested retail check at 0 version aliases and 0 other same-name shim bypasses. The command exited 0. Of 563 named imports, 53 matched an exact DLL/function row and the remaining 510 had no function-name match in this revision’s parsed shim table. This is a static check of the table. I independently counted 587 regular imports with Retested the revised reporting on |
…cutable's result Review on ItsNotRexed#7207 (Kev-Ball): the summary counted named imports only, so label it as such and report the image's ordinal imports beside it. docs/shim_aliases.md records their independent run on the retail executable: 563 named imports, 24 by ordinal, 53 through a shim, 0 bypasses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
AI-assisted. No game files used. Thanks @Kev-Ball, that's the run this needed. Pushed
|
|
Tested 622ba5e on Windows 11, AMD Radeon RX 9070 XT (RDNA4), driver 32.0.32029.2010: pass
AI-assisted (Claude Code). |
|
Tested 622ba5e on Windows 11, Python 3.15.2, NVIDIA RTX 4060 Ti (driver 621.24; CPU-only checks, no game files, no GPU/llvm-mc/MSVC used): pass. Ran the test files this PR adds or changes, from a clean checkout of the PR head: AI-assisted (Claude Code). |
AI-assisted. No game files used.
Claimed in the coordination issue as: #7049 (comment) (RT-5)
Depends on: none.
What and why
The shim registry keys each row on the exact lower-cased
dll!name(runtime/shims/registry.cpp,find), and the loader binds anapi-ms-*/system-DLL import without a row to the host. Windows is looser. It resolves an API-set name without its last version segment. Measured withApiSetQueryApiSetPresenceon Windows 11 26200:api-ms-win-core-processthreads-l1-1-0,-l1-1-3and the never-published-l1-1-99are all present, while-l1-2-0is not. So a function shimmed under…-l1-1-0.dllruns the host's code when an image imports it from…-l1-1-2.dll. Nothing reports it, andgta6rt --dry-runcounts it ashost. ForExitProcess, which is shimmed only underprocessthreads-l1-1-0pluskernel32/kernelbase, that is the #4043 failure again.tools/shim_aliases.py(standard library; reusespe_inspect.PeImage):table/contractsread theSHIM_TABLE(...)rows fromruntime/shims: literal rows plus the dll-taking and stringizing macros a file or header defines. Onae12372that is 379 rows, 138 functions and 29 DLL names, with 9 API-set contracts.check <image>...lists every import that names a shimmed function under an unregistered DLL, and tagsversion aliaswhen only the last segment differs.tests/test_shim_aliases.py: 8 tests. Shim sources are written by hand, including commented-out rows, a"//"inside a DLL name, nested macros and a header macro. The PE32+ image is built byte by byte with normal, delay and ordinal imports. One test reads this checkout'sruntime/shims, so a row format the parser misses fails CI.docs/shim_aliases.md(+ adocs/README.mdrow): the Windows rule, the contracts and versions the table registers, how to runcheckon the executable, and the fix this suggests (match by contract inregistry.cpp, exact name first). That fix is not made here.I don't have the executable, so its 432 host imports (#6715) are unmeasured. Running
checkon it is the next step for someone who has it.Tested
Windows 11 Pro 26200, Python 3.14, CPU only,
mainae12372.python -I tests/test_shim_aliases.py: 8 tests OK. Mutation check: makingcontract()return the full name fails 3 tests; treating every import as shimmed fails 1. Both restored, green again.tests/test_pe_inspect.py,tests/test_ci_registration.pyand all 11tests/test_docs_*.py: OK.python -m compileall -q make_game.py tools tests,git diff --checkandscripts/check_no_game_data.pyon the four changed files: clean.AI-assisted: yes. Written by Claude Code (Claude Opus 5.5) together with neeshz, who chose the RT-5 direction and reviewed it.
Checklist
docs/design.md, with how it was confirmed. (not a translator change)🤖 Generated with Claude Code