StarCraft 2 replays (.SC2Replay) files are actually MPQ files that you can open with any MPQ editor. There are also MPQ libraries or bindings available online for C, Python, PHP, and probably a few other languages.
Each MPQ file contains a (listfile) that tells you what files are inside, though listing the files is actually optional and was often omitted in older Blizzard games.
The version and duration are stored at the beginning of the replay in plain view, without MPQ archiving.
Pre Patch 9, most of the metadata was stored in a file called replay.info, and this contained a lot of information that was relatively straightforward to read just by opening it in a text editor and ignoring the unprintable characters.
Patch 9 (0.11.0.15097) changed the way a lot of the information was stored and probably broke most replay parsers.
As of build 15133, the (listfile) shows and contains
- replay.details (basic metadata)
- replay.initData (unknown)
- replay.attribute.events (unknown)
- replay.game.events (actions)
- replay.message.events (chat, ping)
- replay.smartcam.events (presumably player cameras)
- replay.sync.events (presumably consistency checks)
So far, I've only really looked at the replay.details file, and it's possible to read:
- players (name.identifier, race, winner, color)
- game speed
PM me if you want more detailed info on the replay.details file.
Anyway, just putting this thread out there in case anyone else is also interested in or working on this. I'll try to update this as more gets figured out.