tcpdump against the real app while it plays through the same network interface as the analysis machine is sufficient.
Step 1: capture
Runtcpdump 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:
en0 above; networksetup -listallhardwareports lists yours). On macOS:
- You don’t need
sudoif Wireshark’s ChmodBPF helper is installed, since it gives your user read access to the/dev/bpf*devices. -i anyneeds root on macOS, even with ChmodBPF.
at.time, rt).
If you need a narrower capture, filter on the known hosts and ports instead:
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.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 ana=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:
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.
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:-decode-stream), use -out instead of -decode:
-client <ip> to pcap to override the auto-detected client side if the heuristic ever picks wrong.
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 withec=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
-session-out does:
- It searches every plain (non-TLS) stream, or only the one you name with
-stream. - It picks the
Loginrequest (c=0, a=1) whose server reply carries noec. It reports streams whoseLoginwas rejected or never answered, and skips thea=29probe streams. - It writes
ip,port,zone,gameUid,deviceId,shumeiBoxId,accessToken, andiosMode(fromplatform="0"), plus theappVersionandversionCodethe token was issued under, and theshumeiId: the lastpush.shumei.idafter the acceptedLoginthat carries noerrorCode, else the capturedta’slw_shumei_id. It sets mode0600, tightening an existing file’s mode too. - Written onto an existing session config, it keeps every key it doesn’t write (
features,duelPolicy,shumeiInstalland any other), and removes a key it writes when the capture lacks it (an Android capture’sdevice, for one). It dropsaccessTokenTimewhen the access token changed andrefreshToken/refreshTokenTimewhen thedeviceIdchanged, 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 pushedshumeiId, the save-back) write only the keys the session config models, so a keygoclientdoesn’t know is dropped at the first such save. - It appends every other gateway that answered a probe on the same port to
ipas a|-delimited fallback list, after the gateway the acceptedLoginwent through.ipandportare only a starting address:goclientlooks the server up with GSL before everyLoginand 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, andversionCode, but only the lengths ofgameUid,deviceId,shumeiBoxId,shumeiId, andaccessToken, 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
Loginis missingzn,gameUid,deviceId, orat. It copiesshumeiBoxIdwhen 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).
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).
Known limitation: some captures stop decoding partway through
Server→client decoding has, on several real captures to date, hit either aDecodeObject 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.