Gw.dat file format
Research of the format of the Gw.dat file was done 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[edit]
The Gw.dat metafile is series of 512-byte blocks. 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[edit]
All access starts with the root block.
Contents[edit]
- 4 bytes, file type and version (always
0x1A
) - 4 bytes, header size (always
32
) - 4 bytes, block size (always
512
) - 4 bytes, CRC of the first bytes (always
0x70adcb4c
) - 8 bytes, offset of the Mft
- 4 bytes, size of the Mft
- 4 bytes, unknown (always
0
)
Main File Table (Mft)[edit]
Mft is an array of 24 byte entries, the first 16 are reserved, and the first four are as follows:
Mft Entry 0[edit]
- 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[edit]
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[edit]
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[edit]
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[edit]
- 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[edit]
Files that start with 'ffna'
- 4 bytes ('ffna') //little-endian Magic header "ArenaNetFileFormat"
- 1 byte - file sub-type //"ArenaNetFileType"
- 0 - None (denote nonexistence)
- 1 - Unused (Doesn't appear in .dat, appears to be a valid map type.)
- 2 - Model
- 3 - Map
- 4 - Unknown (only 1 instance exists in .dat, and only 1 reference in client.)
- 5 - Unused and unknown (also not found in .dat, partially processed like Model)
- 8 - Likely 2d sprites, and/or UI, though unconfirmed.
- 2 bytes - size (size of data / 2 "counting the 2 bytes for size"). note this value is only for types 2, and 8. types 3, and 4 do not have this value.
- additional data - unknown format
- Content of this data after processing by client may include the following.
- ('cryp','file','comp','mdl ','amus','asnd','grtx','grgm','grdv','grlz','grmd','grmt','ovrl','sctx','sdec','grmp','grfo'(Font),'cmd','grlt') non-exhaustive list.