Commit Graph

12 Commits

Author SHA1 Message Date
6233946833 Merge pull request #1119 from Taffyyy-ops/fix/gdk-table-shape
gdk_runtime_calls: validate table lookup shapes (GDK-TABLE-SHAPE)
2026-11-29 15:37:37 +01:00
35b0895dcc gdk_runtime_calls: protect runtime-source directory files from being overwritten by --out
When --runtime-source is a directory of xgameruntime*.cpp (the default
runtime/shims), main() checked if os.path.isfile(a.runtime_source):
inputs.append(a.runtime_source). This left all scanned shim C++ files
omitted from collision detection, allowing --out to overwrite them.

Extract 
untime_source_paths to enumerate the scanned shim files and
include them in the collision check against json/txt output paths.
2026-11-26 00:32:29 +03:00
2297621ef8 Merge pull request #1049 from Taffyyy-ops/fix/x86-high-byte-clobber
Merging.

**Why merged:** X86-HIGH8-IMMEDIATE: in gdk_runtime_calls, a mov of an immediate into AH/CH/DH/BH (B4-B7 with no REX) now marks the parent register as written, as x86 does. KernelSmoker approved it.

**Why it's good:** The high-byte, gdk_runtime_calls, import_call_sites and import_fail_fast tests: 58 passed.

Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main 0f98d193c. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main: no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.

AI-assisted (Claude Code, Claude Opus 5.5).
2026-11-24 18:21:40 -05:00
4a18d32b6e gdk_runtime_calls: validate table lookup shapes (GDK-TABLE-SHAPE) 2026-11-24 19:49:59 +01:00
2389f55b27 gdk_runtime_calls: track immediate high-byte writes (X86-HIGH8-IMMEDIATE) 2026-11-24 18:20:04 +01:00
3efede977f gdk_runtime_calls: bound x86 decoding to a 15-byte window 2026-11-24 18:02:08 +01:00
d239fd8556 tools: accept UTF-8 BOM JSON inputs in ten utilities (#6779)
Squash-merged after diff review of PR #6779 - tools: fix BOM-prefixed JSON inputs in 10 utilities (batch 01)
2026-11-23 09:56:38 -06:00
d231919b88 gdk_runtime_calls: REX.W overrides 0x66 prefix for immz in x86-64 decoder (#6853)
Squash-merged after diff review of PR #6853 - gdk_runtime_calls: REX.W overrides 0x66 prefix for immz in x86-64 decoder
2026-11-23 09:55:03 -06:00
52c906dc82 gdk_runtime_calls: guard --out reports against overwriting input files (#6905)
Squash-merged after diff review of PR #6905 - gdk_runtime_calls: guard --out reports against overwriting input files
2026-11-23 09:41:32 -06:00
ec34b54fe1 Runtime: offline XGameEventImpl, XGameUiImpl, XGameStreamingImpl
XGameEventWrite succeeds and drops the event (LEONIDA_LOG_GAME_EVENTS=1 logs
them). A message or error dialog has no screen: its title, text and buttons go
to the log and it completes with the default button, so an error the game
shows at boot is readable. Other UIs fail before starting. Streaming: never
streamed, no clients, a connection-state token that never fires; per-client
slots answer E_GAMESTREAMING_NOT_INITIALIZED, whose low byte reads false for a
bool caller. Ids and slot order from xgameruntime-docs, signatures from the
GDK reference; two parameter lists marked ASSUMPTION.

xgameruntime_offline_test: 18 checks. ctest 162/162.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:52:45 -05:00
af70fc7833 gdk_runtime_calls: count every xgameruntime*.cpp shim as the runtime (XUser, XGameSave, XStore were reported NOT served)
The served check read xgameruntime.cpp alone, so on the executable's first look the
classes QueryApiImpl hands on to xgameruntime_user.cpp, _gamesave.cpp and _store.cpp
would have been listed as missing. --runtime-source now takes a file or a folder;
the default is runtime/shims.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:46:53 -05:00
95f822d11b Add gdk_runtime_calls: list the runtime classes and slots an image calls through xgameruntime.lib
A title linked with xgameruntime.lib imports no GDK function: each thunk asks
QueryApiImpl (through a helper) for a class and interface, calls one vtable
slot and releases the object. tools/gdk_runtime_calls.py finds those thunks in
a PE without running it: the helper a known id's lea feeds, every call to it,
the class id in rcx and the interface id in rdx (unknown ids reported as such,
calls whose ids it can't read listed) and each slot called up to Release (CFG
dispatch, call [r+disp8/disp32], any vtable register, register copies
followed), scoped by .pdata or a byte window. Slots are named from
tools/gdk_runtime_classes.json (ids, inheritance and method order of
xgameruntime-docs, GPL-3.0, facts only; made by
tools/gen_gdk_runtime_classes.py). The report flags classes
runtime/shims/xgameruntime.cpp serves, estimates argument counts, says whether
anything in the image reaches each thunk, and lists known ids no thunk uses.
Text by default, --json, --out DIR.

Measured on the package: XCurl.dll and the four classes read by hand in
libHttpClient.GDK.dll match the slots in docs/runtime_imports.md.
libHttpClient holds the ids of 23 of the 24 documented classes (not
XGameActivationImpl's) and thunks for all 23, but is incrementally linked and
references only 15 of its 404 thunks (XThreadingImpl, XErrorImpl); the
module table now says so instead of "24 of 24, five called through thunks".
scripts/first_look.ps1 runs the tool on the executable, and the day-one
checklist in docs/design.md points at its report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 20:28:05 +00:00