also I came up with something I call "HeaderMagic" Because the string table is always after the header I just subtract the header size from the string table offset to get a sort of magic value
then i use that to find the offsets to other stuff that you can get from the header such as the file table

Some variables that will help you
Code: Select all
public int stringTableOffset;//352
public int fileCount;//692
public int fileTableStringsOffset;//696
public int fileTableStringsSize;//700
public int fileTableOffset;//704
public int HeaderMagic { get { return stringTableOffset - 0x3000; } }
Code: Select all
//String Offsets from the file table
int[] stringOffsets = new int[fileCount];
//Move to the table and read all the string offsets
br.SeekTo(fileTableOffset - HeaderMagic);
for (int x = 0; x < fileCount; x++)
{
stringOffsets[x] = br.ReadInt32();
}
//Read all the file strings
tagPaths = new string[fileCount];
for (int x = 1; x < fileCount - 1; x++)
{
//Move to the string
br.SeekTo((fileTableStringsOffset - HeaderMagic) + stringOffsets[x]);
//Figure out the string size
int stringSize = 0;
if (x == fileCount - 1)
stringSize = stringOffsets[x] - fileTableStringsSize;
else
stringSize = stringOffsets[x + 1] - stringOffsets[x];
//Read in the string
tagPaths[x] = new string(br.ReadChars(stringSize));
}

also prey here is the map types
Code: Select all
public mapTypes mapType;//316
public enum mapTypes : short
{
Singleplayer = 0x0000,
Multiplayer = 0x0001,
Mainmenu = 0x0002,
Shared = 0x0003,
}
