This document details the multiplayer connection flow used by Dead Space 2 to connect to EA's Blaze servers. The game uses EA's BlazeSDK combined with DirtySock networking library.
The game implements a 12-state connection state machine:
| State | ID | Name | Description |
|---|---|---|---|
| 0 | 0x00 | DEACTIVATED | Initial state, SDK not active |
| 1 | 0x01 | UNINITIALIZED | SDK loaded but not configured |
| 2 | 0x02 | INITIALIZE_TRANSITION | SDK initialization in progress |
| 3 | 0x03 | INITIALIZED | SDK ready for operation |
| 4 | 0x04 | PROFILE_LOAD_TRANSITION | Loading player profile |
| 5 | 0x05 | PROFILE_LOADED | Profile data loaded |
| 6 | 0x06 | NETWORK_INITIALIZE_TRANSITION | Network stack starting |
| 7 | 0x07 | NETWORK_INITIALIZED | Network ready |
| 8 | 0x08 | CONNECT_TRANSITION | Connecting to redirector |
| 9 | 0x09 | CONNECTED | Connected to Blaze server |
| 10 | 0x0A | AUTHENTICATE_TRANSITION | Authenticating with server |
| 11 | 0x0B | AUTHENTICATED | Fully connected and authenticated |
Code Location: State handler at 0x0060B9F0, state strings referenced from table at 0x0060BA90
The redirector server determines which Blaze server to connect to:
| Environment | Hostname |
|---|---|
| Production | gosredirector.online.ea.com |
| Test | gosredirector.stest.ea.com |
Hostname Table: 0x01B0196C (rdata)
- Format: [environment_id (4 bytes), hostname_ptr (4 bytes)]
- Selection code at: 0x00615800
The game performs NAT detection and QoS measurements:
- http://<qos_server>:<port>/qos/qos?vers=1
- http://<qos_server>:<port>/qos/firetype?vers=1
- http://<qos_server>:<port>/qos/firewall?vers=1
QoS URL Construction: 0x01471AD0
For NAT traversal:
- http://<server>:<port>/getPeerAddress?myIP=<ip>&myPort=<port>&version=1.0
- silentLogin (0x006892A3) - Background login with saved credentials
- expressLogin (0x006892B3) - Quick login flow
- login (0x0068927B) - Full login with credentials
- getAuthToken (0x0068936B) - Retrieve authentication token
- AUTHTOKEN - Main authentication token
- PCLOGINTOKEN - PC-specific login token
- HANDOFFTOKEN - Session handoff token
Main SDK controller class:
- String Reference: BlazeHub::mLoginManagers at 0x01B01EFC
- Error Code: SDK_ERR_BLAZE_HUB_ALREADY_INITIALIZED (0x80180000)
Handles game session operations:
| Operation | Command ID Lookup |
|---|---|
| createGame | 0x00620180 |
| joinGame | 0x006201B8 |
| startMatchmaking | 0x006201C8 |
| cancelMatchmaking | 0x006201D0 |
| joinGameByGroup | 0x00620200 |
- Name String: AuthenticationComponent at 0x01B0F288
- Dispatcher: 0x00689200
User-Agent: ProtoHttp %d.%d/DS %d.%d.%d.%d
Where:
- First two values: ProtoHttp version
- Last four values: DirtySock version
Code Reference: 0x0146FA4A
Used in HTTP requests to QoS and peer discovery servers.
| Function | Address | Purpose |
|---|---|---|
| Redirector hostname selector | 0x00615800 | Selects server based on environment |
| State-to-string converter | 0x0060B9F0 | Debug logging |
| QoS URL builder | 0x01471AD0 | Constructs QoS request URLs |
| ProtoHttp request builder | 0x0146FA30 | Builds HTTP headers |
| BlazeHub error code lookup | 0x00649000 | Error code to string |
| getServerInstance lookup | 0x00678BC0 | Server instance operations |
| fetchQosConfig | 0x00691477 | QoS configuration |
-
Initialize SDK (State 0-3)
- Load BlazeSDK
- Initialize BlazeHub
- Set up memory allocators
-
Load Profile (State 3-5)
- Load saved credentials
- Prepare login data
-
Initialize Network (State 5-7)
- Initialize DirtySock
- Perform QoS measurements
- Detect NAT type
-
Connect to Server (State 7-9)
- Query redirector for server address
- Establish SSL connection
- Protocol handshake
-
Authenticate (State 9-11)
- Send login credentials
- Receive authentication token
- Session established
To create a private server, the following would need to be implemented:
- Redirector Response - Return a custom server address
- Blaze Protocol Handler - Handle the binary Blaze RPC protocol
- Authentication Stub - Accept any credentials or implement custom auth
- GameManager - Handle game session creation/joining
- QoS Server - Provide NAT detection and peer discovery
The redirector hostname can potentially be redirected via:
- DNS override (hosts file or custom DNS)
- Binary patching of hostname string
- Network proxy/MITM
The BlazeSDK uses a component-based RPC system. Each component handles a specific domain:
| Component | Purpose |
|---|---|
| Redirector | Initial connection routing |
| Authentication | Login, tokens, entitlements |
| Util | Connection state, QoS config |
| Association | Friend lists, blocklists |
| GameManager | Game sessions, matchmaking |
| GameReporting | Statistics submission |
| Messaging | Player messaging |
| Stats | Leaderboards, statistics |
| Playgroups | Party/group management |
- ExpressLoginRequest
- SilentLoginRequest
- LoginRequest
- LoginResponse / FullLoginResponse
- GetAuthTokenResponse
- GetHandoffTokenRequest/Response
- CreateAccountRequest/Response
- ListPersonasResponse
- HasEntitlementRequest
- Entitlement / Entitlements
- CreateGameRequest/Response
- JoinGameRequest/Response
- DestroyGameRequest/Response
- StartMatchmakingRequest
- GetGameListRequest/Response
- UpdateGameSessionRequest
- HostInfo
- PlayerJoinCompleted (notification)
- PlayerRemoved (notification)
- HostMigrationStart/Finished (notifications)
- SetConnectionStateRequest
- QosConfigInfo
- QosPingSiteInfo
- UpdatePingSiteLatencyRequest
- NetworkInfo
- GeoLocationData
- ResultNotification
- ArsonCTF_Custom::ResultNotification (game-specific)
- IpAddress
- IpPairAddress
- HostNameAddress
- XboxClientAddress
- XboxServerAddress
- UserIdentification
- UserData
- UserStatus
- UserSessionExtendedData
- OnlineStatus
- ClientInfo
- ClientMetrics
| Environment | Hostname | Purpose |
|---|---|---|
| DEV | gosredirector.ea.com | Development server |
| SCERT | gosredirector.scert.ea.com | Secure certificate testing |
| STEST | gosredirector.stest.ea.com | Staging/testing |
| ONLINE | gosredirector.online.ea.com | Production |
| Hostname | Purpose |
|---|---|
| demangler.ea.com | NAT demangling / peer address discovery |
| peach.online.ea.com | Unknown (possibly monitoring) |
The environment is selected based on a numeric ID:
- The game looks up the environment ID in a table at 0x01B01968
- Each entry contains: [environment_id, hostname_pointer]
- The matching hostname is returned from 0x01B0196C
Environment ID Table (at 0x01B01968):
Entry 0: [ID0] -> gosredirector.ea.com
Entry 1: [ID1] -> gosredirector.scert.ea.com
Entry 2: [ID2] -> gosredirector.stest.ea.com
Entry 3: [ID3] -> gosredirector.online.ea.com
The environment is likely set via:
- Command line argument
- Configuration file
- Compile-time constant for retail builds
Based on typical Blaze configuration:
- Redirector: Port 42127 (TCP/SSL)
- Blaze Server: Port 10041 (TCP/SSL) or assigned by redirector
- QoS: Port 17502 (HTTP/UDP)
- Default Port: 42127 (0xA48F)
- Set at address 0x0061587C in the connection initialization code
- Used with all redirector hostnames
-
Environment Selection (0x00615800)
- Reads current environment ID from game state
- Looks up hostname in table at 0x01B01968/0x01B0196C
- Returns pointer to hostname string
-
Port Assignment (0x0061587C)
- Default port 42127 used for redirector
- Server may assign different port in redirect response
-
State Transitions (0x0060B9F0)
- Switch statement on current state (0-11)
- Returns state name string for logging
The game uses EA's DirtySock networking library:
- User-Agent:
ProtoHttp %d.%d/DS %d.%d.%d.%d - Error:
SDK_ERR_DIRTYSOCK_UNINITIALIZED
Located at string reference 0x01B96210:
- Manages low-level socket operations
- Handles SSL/TLS for secure connections
- Used by both QoS and Blaze communication
-
DNS/Hosts Override
- Redirect gosredirector.online.ea.com to emulator
- Optionally redirect demangler.ea.com
-
Redirector Server (Port 42127)
- Accept SSL connection
- Parse redirect request
- Return Blaze server address
-
Blaze Server (Custom port)
- Handle Blaze binary protocol
- Implement core components:
- Authentication (login responses)
- Util (connection state)
- GameManager (game sessions)
-
QoS Server (Optional)
- HTTP endpoints for NAT detection
- Can return hardcoded "open NAT" response
To fully implement server emulation, further reverse engineering is needed for:
- Blaze packet header format
- TDF (Tag Data Format) encoding
- Component/Command ID mappings
- SSL certificate requirements (may need to disable validation)
- Full Emulation: Implement complete Blaze protocol server
- Proxy Mode: MITM existing connections to understand protocol
- Binary Patch: Modify game to connect without authentication
- LAN Mode: If game supports direct IP connection
| Section | Virtual Address | Size | Purpose |
|---|---|---|---|
| .text | 0x00401000 | ~22.6 MB | Code (decrypted) |
| .rdata | 0x01AA1000 | ~1.6 MB | Strings, RTTI |
| .data | 0x01C6A000 | ~3.9 MB | Globals |
| Address | Purpose |
|---|---|
| 0x01C6F138 | Connection state storage |
| 0x02030A44 | Secondary state |
| 0x020309F4 | Memory allocator pointer |
| 0x01B0196C | Redirector hostname table |