Skip to main content
Every “confirmed live via a real packet capture” claim in Live validation against production and elsewhere in this dossier was produced by the same four-step pipeline. This page is that pipeline, written down once, so reproducing or extending any of those findings doesn’t require re-deriving it from scratch. It works at all because the SFS2X game socket is plain TCP with no TLS. Capturing it is exactly as simple as capturing any other unencrypted traffic, no certificate pinning to defeat, no interception proxy, no MITM setup. tcpdump against the real app while it plays through the same network interface as the analysis machine is sufficient.

Step 1: capture

Run tcpdump with a filter that keeps every TCP flow except HTTPS and SSH, then launch and use the real app (/Applications/Last War.app on macOS, or the equivalent iOS/Android install) while it’s running:
This filter catches every SFS2X gateway the client races, IPv6 ones included, without knowing their addresses or the zone’s current port. Capture on the real network interface (en0 above; networksetup -listallhardwareports lists yours). On macOS:
  • You don’t need sudo if Wireshark’s ChmodBPF helper is installed, since it gives your user read access to the /dev/bpf* devices.
  • -i any needs root on macOS, even with ChmodBPF.
Port 443 is excluded because everything on it is TLS, which this pipeline can’t decode. That includes the GSL (Gate Server List) call, so a capture never contains the GSL response or the values that only arrive there (at.time, rt). If you need a narrower capture, filter on the known hosts and ports instead:
The host list is every IPv4 server address this project has seen the client actually talk to (GSL HTTP endpoints, CDN, and SFS2X gateways); the port list catches every SFS2X game port seen across captures so far. It misses IPv6 gateways, such as the Cloudflare one the client raced on 2026-10-04. Keep the filter broad; a capture with some irrelevant traffic in it costs nothing at the decode step, but a filter that’s too narrow silently drops the packets you actually need.
Why the host list has held up better than the port list. An account can get moved to a different zone server-side, confirmed live via a real server merge that moved this project’s account from zone APS783 to APS8092 with an entirely different port (17783 → 25092) mid-session (see Live validation against production for the client-side fix this required). The port is zone-specific and will drift every time this happens, there’s no way to keep it current in a static list. The host IPs above turned out to be shared CDN/infra-level addresses rather than zone-specific ones: the post-merge zone’s actual game-server host (lastwar-game-cf.lastwarapp.net) resolved to 172.65.210.24, already on this list. Since the filter is a flat OR, host 172.65.210.24 alone captured the new zone’s traffic on its new port without the port list needing to know about it. That’s not guaranteed to hold forever, if you’re capturing after your own account has moved zones and traffic isn’t showing up, re-resolve the current game-server hostnames (they’re in a login response’s serverInfo field, or already-resolved in your session config after a redirect) and add any genuinely new IP to the host list.
Give it real time. A rushed capture is the single most common failure mode: the real client’s own SFS2X connection can churn through its login/bootstrap burst in under a second, so if you start tcpdump, immediately open the app, do one thing, and stop, you’ll likely capture only the bootstrap burst and miss the actual action you were trying to observe. Let the app fully settle into its main screen (10–15 seconds after login) before doing anything you actually want captured, and let it sit a few seconds after before closing.

Step 2: find the game socket

A single capture typically contains several TCP streams: the real game session, a few short-lived “losing” gateway connections, and unrelated TLS side-channels (chat, logging, CDN). The losing connections come from the gateway race: in the 2026-10-04 capture, the real client opened three gateways on the zone port at once (two IPv4, one Cloudflare IPv6), sent an a=29 probe on each, logged in on the first to answer, and closed the other two about 30 ms later. Each losing stream holds one probe and one pong, see SFS2X wire protocol. The pcap tool lists them, decodable plain streams first, then encrypted tls ones:
The game socket is the plain stream to the game server’s host and port, port 17783, or whatever the current zone’s port has drifted to (see the port note above). Note its index (1 above). That’s all you need: the tool auto-detects the client side (the connection initiator, or the private-address endpoint) and both directions, so there’s no separate stream-index or client-IP lookup to do, and it reads both classic pcap and pcapng, with no tshark in the loop.
If the game-socket stream has only a handful of segments and well under a second of activity, the capture likely caught only a “losing” race candidate or missed the real session, see Step 1’s timing note. Re-capture with more time around the action.

Step 3: reassemble and decode

One command reassembles the chosen stream by TCP sequence number (so out-of-order and retransmitted segments land correctly, rather than corrupting the stream the way arrival-order reassembly can) and decodes every SFS2X packet in both directions:
To keep the raw reassembled bytes (e.g. to re-run the client’s own -decode-stream), use -out instead of -decode:
Pass -client <ip> to pcap to override the auto-detected client side if the heuristic ever picks wrong.
The whole pipeline is one Go module, so nothing can drift out of sync. Both the reassembler (internal/pcap) and the decoder are pure Go with no external dependencies; pcap -decode and -decode-stream frame and decode using the exact same ReadPacket (packet.go) and DecodeObject (sfsobject.go) the client uses on its own live connection. Any fix or extension to the real codec is reflected the next time you decode a capture, with no manual sync step.

Reading the output

Each decoded line is one SFS2X extension-call envelope: c is the SFSObject’s top-level wrapper (1 = extension call, 0 = system/heartbeat), a is the sub-action, and p holds the actual payload; for extension calls, p.c is the command name and p.p is its params object. Client→server calls almost always carry _id, an ever-incrementing per-connection request id; the matching server response echoes the same _id. See Wire protocol for the full packet-envelope and SFSObject binary format this output is decoded from, and Command reference for what a given p.c command name actually does.

Recovering from a rotated token

When every run fails with ec=28, ep=[E011], the server no longer accepts the session config’s access token. A config with a refreshToken, such as an own-device one, recovers on its own (see Refreshing the access token). For a captured config, the fix is a fresh capture of the real app logging in, and pcap -session-out turns that capture straight into a session config. Confirmed live on 2026-10-04: this procedure restored the scheduled runs after the 2026-10-02 rotation (see Live validation against production).
1

Start the capture

2

Cold-start the real app

Quit the real app completely, launch it, and wait until its main screen loads, so the capture holds the whole connect-and-login sequence. Then quit the app and stop tcpdump.
3

Write the session config

4

Verify

What -session-out does:
  • It searches every plain (non-TLS) stream, or only the one you name with -stream.
  • It picks the Login request (c=0, a=1) whose server reply carries no ec. It reports streams whose Login was rejected or never answered, and skips the a=29 probe streams.
  • It writes ip, port, zone, gameUid, deviceId, shumeiBoxId, accessToken, and iosMode (from platform="0"), plus the appVersion and versionCode the token was issued under, and the shumeiId: the last push.shumei.id after the accepted Login that carries no errorCode, else the captured ta’s lw_shumei_id. It sets mode 0600, tightening an existing file’s mode too.
  • Written onto an existing session config, it keeps every key it doesn’t write (features, duelPolicy, shumeiInstall and any other), and removes a key it writes when the capture lacks it (an Android capture’s device, for one). It drops accessTokenTime when the access token changed and refreshToken/refreshTokenTime when the deviceId changed, and refuses an existing file that isn’t a JSON object. So a recapture can go straight onto the live config, with no hand merge. A run’s own saves (tokens, the pushed shumeiId, the save-back) write only the keys the session config models, so a key goclient doesn’t know is dropped at the first such save.
  • It appends every other gateway that answered a probe on the same port to ip as a |-delimited fallback list, after the gateway the accepted Login went through. ip and port are only a starting address: goclient looks the server up with GSL before every Login and falls back to them when the lookup fails or the server it lists doesn’t answer, see Looking up the game server.
  • It prints ip, port, zone, iosMode, appVersion, and versionCode, but only the lengths of gameUid, deviceId, shumeiBoxId, shumeiId, and accessToken, and only the names of the device fields it recorded, so its output is safe to paste into an issue.
  • It refuses when more than one stream holds an accepted Login (for example, the app relaunched mid-capture), because the conversations carry no timestamps to tell which is freshest. Pick one with -stream.
  • It fails if the accepted Login is missing zn, gameUid, deviceId, or at. It copies shumeiBoxId when present but doesn’t require it, since the server doesn’t either: a captured session also reconnects with it empty (confirmed live, 2026-10-04).
Recording the build matters. An access token is bound to the identity it was issued under, build included (confirmed live, see Live validation against production). Once the real app updates, a fresh token only works if goclient’s Login claims that same appVersion and versionCode. Without the two fields, a run keeps claiming the build such configs always had, 1.0.344 (786) on iOS or 1.0.364 (1892) on Android, and warns to add them; the built-in builds are 1.0.370 (918 on iOS, 1911 on Android). From an iOS capture, -session-out also records the Login’s device fields (phone_model, osVersion, mt, idfv, distinct_id, fromCountry, lang, phone_screen, afuid, firebaseId) and its ta under device, which an iOS reconnect sends again. The ta is replayed byte for byte, with #app_version, lw_version, lw_res_version, lw_buildcode, lw_zone, lw_device_id, lw_airKey and lw_shumei_id taken from the run; a captured device without a ta (recorded before the 1.0.370 follow-up) makes the run warn to recapture (static-analysis-only).
The written file holds live credentials for a real account. Keep it outside the repository, as the default path in your home directory already is.

Known limitation: some captures stop decoding partway through

Server→client decoding has, on several real captures to date, hit either a DecodeObject error: expected top-level tag 18 (SFS_OBJECT), got ... or a zstd decode: ... error, most often right around the same point in the bootstrap-burst response sequence, but not always at an identical byte offset. Client→server decoding has not shown this problem in any capture so far. These two error kinds behave differently, and only one of them actually stops the decode. A DecodeObject error is non-fatal: -decode-stream logs it inline for that one packet and continues decoding every packet that follows in the stream (see decode_test.go’s “DecodeObject error on one packet continues to the next” regression test). A zstd decode error, by contrast, comes from a lower layer (packet framing/decompression, not the SFSObject decoder) and is fatal, it halts the rest of the stream, so only what was decoded before that point is usable. The working theory was always that this is a reassembly edge case (a reordering/overlap pattern) rather than a decoder bug, since -decode-stream uses the identical codec the live Go client relies on and that connection has never shown equivalent corruption. Replacing the old tshark-fed Python reassembler with the pure-Go internal/pcap (Step 3 above) supports that theory: on a real August-2026 capture whose server→client stream the old path decoded only partway, the Go reassembler decoded the entire stream cleanly, every byte consumed as valid framed packets, ~35 more server→client packets than the old path recovered. The Go reassembler places each segment by its exact sequence offset (rather than relying on tshark’s own stream-reassembly opinion), which is what makes it more robust to the out-of-order/retransmit patterns that tripped the old pipeline. It’s plausible this closes the limitation outright, but it hasn’t been re-tested across enough captures to declare it gone. If a decode still stops partway: a DecodeObject error is isolated (that one packet is skipped, everything before and after is valid), enough to confirm a client→server request’s exact shape even when its matching response is the corrupt one; confirming that one response instead means replaying the request live through the Go client (e.g. via -interactive) and reading its response directly. A zstd decode error is fatal to the rest of the stream, and the same live-replay approach then applies to everything after the cutoff.