CAM files are archives employed by the sequel of Deadlock and possibly other games created by the same studio.
These archives can store multiple file formats. Also, the known instances are not compressed.
CAM files contain a header that declares the formats of files and offset tables that define where the file data can be found within the archive.
Every known CAM file is little endian.
Header (magic number) is a constant 8 byte long string
Offset (hex) | Size (bits) | Type | Name | Constant Value |
---|---|---|---|---|
0 | 64 | Constant Length ANSI String | magic number | "CYLBPC " |
Some attributes after the magic number are currently unknown.
After these attributes, a format count is presented.
Offset (hex) | Size (bits) | Type | Name | |
---|---|---|---|---|
0C | 32 | Unsigned Integer | Format Count |
Then the formats are declared.
For the first format, the specification would be:
Offset (hex) | Size (bits) | Type | Name | |
---|---|---|---|---|
14 | 32 | Constant Length ANSI String | Format Name | |
18 | 32 | Unsigned Integer | Format Count |
After the format definitions, records of file offsets and lengths are defined.
Each record is 224 bytes long (7 elements of unsigned 32 bit integers).
Size (bits) | Signed | Type | Name |
---|---|---|---|
32 | No | Integer | Index |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | -- | -- | Possibly Padding |
32 | No | Integer | Offset |
32 | No | Integer | Length |
/** filerecord structure, * Structures in C are discouraged since compilers add padding to align the structures, * which would probably break the compatibility with non aligned sequences found in CAM files. * Each line represents 32 bit of data.**/ typedef struct filerecord { uint32_t index; uint32_t padding1; uint32_t padding2; uint32_t padding3; uint32_t padding4; uint32_t offset; uint32_t length; } filerecord_t;
Platform | Name | Sequel | Version | Format Count | Size (bytes) | |
---|---|---|---|---|---|---|
Windows | dl2sound.cam | DL2 | any (incl. demo) | 1 | 20365014 | |
Windows | dl2music.cam | DL2 | any retail | 1 | 63499896 | |
Windows | dl2segue.cam | DL2 | any retail | 1 | 20035962 | |
Windows | DEADCINE.cam | DL2 | any retail | 1 | 102649244 | |
Windows | DEADANIM.cam | DL2 | any retail | 1 | 7216064 | |
Windows | DEADCYB.cam | DL2 | any (incl. demo) | 7 | 26396965 |
Decoding Project Blog: 2015/06/cam-file-encoder
Decoding Project Blog: 2015/06/cam-file-extractor
Decode Wiki: HDX & HDD Files
Decode Wiki: Home