Gw.dat file format

From Guild Wars Wiki
Jump to navigationJump to search
Warning-Logo.png Warning: Directly modifying the Guild Wars program files through any third party tools is completely unsupported by ArenaNet and NCSoft. If anything breaks, do not contact support for help; there's nothing they can do about it. Also, third party programs not supported by ArenaNet might contain trojans, spyware, adware and other harmful programs.


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[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 '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