Bundle (original)
The Bundle container is the core file format of Criterion's 7th-gen titles with the exception of Burnout Revenge (X360). Each Bundle holds one or more resources (assets) and contains information about each resource, such as its size, type, compression, alignment, and so on.
The Bundle format has two major versions: the original, using the bndl
magic, and Bundle 2, using the bnd2
magic. The first Bundle format underwent at least five iterations during its use from early 2006 to early-mid 2007, but it was never used in a retail game and can only be found in development builds of games such as Burnout Paradise. It was succeeded by Bundle 2, which ultimately saw use in the retail versions of Burnout Paradise (version 2), Need for Speed Hot Pursuit (version 3), and Need for Speed Most Wanted (version 5).
At present, only files using Bundle version 3, 4, and 5 have been discovered. Those versions, plus Bundle 2 version 2, are described below.
Layout
Memory types
Across all Bundle versions, a common theme is the use of separate data chunks to define what memory type resources are loaded into. These chunks are as follows:
Bundle:
- Main Memory
- Disposable
- Physical
- Uninitialized
- Disposable uninitialized
Bundle 2:
- Main Memory
- Graphics System
- Graphics Local
Keep these in mind when viewing the specs below.
Bundle
The original Bundle format's versions were treated more like additions to the previous version. Thus, rather than a full structure for each, only their additions are described here.
Version 3
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | char[4] | macMagicNumber | Bundle magic | bndl |
0x4 | 0x4 | uint32_t | muVersion | Bundle version | |
0x8 | 0x4 | uint32_t | muResourceEntriesCount | Number of resources in the bundle | |
0xC | 0x28 | SizeAndAlignment[5] | Size and alignment of each chunk | ||
0x34 | 0x14 | uint32_t[5] | Memory address of each chunk | ||
0x48 | 0x4 | uint32_t | Resource IDs offset | ||
0x4C | 0x4 | uint32_t | muResourceEntriesOffset | Resource entries offset | |
0x50 | 0x4 | uint32_t | Imports offset | ||
0x54 | 0x4 | uint32_t | muResourceDataOffset | Resource data offset | |
0x58 | 0x4 | uint32_t | muPlatform | Platform the bundle was built for | 1 = PC 2 = X360 3 = PS3 |
Version 4 Additions
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x5C | 0x4 | uint32_t | muFlags | Bundle flags | 1 = IsCompressed |
0x60 | 0x4 | uint32_t | Number of compressed resources | ||
0x64 | 0x4 | uint32_t | Compression information offset |
Version 5 Additions
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x68 | 0x4 | uint32_t | No idea what this does | ||
0x6C | 0x4 | uint32_t | Also no idea what this does |
Substructures
ResourceEntry
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | uint32_t | Resource data memory address | ||
0x4 | 0x4 | uint32_t | muImportOffset | Bundle imports offset | |
0x8 | 0x4 | uint32_t | muResourceTypeId | Resource type | See Resource Types |
0xC | 0x28 | SizeAndAlignment[5] | mauSizeAndAlignmentOnDisk | ||
0x34 | 0x28 | SizeAndAlignment[5] | mauDiskOffset | Offsets in bundle | Alignment is unused (always 1) |
0x5C | 0x14 | uint32_t[5] | Memory addresses | Swapped endian |
Imports
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | uint32_t | muImportCount | Number of imports | |
0x8 | Import entries | Aligned 8. See ImportEntry structure |
ImportEntry
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x8 | ID | mResourceId | Resource name CRC32 | |
0x8 | 0x4 | uint32_t | muOffset | ||
0xC | 0x4 | padding |
Compression Information
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x28 | SizeAndAlignment[5] | mauUncompressedSizeAndAlignment |
SizeAndAlignment
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | uint32_t | Size or offset | ||
0x4 | 0x4 | uint32_t | Alignment |
Bundle 2
Version 2
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | char[4] | macMagicNumber | Bundle magic | bnd2 |
0x4 | 0x4 | uint32_t | muVersion | Bundle version | |
0x8 | 0x4 | uint32_t | muPlatform | Platform the bundle was built for | 1 = PC/PS4 2 = X360 3 = PS3 |
0xC | 0x4 | uint32_t | muDebugDataOffset | Bundle debug data offset | ResourceStringTable XML |
0x10 | 0x4 | uint32_t | muResourceEntriesCount | Number of resources in the bundle | |
0x14 | 0x4 | uint32_t | muResourceEntriesOffset | Resource entries offset | |
0x18 | 0x4 | uint32_t | muResourceDataOffset | Resource data offset | |
0x24 | 0x4 | uint32_t | muFlags | Bundle flags | 1 = IsCompressed 2 = IsMainMenOptimised 4 = IsGraphicsMemOptimised 8 = ContainsDebugData |
Substructures
ResourceEntry
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x8 | ID | mResourceId | Resource name CRC32 | Hashed names are all lowercase |
0x8 | 0x8 | uint64_t | muImportHash | Dependency name(s) CRC32(s) | Multiple are combined with a bitwise OR |
0x10 | 0xC | uint32_t[3] | mauUncompressedSizeAndAlignment | Resource sizes (uncompressed) for each chunk | Has high nibble for alignment; changes between platforms 1 << [nibble] equals the memory alignment value |
0x1C | 0xC | uint32_t[3] | mauSizeAndAlignmentOnDisk | Resource sizes (compressed) for each chunk | See above |
0x28 | 0xC | uint32_t[3] | mauDiskOffset | Resource offsets for each chunk | |
0x34 | 0x4 | uint32_t | muImportOffset | Bundle imports offset | |
0x38 | 0x4 | uint32_t | muResourceTypeId | Resource type | See Resource Types |
0x3C | 0x2 | uint16_t | muImportCount | Number of imports | |
0x3E | 0x1 | uint8_t | muFlags | ||
0x3F | 0x1 | uint8_t | muStreamIndex |
ImportEntry
Offset | Size | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x8 | ID | mResourceId | Resource name CRC32 | ImportEntries are appended to the end of resources. |
0x8 | 0x4 | uint32_t | muOffset | ||
0xC | 0x4 | padding |