Township
 

MOD File Format


This is a description of the MOD file format used in Neverwinter Nights. The first thing in the file is the Header block.
MOD Header
char[4]Signature "MOD "
char[4]Version "V1.0"
dwordUnknown
dwordDescriptionBlockSize
dwordNumberOfFiles
dwordDescriptionBlockOffset
dwordFileHeaderTableOffset
dwordLookupTableOffset
dwordUnknown
dwordUnknown
dwordTermination (-1)

DescriptionBlock
dword0
dwordTextLen
char[TextLen]Description

The FileHeaderTable is a list of FileHeaders. NumberOfFiles above dictates how many of these there are.

FileHeader
char[16]Filename
dwordIndex
dwordFileType
The filename is a unique identifier for the file. Here is a list of all known filetypes. The Index is the index into the LookupTable.

The LookupTable is a list of offsets and sizes for each file. The offset points to the beginning of the file data.

LookupTable
dwordOffset
dwordSize

I've written a quick example that'll parse a MOD file, and dump the main module.ifo file. DumpMOD.C

  Gimp LogoSourceForge Logo