Skip to content

host: offline EOS stubs answer a usable platform handle (MARVEL Cosmic Invasion) - #2596

Open
bensaadmucret wants to merge 1 commit into
seedds:mainfrom
bensaadmucret:pr-eos-platform-handle
Open

bensaadmucret wants to merge 1 commit into
seedds:mainfrom
bensaadmucret:pr-eos-platform-handle

Conversation

@bensaadmucret

Copy link
Copy Markdown

What and why

A game that links the EOS client into main while its EOS module NRO is refused as an online SDK (Online SDKs in NROs are never loaded) crashed on a null EOS_HPlatform: EOS_Platform_Create was a generic stub that returned 0 and never wrote the output handle, and each EOS_Platform_Get*Interface stub returned null too, which the game dereferenced and then called through (sig=11 at boot, then pc=0). Hades survives the refused module because its EOS calls live inside it; MARVEL Cosmic Invasion (FNA, SDL_GPU, title 010059D020C26000) imports EOS_Platform_Create directly.

EOS_Platform_Create now writes the options pointer itself — a mapped, non-null guest address the game treats as an opaque EOS_HPlatform — and a stub whose name holds EOS_Platform_Get and Interface answers the platform handle it was called with, so the offline path continues. The handle is never a real EOS object and the host never serves Epic services; the game ticks it and plays offline.

Adds the finding to docs/reference/services.md (EOS_Platform_Create called on the refused module's client in main).

Checked

  • Tests: python3 -m unittest dm.tools.tests.test_docs (6 tests, links and symptom index)
  • Games run, with title ID and version: MARVEL Cosmic Invasion 010059D020C26000 v0 (build D6A37DEAFF3F5AEA, provisional profile): before the fix it aborted on the null platform dereference at boot; after, EOS initialization completes and the game reaches its frame loop — intro video at 60 fps with audio, ~870 draws/frame (with the sibling Vulkan PRs, see below)
  • Devices and OS: Apple M6, macOS 27.0
  • regress.py impact: the change reaches hle:* in theory, but only stubs named EOS_Platform_Get*Interface behave differently — every other unimplemented import returns 0 exactly as before, so no profiled game's path changes. regress.py check --games was not run: no local game build exercises this path, and the only caller pattern affected is the one this fix is for.
  • This is one of four PRs from the same bring-up; the others (vk_shaders entry point, vkCmdBlitImage, profile_guess) are independent and listed in each other's bodies.

Docs

  • The finding is in its game note or its docs/reference/<subsystem>.md entry, and python3 dm/tools/docs_symptoms.py was run (the symptom index)
  • A chain tool changed: dmsh_chain.py --header was run and dm/gfx/nvn/dmsh_chain.h is part of the change
  • No game files, keys or data extracted from a game in the change or the attachments

…c Invasion)

A game that links the EOS client into main while its EOS module NRO is refused as an online SDK (hle_ro.c) got a null
EOS_HPlatform from the generic stub: EOS_Platform_Create returned 0 and never wrote the output handle, and the game
dereferenced the address at once (main+0x956aac, sig=11). Hades survives the refused module because its EOS calls
live inside it; MARVEL Cosmic Invasion (FNA, SDL_GPU) imports EOS_Platform_Create directly.

EOS_Platform_Create now answers the options pointer, a mapped non-null guest address the game treats as an opaque
handle and writes to its out parameter, and the EOS_Platform_Get*Interface stubs answer that handle (regs[0]) instead
of 0, which took the game past Connect/Auth setup into Vulkan init. The remaining EOS calls return 0 = offline
success; EOS_Platform_Tick runs in the frame loop.

Checked: dmhost builds and the game boots through EOS_Platform_GetConnectInterface into SDL_GPU's Vulkan init, draws
and audio at 60 FPS in a window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation host The Horizon host: SVCs, services, threads, memory (dm/host)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant