SUNRISE

Client hooks

A client hook is a change Sunrise makes to the game’s code at run time. Sunrise keeps these to a minimum. The tables below list every hook installed today, taken from the install calls in the code. A hook that is never installed is not listed.

The rule

A hook may do four things: redirect traffic, serve the Sunrise tools and menu, draw, or log.

A hook that changes game behavior is a stand-in for server behavior not yet understood. The live game needed no such hook, so a correct server needs none. When the server behavior lands, the hook is deleted in the same change.

The Activity Host never reads the client to make up events or state. It works only from the activity messages.

Every hook finds its target by byte pattern, export name or a probe object, never by a fixed address. It fails cleanly when the target is missing, and it can detach.

Stand-ins already retired this way:

hookreplaced by
hold the spawn until the fadethe message 5 roster holds the client’s own spawn gate
fix the solo fireteam checkthe matchmaking config carries the fireteam threshold
skip the profile setup screensthe account object publishes a completion marker
drop an empty queue updatethe subscribe answer carries the family snapshot
force the join statethe host waits for the client’s join

Install order

Hooks use Microsoft Detours (src/client/hooking/detour.cpp). A group attaches in one transaction: all or none.

whenwherewhat
DLL load, Steam initsrc/dllmain.cpp, src/steam/runtime/steam_lifecycle.cppegress guard, package trust, boot textures
Steam networking loadssrc/client/runtime/client_platform_hook_activation.cpptwo Steam networking hooks
first framesrc/client/runtime/client_hook_activation.cppDXGI, cursor, keys
game image scannedsrc/client/runtime/client_hook_activation.cppnetwork group, all game hooks
on a triggersrc/client/hooks/retail_log/, src/steam/runtime/callbacks/callback_dispatch.cpptwo data fixes, one feature flag

In the tables below, “detour” hooks a game function, “export” hooks a Windows, DXGI or Steam export, and “data” writes a game value that is restored on detach. A number is how many hooks.

Transport

hookwhat it doeskind
egress guardsockets and DNS: blocks outbound traffic, sends connects to Sunriseexport (31)
HTTP executoranswers HTTP in process; unserved requests get 503detour
transport kinduses direct sockets instead of the Steam relaydetour
Steam certificatereports a local certificate as validexport (2)
content configanswers the content manifest request; skips its signature checkdetour (2), data
config URL and tokensupply the values the content fetch asks fordetour (2)
external serverexternal-server mode only: sends HTTP to that serverdetour

The egress guard never detaches. The certificate and manifest hooks stay until Sunrise can sign these itself.

Tools and menu

Most of these attach at start, so a tool can be turned on without a restart.

hookwhat it doeskind
game windowstake mouse and keys while the menu is openwindow subclass (2)
SetCursorPos, ClipCursorfree the pointer while the menu is openexport (2)
GetKeyState, GetAsyncKeyStatehide keys from the game; hold the teleport keyexport (2)
camera and physics syncteleport; also ticks fly and sword skatedetour (2)
physics stepnoclip and flydetour
ammo settersinfinite ammodetour (3)
inactivity timeoutsanti-AFKdata
placed-object create, destroyfeed the world-object browser; read onlydetour (7)
mission launcherstarts an activity through the game’s own entry pointscall

Rendering

hookwhat it doeskind
Present, ResizeBuffers, SetFullscreenStatedraw the menu on the game’s swap chain, only when the menu is onexport (3)
boot texture dispatcherswap a few boot-screen textures for ones built into Sunrisedetour

Hooks that change game behavior

hookwhat it doeskindretired by
bubble authoritylets message 5 set authority on every bubbledetour (2)nothing yet; no server field reaches the gate
package trustloads installed packages the trust check refusesdetour, patch (2)unknown; the refusal is not understood
async I/O guardstops a native reload from racing a teardownpatcha fix for the native race
lore booksclears display gates on lore books; on by defaultdataa data fix for the gates
Arrivals leg modsmoves four leg mods into the leg plug set; off by defaultdataremoval; retail had the same gap
ownerless channelsets one client feature flag; off by defaultcallserver behavior that keeps the channel owned

Diagnostics

These only read and log, except the assert handler.

hookwhat it logskind
retail logthe game’s own log, into the Sunrise logdetour
assert handlerthe assert; the game keeps running unless the device was losthandler swap
hitch watchdogthe watchdog snapshot and the stuck thread’s stackdetour
stall watcherevery thread’s stack when the frame pump stopsthread
cinematic readinessthe readiness stages of boot cinematicsdetour (16)
lifetime gatethe spawn gate inputs and each message 5 roster applydetour (2)
network tickone byte of the network guard, each framecall
entity create, purge, policyentity ids and purge masks; 3 of the 7 object hooks abovedetour