Skip to content
Lakeland97 edited this page Nov 1, 2026 · 8 revisions

Login

LoginGameMode state machine, doHandshake reply fields, the DRM gate, the session context, and the reply shapes that reach LoggedIn.

State machine

LoginState instances are interned. The statics below are 8-byte entries but not contiguous: 0x143bc6a70, 0x143bc6a80, 0x143bc6a88, 0x143bc6a90, then a gap to 0x143bc6ab0, 0x143bc6ab8, 0x143bc6ac0, 0x143bc6ac8.

state static
CheckingAuth 0x143bc6a70
Handshaking 0x143bc6a80
JoiningGame 0x143bc6a88
LoggedIn 0x143bc6a90
StartingAppServerSession 0x143bc6ab0
WaitingForAuth 0x143bc6ab8
WaitingForHost 0x143bc6ac0
WaitingForURL 0x143bc6ac8

gotoState (FUN_14067d2d0) writes the state to lgm+0x418, logs, runs the party-owner check and posts a login_state beacon to postTrackingInfo.

gotoState Handshaking              → POST doHandshake
gotoState CheckingAuth             → POST postTrackingInfo (login_status beacon)
gotoState StartingAppServerSession → POST startSession
                                   → LoginGameMode.hx:937: Using DRM: FakeID(restrea1).
                                   → gotoState LoggedIn
                                   → POST /games/streamline/active_user
                                   → GET /channels, GET /users/devuser/updates/N (long-poll)

LoggedIn → menu is unconditional: setState(LoggedIn) calls the heartbeat, checkForUrlRequest and showHomeUI, which reads the session player's AdvancementComponent and discards a failure.

Handshake shapes

doHandshake returns a 13-field config object. Fields with reply-shape requirements:

field requirement
api, privateApi, configApi base URLs for the three mounts
privateApiKey community-key in the working configuration
pgsServer, pgsFrontend URL prefixes ending in /; the client appends auth/check?state=… with no separator. A bare host:port builds …:8096auth/check, libcurl never connects, and the client parks in checking credentials with nothing on the wire
m_drm a DRMType enum instance, not a bool: 0=Steam, 1=Twitch, 2=PGSDev, 3=FakeID. FakeID declares one argument (restrea1); validation reverses argument order, so "expected 0, got 1" means 0 sent, 1 declared
serverEnvironment local in the working configuration; also bypasses the "No game session ID was provided" pre-login check
availableRegions ["us-east-1"]; [] and a single string are not the gate
quickmatchDisabled, disableQuickmatch both false in the working config; neither gates the PLAY entry (Matchmaking)

Two reply shapes break login:

  1. Bare DataStoreUpdateResponse as value 2. The reply must be [null][Result]; a bare DSUR makes the second read step past the body and report LoginGameMode.hx:403: Invalid char (Protocol).
  2. A V declaration with base = 0 spins the base walk for ever: silent CPU spin, no log line, no request. Accepted replies use the i-1 sentinel (Protocol).

DRM

getDRM (FUN_1407a9ec0, log h:615) has two failure strings, both Result:AuthError:

  • Could not verify Steam identity. (0x142ea7ea8)
  • Could not find identity neither through Steam nor Twitch (0x142ea7ed8)

The h:472 banner ("Streamline must be run online through Steam or Twitch Launcher") is pak UI text — 0 ASCII and 0 UTF-16 occurrences in the executable, 13 in the pak — not this message (RuledOut).

Reads: cached value at this+0x138; else the "Steam" subsystem → GetIdentityInterface → GetAuthToken → Steam DRMType; else twitch::TwitchManager, whose +0x78 Fuel session must parse → Twitch DRMType. -NOFUEL skips the Twitch leg, so an unpatched client always lands on h:615.

FakeID is never a detector output. h:937 (FUN_14067e510, Using DRM: @ 0x142e6a9c0) prints only for a ctor ≠ 0/1; the FakeID builder FUN_140d170c0 (ctor 3) is referenced only from the hxcpp class table. The cave sits in unused .text padding at VA 0x142cc2d95: call FUN_140d170c0 with restrea1, wrap in Result.Success (FUN_1408ebf00), jump to the getDRM success epilogue 0x1407aa06e; entry points 0x1407aa002, 0x1407aa07e, 0x1407aa09b enter it through a 5-byte jump.

The PE checksum

MS algorithm: zero PE+0x58, 16-bit LE sum with carry fold, add the file length once. Retail stores 0x03ef67ae, 0x2a9c below the content-derived 0x03ef924a; no code reads the field, the only PE-header parsers being CRT _ValidateImageBase (0x1428cf430) and startup (0x1428ce96c). The gate is launcher identity, not the checksum (RuledOut). The retail chain matters for patching: the launcher starts Streamline_ls.exe, which starts Streamline.exe, so a patch applied to the wrong one of those looks like "the patch did nothing".

Session context

startSession satisfies two lookups, accounts then the player by playerIID, from the eight fields named by the client's builder FUN_140d36830 at service+0x10:

m_accounts        array of account records
sessionID
m_providerString
timeOffset
playerIID
accountID
displayName
trackingID
accessor VA behaviour
getContext FUN_140d36590 (+0x10) returns the context
isPlayerLoaded FUN_140d36620 (+0x20) context present and playerIID non-null
getPlayer FUN_140d36680 (+0x28) getLoadedPlayerByIID(playerIID)
setPlayer FUN_140d367b0 (+0x30) assigns a random id to a field-less object and stores nothing
  • Send no more than the eight. Adding the player record's fields (appAccountID, appProvider, pgsPlayerID, pgsPlayerToken, playerSessionID, gameSessionID, isHost, hideHUD, pgsExternalMode, extraLoginOptions, level fields) desynchronises the parse by one token and reports Enum not found t1. The minimal eight (GUL_CTX_MINIMAL) moves the failure from accounts not in the datastore to devuser not in the datastore, i.e. the account lookup succeeds and the client advances to the next blob.
  • provider must be an AccountProvider enum instance. The recovered constructor set is {Fake, Twitch}; the string "twitch" fails the cast. Working config: GUL_CTX_PROVIDER_ENUM=1, GUL_CTX_PROVIDER_IDX=2. The appserver comment maps 0=Fake, 1=Steam, 2=Twitch while the recovered set has no Steam member, so the index table is [UNK]. A null accountProvider is the only hard null gate on the menu path; it throws Result:UnknownError: natively, and the provider enum clears it. Other null PlayerComponent fields are not menu gates.
  • Emit i0 for zero, not z. A z token inside a parsed object shifts the read by one; accepted replies use i0 (the DSUR's i-1:i0:i0:). GUL_SER_Z=1 restores z.

Working configuration

These are the mock's built-in defaults, so a bare mock_appserver.py already serves them; set any of them in the environment to A/B-test an alternative reply. The runnable block lives in Tooling.

GUL_DSUR_B_OPS=startSession
GUL_DSUR_HX=1
GUL_DSUR_HX_TEMPLATE=1
GUL_DSUR_HX_PURPOSE=game
GUL_DSUR_HX_TAIL=0
GUL_HS_MODE=resultdsur
GUL_IID_TEMPLATE=player
GUL_IID_TEMPLATE_BLOB=player
GUL_CTX_PROVIDER_ENUM=1
GUL_CTX_PROVIDER_IDX=2
GUL_USER_POLL_DELAY=10
GUL_TRACK_DELAY=0
GUL_M_DRM=3
GUL_URL_ACTION=join
GUL_TRACK_STYLE=result
GUL_NOCL=0

GUL_IID/GUL_NAME pin one identity for single-client fixtures; omit them for per-session names (Player1, Player2, …). The runnable public block is in Tooling.

Entity body ["devuser", "player", {}, null, null, null, ""]: the empty seventh value forces construction of the five player components (Entities). The user watcher needs a non-empty users[0] with update_stamp and active_party; an empty list is an error loop. active_user needs numeric interval_sec > 0 ({"interval_sec": 30}), else PGSManager.hx:257 reports … malformed response.

Post-login behaviour

  • checkForUrlRequest (LoginGameMode.hx:712/722) logs Checking for autojoin request... then No SL URL command line entries found.; WaitingForURL is entered only for a -RunURL=.
  • Automatic network set: the active_user heartbeat, the user long-poll, channels, the postTrackingInfo beacon and the external Twitch check. Requesting... is never emitted after LoggedIn.
  • The Connecting to service... label is the Handshaking status widget; Escape after LoggedIn clears it, and it is not a service failure.

Clone this wiki locally