Call of Duty 4: FastFile Format: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:


*Byte 0-3: decompressed fastfile size minus 44 (0x2C)
*Byte 0-3: decompressed fastfile size minus 44 (0x2C)
*Byte 4-47: ''unknown''
*Byte 4-7: about the total size of referenced data, e.g. the required memory for IWI textures if material files are in the ff
*Byte 8-11: ''unknown'', might be a flag (either 0xA4 or 0x444)
*Byte 12-43: ''unknown''
*Byte 44-47: equal to number of entries in "1st index" and amount of (model tag?) strings (times 4 for index length)
*Byte 48-51: separator? (FF FF FF FF)
*Byte 48-51: separator? (FF FF FF FF)
*Byte 52-55: number of records*
*Byte 52-55: number of records* ("2nd index", times 8 for index length)
*Byte 56-63: separator? (FF FF FF FF FF FF FF FF)
*Byte 56-63: separator? (FF FF FF FF FF FF FF FF)
*Byte 64-x: string list (xmodelsurfs?)
*Byte 64-x: string list (xmodelsurfs?) --> not always, depends on the content (required offsets are in the FF header)


<nowiki>*</nowiki> 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.
<nowiki>*</nowiki> under re-investigation <!-- 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. -->


=== Example: mp_backlot_load.ff ===
'''Contains:'''
*2x shaders
*3x materials
*(1x fastfile name)
Materials:
# $victorybackdrop - mile_high_victory_screen.iwi (699,092 bytes)
# $defeatbackdrop - (none)
# $levelbriefing - loadscreen_mp_backlot.iwi (524,316 bytes)
<pre>
-----------  [start of header]
71 03 00 00  decompressed filesize - 44 (hex: 371 + 2C = 39D; dec: 881 + 44 = 925)
B8 AA 12 00  size of both IWIs the materials in FF point to - 56 (2x28, 28 bytes = IWI header)
            0x12AAB8          = 1,223,352
            699,092 + 524,316 = 1,223,408
            difference:                56
A4 00 00 00  might be a flag
00 00 00 00  ... empty?
E5 00 00 00  unknown
00 00 00 00  ... empty?
-----------  [end of header] (44 bytes), [start of index]
00 00 00 00  ... empty?
06 00 00 00  number of records in index (6)
FF FF FF FF  separator
05 00 00 00  FF FF FF FF  1st: shader
05 00 00 00  FF FF FF FF  2nd: shader
04 00 00 00  FF FF FF FF  3rd: material
04 00 00 00  FF FF FF FF  4th: material
04 00 00 00  FF FF FF FF  5th: material
1F 00 00 00  FF FF FF FF  6th: ff name
FF FF FF FF  00 00 00 00  separator / termination
-----------  [end of index]
</pre>


== Index ==
== Index ==
Line 18: Line 68:
4 byte identifier (fastfile entry type), 4 byte offset (FF FF FF FF = -1, meaning right after the previous block?)
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
Separator (FF FF FF FF) after last 4-byte couple + 00 00 00 00 ?
 
=== Types ===
 
* 01 00 00 00 - physpreset
* 03 00 00 00 - xmodel
* 04 00 00 00 - material
* 05 00 00 00 - shader
* 06 00 00 00 - image?
* 14 00 00 00 - menu
* 19 00 00 00 - fx
* 20 00 00 00 - stringtable (comma separated list)
* 1F 00 00 00 - string / raw file / fastfile name
 
 
<!-- under re-investigation, don't delete please!


Example:
Example:
Line 51: Line 116:
...                      xmodel data (similar to original xmodel file, but nonetheless different)
...                      xmodel data (similar to original xmodel file, but nonetheless different)
</pre>
</pre>


=== Shaders ===
=== Shaders ===
Line 79: Line 145:
FF FF FF FF
FF FF FF FF
</pre>
</pre>
-->


--[[User:CoDEmanX|CoDEmanX]] 17:27, 16 May 2009 (UTC)
--[[User:CoDEmanX|CoDEmanX]] 17:27, 16 May 2009 (UTC)

Revision as of 04:23, 4 November 2009

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


Header

  • Byte 0-3: decompressed fastfile size minus 44 (0x2C)
  • Byte 4-7: about the total size of referenced data, e.g. the required memory for IWI textures if material files are in the ff
  • Byte 8-11: unknown, might be a flag (either 0xA4 or 0x444)
  • Byte 12-43: unknown
  • Byte 44-47: equal to number of entries in "1st index" and amount of (model tag?) strings (times 4 for index length)
  • Byte 48-51: separator? (FF FF FF FF)
  • Byte 52-55: number of records* ("2nd index", times 8 for index length)
  • Byte 56-63: separator? (FF FF FF FF FF FF FF FF)
  • Byte 64-x: string list (xmodelsurfs?) --> not always, depends on the content (required offsets are in the FF header)

* under re-investigation


Example: mp_backlot_load.ff

Contains:

  • 2x shaders
  • 3x materials
  • (1x fastfile name)


Materials:

  1. $victorybackdrop - mile_high_victory_screen.iwi (699,092 bytes)
  2. $defeatbackdrop - (none)
  3. $levelbriefing - loadscreen_mp_backlot.iwi (524,316 bytes)
-----------  [start of header]

71 03 00 00  decompressed filesize - 44 (hex: 371 + 2C = 39D; dec: 881 + 44 = 925)

B8 AA 12 00  size of both IWIs the materials in FF point to - 56 (2x28, 28 bytes = IWI header)
             0x12AAB8          = 1,223,352
             699,092 + 524,316 = 1,223,408
             difference:                56

A4 00 00 00  might be a flag

00 00 00 00  ... empty?
E5 00 00 00  unknown
00 00 00 00  ... empty?

-----------  [end of header] (44 bytes), [start of index]

00 00 00 00  ... empty?

06 00 00 00  number of records in index (6)
FF FF FF FF  separator

05 00 00 00  FF FF FF FF  1st: shader
05 00 00 00  FF FF FF FF  2nd: shader
04 00 00 00  FF FF FF FF  3rd: material
04 00 00 00  FF FF FF FF  4th: material
04 00 00 00  FF FF FF FF  5th: material
1F 00 00 00  FF FF FF FF  6th: ff name
FF FF FF FF  00 00 00 00  separator / termination

-----------  [end of index]

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 + 00 00 00 00 ?

Types

  • 01 00 00 00 - physpreset
  • 03 00 00 00 - xmodel
  • 04 00 00 00 - material
  • 05 00 00 00 - shader
  • 06 00 00 00 - image?
  • 14 00 00 00 - menu
  • 19 00 00 00 - fx
  • 20 00 00 00 - stringtable (comma separated list)
  • 1F 00 00 00 - string / raw file / fastfile name


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

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