-
Notifications
You must be signed in to change notification settings - Fork 0
replay.initData
The full format of the initData file isn't known but enough of it is available to pull out several bits of information:
- Player Names
- Game Realm (EU,US,etc)
- Map Hashes
The first byte of the file indicates the number of players to follow (generally 16)
Each player has an initial byte indicating name length (in bytes) followed by the name and 5 null bytes.
This section is padded by 24 bytes of unknown information.
The next byte indicates the length of the SCII Account String to follow. This appears to be the account string that you might see when browsing the StarcraftII folders on your install.
After the account string, we have 684 bytes of unknown information.
The next section is a series of map entries, each started with s2ma and two null bytes. The body of each map entry consists of a two byte realm indicator followed by a 32 byte map hash which probably uniquely identifies the map in a localization independent way.
num_players = bytes.get_big_int(1) for p in range(0,num_players): name_length = bytes.get_big_int(1) name = bytes.get_string(name_length) bytes.skip(5) bytes.skip(5) # Unknown bytes.get_string(4) # Always Dflt bytes.skip(15) #Unknown id_length = bytes.get_big_int(1) sc_account_id = bytes.get_string(id_length) bytes.skip(684) # Fixed Length data for unknown purpose while( bytes.get_string(4).lower() == 's2ma' ): bytes.skip(2) replay.realm = bytes.get_string(2).lower() unknown_map_hash = bytes.get_big(32)