> [!CAUTION] > This entire wireshark dissector was LLM generated # Slippi mirroring dissector (`slippi.lua`) A Wireshark/tshark Lua dissector for **Slippi console mirroring** traffic — the TCP stream a Slippi Nintendont console (Wii) sends to a desktop client (Slippi Launcher / Dolphin / slippi-js / libmelee). ## Install Drop `slippi.lua` into your Wireshark *Personal Lua Plugins* folder (*Help → About Wireshark → Folders*), then *Analyze → Reload Lua Plugins*. Or point tshark at it directly: ```bash tshark -X lua_script:slippi.lua -i eth0 -f 'tcp port 51441' ``` On this box the console is `10.11.12.158` and the client talks to it from `10.11.12.1:*`, so a live view is: ```bash tshark -X lua_script:slippi.lua -i eth0 -f 'host 10.11.12.158 and tcp port 51441' ``` ## What it decodes * **Framing** — `u32be length` + UBJSON, with TCP reassembly for messages that span segments and multiple messages per segment. * **UBJSON** — generic tree (`slippi.ubjson.*`) plus typed fields for the known keys. * **Message types** — `HANDSHAKE` (1), `REPLAY` (2), `KEEPALIVE` (3), `MENU` (4); see `slippi.type`. Handshake fields: `slippi.nick`, `slippi.nintendont_version`, `slippi.client_token`, `slippi.pos`, `slippi.cursor`, `slippi.is_realtime`. Replay fields: `slippi.pos`, `slippi.next_pos`, `slippi.force_pos`, `slippi.data_len`. * **Embedded .slp event stream** inside `REPLAY`/`MENU` payloads — split into events using the per-game **Event Payloads (0x35)** table when it is seen on the stream, otherwise a built-in default table (verified byte-for-byte against a live 3.17.0.0 console). Decoded per event: * `0x35` Event Payloads – full command/size table * `0x36` Game Start – `slippi.slp.replay_version`, `slippi.slp.stage`, per-player external character + player type, display names / connect codes * `0x37` Pre-Frame / `0x38` Post-Frame – frame, player index, action state, position, facing, percent, shield, stocks, internal character * `0x39` Game End – method, LRAS initiator, placements * `0x3A` Frame Start – frame, RNG seed, scene frame counter * `0x3B` Item Update – frame, item type, spawn id * `0x3C` Frame Bookend – frame, latest finalized frame * `0x10` Message Splitter – wrapped command, chunk size, last-chunk flag * **Legacy / relay streams** (no length prefix — old Nintendont or a Slippi relay forwarding the raw `.slp` byte stream) are detected heuristically and dissected as a bare event stream. The Info column summarises each packet, e.g. `REPLAY frame 2001 [FS PRE PRE POST POST BE]` or `REPLAY [PAYLOADS START]`. ## Ports Registered on TCP `51441` (Wii direct), `666` (legacy Nintendont) and `53741–53744` (relay instances). A heuristic also catches the protocol on any other TCP port. ## Protocol references * — `SPEC.md`, `SPECTATOR_PROTOCOL.md` * — `src/node/console/*` * — `melee/slippstream.py`