Call of Duty 4: FastFile Format

From COD Modding & Mapping Wiki
Revision as of 00:13, 3 November 2009 by Daevius (talk | contribs)
Jump to navigation Jump to search

*** Article and investigation in early progress ***


Header

  • Byte 0-3: decompressed fastfile size minus 44 (0x2C)
  • Byte 4-47: unknown
  • Byte 48-51: separator? (FF FF FF FF)
  • Byte 52-55: number of records*
  • Byte 56-63: separator? (FF FF FF FF FF FF FF FF)
  • Byte 64-x: string list (xmodelsurfs?)

* If a file was missing on ff compile, it does not count but the error message is added to the end of the file. There are usually more index entries than the number of records in the header. The given number of records is not equal to the entries in the assetinfo or assetlist file, it's usually higher.


Index

4 byte identifier (fastfile entry type), 4 byte offset (FF FF FF FF = -1, meaning right after the previous block?)

Separator (FF FF FF FF) after last 4-byte couple

Example:

1F 00 00 00 FF FF FF FF  rawfile (plaintext)
05 00 00 00 FF FF FF FF  shader
03 00 00 00 FF FF FF FF  related to xmodel
1F 00 00 00 FF FF FF FF  xmodel data

FF FF FF FF              separator

4A 06 00 00              rawfile length

FF FF FF FF              separator

6D 61 70 73 2F 6D 70 2F  filename:
5F 72 65 70 75 6C 73 65  maps/mp/_repulse.gsc
2E 67 73 63 00           followed by plaintext:
69 6E 69 74 28 29 0D 0A  init()..
7B 0D 0A 09 74 68 72 65  {...thre
61 64 20 70 6C 61 79 65  ad playe
72 63 6F 6E 6E 65 63 74  rconnect
28 29 3B 0D 0A ...       ();..}.

FF FF FF FF              separator

...                      shader (binary data)

...                      xmodel related data

...                      xmodel data (similar to original xmodel file, but nonetheless different)

Shaders

50 00 00 00 or 40 00 00 00

FF FF FF FF
00 00 00 00
FF FF FF FF
9F 00 00 00  size after filename

filename ended with 0x00

(size * 4) bytes of shader data, seems to end with FF FF 00 00
might contain more data

FF FF FF FF

or

FF FF FF FF
00 00 00 00

filename starts with ','

FF FF FF FF

--CoDEmanX 17:27, 16 May 2009 (UTC)

--Daevius 23:59, 1 November 2009 (UTC)