Skip to content

Instantly share code, notes, and snippets.

@Traderain
Created November 3, 2016 02:17
Show Gist options
  • Save Traderain/c1ae5de02bf134eed17eea609e26b8ea to your computer and use it in GitHub Desktop.
Save Traderain/c1ae5de02bf134eed17eea609e26b8ea to your computer and use it in GitHub Desktop.
Source engine save files: //Version 115
-----------------------------
struct Header
{
char[4] MagicWord == "J","S","A","V";
int SaveVersion; //int32
int TokenTableFileTableOffset; //int32
int TokenCount; //int32
int TokenTableSize; //int32
}
Read Header then from currpos seek <TokenTableSize> then <TokenTableFileTableOffset>.
After this the archive begins so now *.hl? files:
-----------------------------------
Not you will most likely have mapname*3 mapstate files.
Here you will have a statefile name which is 260 char long (trim \0 at the end) then
an int32 which is the length of the valv file.
Do this until end of file. Since VALV files are compressed with CLZSS a costum compressor
made by valve you have to decode them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment