Repository navigation
pe_inspect: report run-time load candidates (DLL names held as strings, not imported) - #2456
Conversation
…s, not imported) A module can reach another one only through LoadLibrary* at run time: XCurl.dll and libHttpClient.GDK.dll reach xgameruntime.dll that way, and XCurl also gameplatformservices.dll (docs/runtime_imports.md, ItsNotRexed#1384, ItsNotRexed#2372). The import table doesn't show those, so pe_inspect's report didn't either. It now lists DLL names the image holds as ASCII or UTF-16LE strings without importing them, each with its encoding and the same bundled/system/shim classification as the imports, in the JSON (runtime_load_candidates) and a markdown section. The image's own names (file name and export-directory name) are left out. A UTF-16 name must follow a NUL, so the tail of an ASCII string followed by a wide one isn't read as a name (the test caught "a.dll\0" + L"b.dll" reading as "lb.dll"). On the package's DLLs (local run, nothing committed) it lists exactly the loads found by hand: XCurl gameplatformservices.dll and xgameruntime.dll (utf-16), libHttpClient xgameruntime.dll and ntdll.dll, the FidelityFX loader its upscaler and frame-generation DLLs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Checked
Nit (not blocking): candidate names are lowercased by Verdict: passes. AI-assisted review. |
What and why
Some modules reach others only through
LoadLibrary*at run time:XCurl.dllandlibHttpClient.GDK.dllreachxgameruntime.dllthat way (runtime: serve LoadLibrary/GetProcAddress of shim-owned modules; xgameruntime.lib's run-time entry points #1384);XCurl.dllalso reachesgameplatformservices.dll(xgameruntime: own gameplatformservices.dll, XCurl's other way into the runtime #2372);None of those is in an import table, so
tools/pe_inspect.py's report didn't show them. Every one was found by hand from the strings.The change
pe_inspectnow reports run-time load candidates: DLL names the image holds as ASCII or UTF-16LE strings without importing them. It's in the JSON asruntime_load_candidates, each entry withname,encoding(ascii/utf-16/both) andwhere, using the same bundled/system/shim classification as the imports. The markdown report gets a "Run-time load candidates" section."a.dll\0" + L"b.dll"coming out aslb.dll.Tests (
tests/test_pe_inspect.py, synthetic images)XGameRuntime.dlland an ASCIIgameplatformservices.dllplaced into the fixture are reported, while the importedxmem.dllisn't. The fixture's existing non-importedd3d12_xs.dllstring is the baseline.dll_stringscovers both encodings ("both"), the image's own name in another case, an imported name, and near misses (x.dllz, a bare.dll).tests/test_pe_inspect.py: 45 passed.On the package's DLLs (local run, nothing committed), it lists exactly the loads found by hand:
gameplatformservices.dllandxgameruntime.dll(UTF-16);xgameruntime.dllandntdll.dll;amd_fidelityfx_upscaler_xbox.dllandamd_fidelityfx_framegeneration_xbox.dll.Disclosure: written with an AI assistant (Claude Code). I reviewed it and ran the tests above.
🤖 Generated with Claude Code