$ cat writeup.md…
$ cat writeup.md…
sekai2026
Task: analyze a StarCraft II SC2Replay MPQ archive with chat fragments and hidden position-based data. Solution: decode replay messages, plot SUnitDiedEvent coordinates from tracker events, and rebuild the flag.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
The provided archive was misc_deadgame2.tar.gz, containing misc_deadgame2/DeadGame2.SC2Replay.
The replay is a StarCraft II MPQ archive. Metadata identified map title Tunguska, GameVersion 5.0.15.96999, and Base96999.
The goal was to recover the complete SeKaiCTF{...} flag from replay data. The visible chat gave most of the flag, while a hint about positions pointed to hidden text encoded in tracker coordinates.
python3.11mpyq for extracting the MPQ replay archives2protocol for decoding StarCraft II replay streamsPillow for rendering coordinate plotsThe local environment used vendor311 packages because the bundled s2protocol code was compatible with Python 3.11.
After unpacking the challenge archive, treat DeadGame2.SC2Replay as an MPQ archive and extract the replay streams. The important files were:
replay.message.events - in-game chat messagesreplay.tracker.events - unit and positional tracker eventsThe message stream can be decoded directly with the matching/latest bundled s2protocol protocol module:
#!/usr/bin/env python3 from pathlib import Path from s2protocol.versions import protocol97364 as protocol data = Path("extract/replay.message.events").read_bytes() for event in protocol.decode_replay_message_events(data): if event.get("_event") != "NNet.Game.SChatMessage": continue text = event["m_string"].decode("utf-8", "replace") if text: print(event["_gameloop"], event["_userid"]["m_userId"], text)
The decoded chat stream contained direct flag fragments plus the key hint:
...
$ grep --similar