FastFiles and Zone files (BO2): Difference between revisions

From COD Engine Research
mNo edit summary
Line 56: Line 56:
  0x5E, 0xDC, 0x50, 0xBE
  0x5E, 0xDC, 0x50, 0xBE
== Zone File ==
== Zone File ==
=== Header ===
<syntaxhighlight lang="cpp">
enum
{
  XFILE_BLOCK_TEMP = 0,
  XFILE_BLOCK_RUNTIME_VIRTUAL = 1,
  XFILE_BLOCK_RUNTIME_PHYSICAL = 2,
  XFILE_BLOCK_DELAY_VIRTUAL = 3,
  XFILE_BLOCK_DELAY_PHYSICAL = 4,
  XFILE_BLOCK_VIRTUAL = 5,
  XFILE_BLOCK_PHYSICAL = 6,
  XFILE_BLOCK_STREAMER_RESERVE = 7,
  MAX_XFILE_COUNT
};
struct XFile
{
  int size;
  int unknown;
  int blockSize[MAX_XFILE_COUNT];
};
</syntaxhighlight>
=== Asset List ===
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
struct XAsset
struct XAsset
Line 76: Line 99:
   int assetCount;
   int assetCount;
   XAsset *assets;
   XAsset *assets;
};
enum
{
  XFILE_BLOCK_TEMP = 0,
  XFILE_BLOCK_RUNTIME_VIRTUAL = 1,
  XFILE_BLOCK_RUNTIME_PHYSICAL = 2,
  XFILE_BLOCK_DELAY_VIRTUAL = 3,
  XFILE_BLOCK_DELAY_PHYSICAL = 4,
  XFILE_BLOCK_VIRTUAL = 5,
  XFILE_BLOCK_PHYSICAL = 6,
  XFILE_BLOCK_STREAMER_RESERVE = 7,
  MAX_XFILE_COUNT
};
struct XFile
{
  int size;
  int unknown;
  int blockSize[MAX_XFILE_COUNT];
};
};
</syntaxhighlight>
</syntaxhighlight>

Revision as of 05:02, 13 January 2014

FastFile Structure

struct DB_Header
{
  char magic[8];
  int version;
};

struct DB_AuthSignature
{
  char bytes[256];
};

struct DB_AuthHeader
{
  char magic[8];
  int reserved;
  char fastfileName[32];
  DB_AuthSignature signedSubheaderHash;
};

Encryption & Compression

PS3

After the zone file is created, it is split into blocks. The first block is the 0x28 byte XFile header. After that, each block is 0x7FC0 bytes. Each block is first compressed using best compression, then encrypted using salsa20.

FastFile Keys

XBOX 360

Thanks to Chocolate.

0x0E, 0x50, 0xF4, 0x9F,
0x41, 0x23, 0x17, 0x09, 
0x60, 0x38, 0x66, 0x56, 
0x22, 0xDD, 0x09, 0x13, 
0x32, 0xA2, 0x09, 0xBA, 
0x0A, 0x05, 0xA0, 0x0E, 
0x13, 0x77, 0xCE, 0xDB, 
0x0A, 0x3C, 0xB1, 0xD3

PS3

0xC8, 0x0B, 0x0E, 0x0C,
0x15, 0x4B, 0xFF, 0x91,
0x76, 0xA0, 0xC5, 0xC8,
0xD2, 0x4F, 0xA5, 0xE3,
0xEE, 0x09, 0xEE, 0x90,
0x6F, 0x72, 0x90, 0x80,
0xA3, 0x92, 0x75, 0xFD,
0x3E, 0xA7, 0x13, 0x39 

PC

Thanks to master131.

0x64, 0x1D, 0x8A, 0x2F,
0xE3, 0x1D, 0x3A, 0xA6,
0x36, 0x22, 0xBB, 0xC9,
0xCE, 0x85, 0x87, 0x22,
0x9D, 0x42, 0xB0, 0xF8, 
0xED, 0x9B, 0x92, 0x41,
0x30, 0xBF, 0x88, 0xB6,
0x5E, 0xDC, 0x50, 0xBE

Zone File

Header

enum
{
  XFILE_BLOCK_TEMP = 0,
  XFILE_BLOCK_RUNTIME_VIRTUAL = 1,
  XFILE_BLOCK_RUNTIME_PHYSICAL = 2,
  XFILE_BLOCK_DELAY_VIRTUAL = 3,
  XFILE_BLOCK_DELAY_PHYSICAL = 4,
  XFILE_BLOCK_VIRTUAL = 5,
  XFILE_BLOCK_PHYSICAL = 6,
  XFILE_BLOCK_STREAMER_RESERVE = 7,
  MAX_XFILE_COUNT
};

struct XFile
{
  int size;
  int unknown;
  int blockSize[MAX_XFILE_COUNT];
};

Asset List

struct XAsset
{
  XAssetType type;
  XAssetHeader *header;
};

struct ScriptStringList
{
  int count;
  const char **strings;
};

struct XAssetList
{
  ScriptStringList stringList;
  int count;
  const char **strings;
  int assetCount;
  XAsset *assets;
};