Gw.dat file format

Research of the format of the Gw.dat file is going on at XentaxWiki and its related discussion pages and forums. For more detailed information see the pages there.

This page gives a general idea of the file format, however all information given here are not confirmed by ArenaNet.

Overall Format
The Gw.dat metafile is series of 512 bytes blocks and internal files take up one or more consecutive blocks. When files are updated they can either be overwritten in place or, if too large, added to the end or perhaps another larger free area.

There is a root block at the beginning of Gw.dat that identifies the file type and links to the Main File Table (Mft). When accessing the dat file, the Mft is used to look up file information based on the file number. All values are Little Endian.

Root Block
All access starts with the root block.

Contents

 * 4 bytes, file type and version (always )
 * 4 bytes, header size (always )
 * 4 bytes, block size (always )
 * 4 bytes, CRC of the first bytes (always )
 * 8 bytes, offset of the Mft
 * 4 bytes, size of the Mft
 * 4 bytes, unknown (always )

Main File Table (Mft)
Mft is an array of 24 byte entries, the first 16 are reserved, and the first four are as follows:

Mft Entry 0

 * 4 bytes (always 'Mft' 0x1a) - File type
 * 64 bit - Unknown (Free block pointer or counter?)
 * 32 bit - Entries in Mft table
 * 32 bit (always 0) - Unknown
 * 32 bit (always 0) - unused CRC

Mft Entry 1
May be a reflection of the root block


 * 64 bit (always 0)
 * 32 bit (always 32) - size of root block?
 * 16 bit (always 0, uncompressed) - Compression
 * 8 bit (always 3, data) - Content
 * 8 bit (always 0) - Content Type
 * 32 bit (always 0) - Unknown
 * 32 bit (always 0) - unused CRC

Mft Entry 2
Unknown what this entry points at


 * 64 bit - offset to data
 * 32 bit - size of data
 * 16 bit (always 0, uncompressed) - Compression
 * 8 bit (always 3, data) - Content
 * 8 bit (always 0) - Content Type
 * 32 bit (always 0?) - Unknown
 * 32 bit - CRC

Mft Entry 3
Self reference to this Mft


 * 64 bit - offset to data
 * 32 bit - size of data
 * 16 bit (always 0, uncompressed) - Compression
 * 8 bit (always 3, data) - Content
 * 8 bit (always 0) - Content Type
 * 32 bit (always 0?) - Unknown
 * 32 bit - CRC

Other Mft Entries

 * 64 bit - offset to file
 * 32 bit - size of file
 * 16 bit - compression type
 * 0 uncompressed
 * 8 compressed
 * 8 bit - content
 * 1 - empty block?
 * 3 - has content)
 * 8 bit - content type
 * 0
 * 1
 * 2 - FFNA file
 * 11
 * 12
 * 255
 * 32 bit - Unknown
 * 32 bit - CRC

FFNA files
Files that start 'ffna'


 * 4 bytes (always 'ffna')
 * 1 byte - type (almost all are either 2 or 8)
 * 0
 * 2 - model
 * 3 - map
 * 4
 * 8
 * additional data - unknown format