Repository navigation
tombox-launch: stage and start a dumped GDK title (Windows, Wine / Proton), plus a runtime-bundle workflow - #30
Open
fffluffy-dev wants to merge 8 commits into
Open
fffluffy-dev wants to merge 8 commits into
fffluffy-dev wants to merge 8 commits into
Conversation
…oton) The launch scripts the upstream developers use (run_xone.ps1 and friends) live outside the repository, so a clean clone could not start a title. tombox-launch does it from the dump alone: - reads MicrosoftGame.Config (identity, version, the Game executable); - scans every .exe / .dll of the package for imports, delay imports and DLL names loaded by string, and sorts each DLL into title / api set / system / runtime / missing, using EmbeddedXvd/Windows/System32 for the console OS and System32 (Windows) or the Wine prefix's system32 for the host; - builds an overlay of the package (symlinks on Unix, hard links or copies on Windows; the dump is never written), copies the runtime's console libraries beside the executable, and gives runtime DLLs that forward to <name>_sys.dll a copy of the host DLL; - writes launch_report.md and launch.env (TOMBOX_PACKAGE_ROOT, TOMBOX_XBTHUNK_TITLE_ROOT, TOMBOX_GDK_ROOT, TOMBOX_XCRD_ROOT, TOMBOX_COMPAT_DIR, TOMBOX_LOG; WINEPATH and WINEDLLOVERRIDES off Windows) and, with --run, starts the title natively, under mdbg, or through Wine / Proton. runtime-bundle.yml builds the MSVC runtime DLLs, mdbg.exe and tombox-launch.exe on Windows and uploads them as tombox-runtime-windows-x64, so a Linux machine such as a Steam Deck can use them. Tests: config parsing, the import classification and staging rules, DLL-name extraction in ASCII and UTF-16, package layout detection, argument parsing and the overlay; a synthetic dump with a hand-built PE32+ was staged end to end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
Owner
Author
|
The Windows MSVC build of Generated by Claude Code |
…ange check From the review on the Steam Deck: - --plan now works when the runtime directory has no DLLs yet: every console library then shows as missing. Staging still refuses. - Without --work, the overlay goes to ~/tombox-run/<identity> (%LOCALAPPDATA%\tombox-run on Windows) instead of the current directory. - The overlay links point into the dump, so a title that writes into its package would change the original. Before --run the launcher records size and mtime of every dump file and compares after the title exits; changes go to <work>/dump_changes.txt with a warning (--copy isolates). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
…prefix The compat-common GDK runtime emulates the title's interfaces by hooking GetProcAddress(xgameruntime, "QueryApiImpl"), so it relies on Microsoft's PC xgameruntime.dll being loadable. Wine has none: the Trackmania plan on the Steam Deck shows xgameruntime.dll as the one console library nobody provides (GbxGame.exe, GameChat2.dll and XCurl.dll load it by name). crates/compat/xgameruntime builds an xgameruntime.dll with the five dispatcher entry points of the PC DLL (InitializeApiImpl, InitializeApiImplEx, QueryApiImpl, UninitializeApiImpl, XErrorReport). QueryApiImpl answers E_NOINTERFACE, which is what the emulated runtime already returns when there is no real runtime behind it. On Windows the host's own DLL wins (tombox-launch never stages a DLL the host has). tombox-launch --into-prefix NAME copies a runtime DLL into the Wine prefix's system32 for titles that load it from System32 only; it never overwrites a different file, and the plan suggests it for xgameruntime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
… ships First Trackmania run on the Steam Deck (Proton 10): the runtime came up inside the title (emulated GDK runtime, 36 interfaces, title key 700107ED, game drive G: on the overlay, import hooks in 7 modules), then the title's own console XCurl.dll faulted on a null handle in ntdll (XCurl +0x12e9a, called from GbxGame +0x16f133f). The runtime builds its own XCurl.dll (libcurl API on WinHTTP behind the network guard) for exactly this, but the launcher kept the title's copy. Where the runtime has a DLL of the same name as one the package ships, the runtime's copy is now staged; --prefer-title NAME keeps the title's. A shipped DLL the runtime lacks stays the title's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
Second Trackmania run on the Steam Deck: the runtime's XCurl came up on
WinHTTP, the network guard installed, the title read its packs through
G: and opened Packs/GpuCache_XboxOne.zip, then dxcompiler_x found no
dxcompiler.dll ("DxcCreateInstance no DXC available -> E_NOTIMPL") and
the title faulted on a null pointer half a second later. Also,
advapi32legacy.dll forwards to advapi32_sys.dll, which was missing: the
launcher only looked for <name>_sys.dll companions in staged DLLs, but
the runtime loads advapi32legacy itself from its own directory.
- --dxc DIR (default $TOMBOX_DXC_DIR) sets TOMBOX_DXC_DIR, as a Windows
path under Wine; the plan warns when dxcompiler_x is staged without one.
- Companions are collected from every runtime DLL (any *_sys.dll name in
it) and copied from the host into the overlay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
…e fails Third Trackmania run on the Steam Deck (Proton 10): D3D12 device, queues, heaps, resources, 8 translated shaders and ~40 compute PSOs were up, then the title read through a null object about a second after "[gamepad] GameInputCreate real GameInputCreate failed hr=0x80004001". Wine's gameinput.dll answers E_NOTIMPL, the hook passed the failure on, and the title used the IGameInput it never got. When the real GameInputCreate fails, the hook now wraps a built-in host object instead and returns S_OK: no host devices or readings (GAMEINPUT_E_READING_NOT_FOUND, E_NOTFOUND), QPC timestamps, callback registrations that succeed with fresh tokens, unregister true. The usual wrapper puts the virtual Xbox gamepad on top of it, so the title sees one pad (driven through the pad control directory) and no keyboard or mouse. Hosts with a working GameInput are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
This was referenced Nov 22, 2026
…imeUninitialize GTA VI 1.0.2.1 imports these from xgameruntime.dll (upstream omonkeyz#293, host shim 1). They succeed like InitializeApiImpl; the compat-common GDK runtime still serves QueryApiImpl through its GetProcAddress hook. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #14 (a clean clone could not start a title).
Why
The upstream developers start titles with
run_xone.ps1and similar scripts. Those scripts live outside the repository and use paths on their machine (D:\TomBox,D:\xbox-pc-port). This PR makes a title startable from the repository plus a dump, including on a Steam Deck through Proton.What
crates/tools/tombox-launch(CLI; see its README):MicrosoftGame.Config: identity, version, theGameexecutable..exe/.dllof the package for imports, delay imports and DLL names loaded by string.EmbeddedXvd/Windows/System32;System32on Windows, or the Wine prefix'ssystem32.--copyon Windows;<name>_sys.dllgets a copy of the host DLL under that name.launch_report.mdandlaunch.env:TOMBOX_PACKAGE_ROOT,TOMBOX_XBTHUNK_TITLE_ROOT,TOMBOX_GDK_ROOT,TOMBOX_XCRD_ROOT,TOMBOX_COMPAT_DIR,TOMBOX_LOG;WINEPATH, andWINEDLLOVERRIDESfor the staged DLLs, appended to any existing value.--run, starts the title natively, under--mdbg, or through--wine(Proton'swine64)..github/workflows/runtime-bundle.yml: the runtime DLLs need the MSVC linker. This workflow builds them on Windows together withmdbg.exeandtombox-launch.exe, and uploadstombox-runtime-windows-x64.mainand this branch (whencrates/or the lockfile change) and onworkflow_dispatch.--keep-going.MISSING.txtin the bundle lists any of the core DLLs that did not build.Test plan
cargo test -p tombox-launch(9 tests): config parsing, classification and staging rules, ASCII / UTF-16 DLL-name extraction, layout detection, arguments, overlay.d3d12_x/xmem/audiohalwrapper(loaded by name) /mfplat(withmfplat_sysfrom the prefix), kept the title'sXCurl.dll, flaggedGameInput.dllas missing; the env file and Wine command were correct.cargo clippy;cargo check --target x86_64-pc-windows-gnu; PR gate: 0 problems.runtime-bundlerun on this branch.--plan, then--run, on the user's own Trackmania package.Generated by Claude Code