Modding/Need for Speed Hot Pursuit/Memory map

From Burnout Wiki

This page documents the KAC_BINARY_MEMORY_MAP constant in Most Wanted. For a general understanding of what the memory map is and how modding it is relevant, see the page for the memory map in Burnout Paradise.

Structures

CgsMemory::MemoryMap

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0x4 int32_t miVersion 2
0x4 0x4 int32_t miPlatform 0
0x8 0x4 uint32_t muNumBanks
0xC 0x4 uint32_t muNumPools
0x10 0x4 uint32_t muNumRawResources
0x14 0x4 uint32_t muNumLinearAllocators
0x18 0x4 uint32_t muNumMemLinearAllocators
0x1C 0x4 uint32_t muNumHeapAllocators
0x20 0x4 uint32_t muNumRWLinearAllocators
0x24 0x4 uint32_t muNumRWGeneralAllocators
0x28 0x4 uint32_t muNumReservedAllocators
0x2C 0x4 MemoryMapBank* mpBanks
0x30 0x4 MemoryMapPool* mpPools
0x34 0x4 MemoryMapRawResource* mpRawResources
0x38 0x4 MemoryMapLinearAllocator* mpLinearAllocators
0x3C 0x4 MemoryMapMemLinearAllocator* mpMemLinearAllocators
0x40 0x4 MemoryMapHeapAllocator* mpHeapAllocators
0x44 0x4 MemoryMapRWLinearAllocator* mpRWLinearAllocators
0x48 0x4 MemoryMapRWGeneralAllocator* mpRWGeneralAllocators
0x4C 0x4 MemoryMapReservedAllocator* mpReservedAllocators

Remastered

Offset Length Type Name Description Comments
0x0 0x4 int32_t miVersion 2
0x4 0x4 int32_t miPlatform 0
0x8 0x4 uint32_t muNumBanks
0xC 0x4 uint32_t muNumPools
0x10 0x4 uint32_t muNumRawResources
0x14 0x4 uint32_t muNumLinearAllocators
0x18 0x4 uint32_t muNumMemLinearAllocators
0x1C 0x4 uint32_t muNumHeapAllocators
0x20 0x4 uint32_t muNumRWLinearAllocators
0x24 0x4 uint32_t muNumRWGeneralAllocators
0x28 0x4 uint32_t muNumReservedAllocators
0x2C 0x4 Padding
0x30 0x8 MemoryMapBank* mpBanks
0x38 0x8 MemoryMapPool* mpPools
0x40 0x8 MemoryMapRawResource* mpRawResources
0x48 0x8 MemoryMapLinearAllocator* mpLinearAllocators
0x50 0x8 MemoryMapMemLinearAllocator* mpMemLinearAllocators
0x58 0x8 MemoryMapHeapAllocator* mpHeapAllocators
0x60 0x8 MemoryMapRWLinearAllocator* mpRWLinearAllocators
0x68 0x8 MemoryMapRWGeneralAllocator* mpRWGeneralAllocators
0x70 0x8 MemoryMapReservedAllocator* mpReservedAllocators

CgsMemory::MemoryMapBank

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x5C Params mBankParams

Xbox 360

Offset Length Type Name Description Comments
0x0 0x54 Params mBankParams

PC, Remastered

Offset Length Type Name Description Comments
0x0 0x4C Params mBankParams

CgsMemory::MemoryMapPool

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0xB4 CreatePoolRequest mRequest

Remastered

Offset Length Type Name Description Comments
0x0 0xB8 CreatePoolRequest mRequest

CgsMemory::MemoryMapRawResource

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x64 CreateResourceRequest mRequest

Xbox 360

Offset Length Type Name Description Comments
0x0 0x5C CreateResourceRequest mRequest

PC

Offset Length Type Name Description Comments
0x0 0x54 CreateResourceRequest mRequest

Remastered

Offset Length Type Name Description Comments
0x0 0x58 CreateResourceRequest mRequest

CgsMemory::MemoryMapLinearAllocator

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0x44 CreateAllocatorRequest mRequest

Remastered

Offset Length Type Name Description Comments
0x0 0x50 CreateAllocatorRequest mRequest

CgsMemory::MemoryMapMemLinearAllocator

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x64 CreateLinearAllocatorRequest mRequest

Xbox 360

Offset Length Type Name Description Comments
0x0 0x5C CreateLinearAllocatorRequest mRequest

PC

Offset Length Type Name Description Comments
0x0 0x54 CreateLinearAllocatorRequest mRequest

Remastered

Offset Length Type Name Description Comments
0x0 0x58 CreateLinearAllocatorRequest mRequest

CgsMemory::MemoryMapHeapAllocator

Structurally identical to MemoryMapLinearAllocator.

CgsMemory::MemoryMapRWLinearAllocator

Structurally identical to MemoryMapMemLinearAllocator.

CgsMemory::MemoryMapRWGeneralAllocator

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x64 CreateGeneralAllocatorRequest mRequest

Xbox 360

Offset Length Type Name Description Comments
0x0 0x5C CreateGeneralAllocatorRequest mRequest

PC

Offset Length Type Name Description Comments
0x0 0x54 CreateGeneralAllocatorRequest mRequest

Remastered

Offset Length Type Name Description Comments
0x0 0x58 CreateGeneralAllocatorRequest mRequest

CgsMemory::MemoryMapReservedAllocator

Structurally identical to MemoryMapMemLinearAllocator.

CgsMemory::MemoryMapBank::Params

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x20 char[32] macName
0x20 0x4 int32_t mnParentBankId
0x24 0x4 int32_t mnBankId
0x28 0x18 uint32_t[6] mauBankSize
0x40 0x18 uint32_t[6] mauBankBlocks
0x58 0x1 bool mbIsLeaf
0x59 0x1 bool mbAllowFragmentation
0x5A 0x2 Padding

Xbox 360

Offset Length Type Name Description Comments
0x0 0x20 char[32] macName
0x20 0x4 int32_t mnParentBankId
0x24 0x4 int32_t mnBankId
0x28 0x14 uint32_t[5] mauBankSize
0x3C 0x14 uint32_t[5] mauBankBlocks
0x50 0x1 bool mbIsLeaf
0x51 0x1 bool mbAllowFragmentation
0x52 0x2 Padding

PC, Remastered

Offset Length Type Name Description Comments
0x0 0x20 char[32] macName
0x20 0x4 int32_t mnParentBankId
0x24 0x4 int32_t mnBankId
0x28 0x10 uint32_t[4] mauBankSize
0x38 0x10 uint32_t[4] mauBankBlocks
0x48 0x1 bool mbIsLeaf
0x49 0x1 bool mbAllowFragmentation
0x4A 0x2 Padding

CgsMemory::CreatePoolRequest

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0xC PoolEvent Base class
0xC 0x20 char[32] mpcName
0x2C 0x4 int32_t miDeletionDelayFrames
0x30 0x4 uint32_t muMaxResources
0x34 0x20 CgsMemDescriptor mDescriptor
0x54 0x10 uint32_t[4] mauMaxResources
0x64 0x4 int32_t miNumDependencies
0x68 0x40 int32_t[16] maiDependencyIds
0xA8 0x4 int32_t miBankId
0xAC 0x4 int32_t miParentBankId
0xB0 0x1 bool mbAllowDefragmentation
0xB1 0x3 Padding

Remastered

Offset Length Type Name Description Comments
0x0 0x10 PoolEvent Base class
0x10 0x20 char[32] mpcName
0x30 0x4 int32_t miDeletionDelayFrames
0x34 0x4 uint32_t muMaxResources
0x38 0x20 CgsMemDescriptor mDescriptor
0x58 0x10 uint32_t[4] mauMaxResources
0x68 0x4 int32_t miNumDependencies
0x6C 0x40 int32_t[16] maiDependencyIds
0xAC 0x4 int32_t miBankId
0xB0 0x4 int32_t miParentBankId
0xB4 0x1 bool mbAllowDefragmentation
0xB5 0x3 Padding

CgsMemory::PoolEvent

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0x4 BaseEventReceiverQueue* mpUser Not documented here
0x4 0x4 int32_t miEventId
0x8 0x4 int32_t miPoolId

Remastered

Offset Length Type Name Description Comments
0x0 0x8 BaseEventReceiverQueue* mpUser Not documented here
0x8 0x4 int32_t miEventId
0xC 0x4 int32_t miPoolId

CgsMemDescriptor

See EMemoryType for identification of each index.

Offset Length Type Name Description Comments
0x0 0x10 uint32_t[4] mauSizes
0x10 0x10 uint32_t[4] mauAlignments

CgsMemory::MemoryIO::CreateResourceRequest

PlayStation 3

Offset Length Type Name Description Comments
0x0 0xC MemoryRequest Base class
0xC 0x20 char[32] macBankName
0x2C 0x4 int32_t mnBankId
0x30 0x4 int32_t mnParentBankId
0x34 0x30 ResourceDescriptor mDescriptor

Xbox 360

Offset Length Type Name Description Comments
0x0 0xC MemoryRequest Base class
0xC 0x20 char[32] macBankName
0x2C 0x4 int32_t mnBankId
0x30 0x4 int32_t mnParentBankId
0x34 0x28 ResourceDescriptor mDescriptor

PC

Offset Length Type Name Description Comments
0x0 0xC MemoryRequest Base class
0xC 0x20 char[32] macBankName
0x2C 0x4 int32_t mnBankId
0x30 0x4 int32_t mnParentBankId
0x34 0x20 ResourceDescriptor mDescriptor

Remastered

Offset Length Type Name Description Comments
0x0 0x10 MemoryRequest Base class
0x10 0x20 char[32] macBankName
0x30 0x4 int32_t mnBankId
0x34 0x4 int32_t mnParentBankId
0x38 0x20 ResourceDescriptor mDescriptor

CgsMemory::MemoryIO::CreateAllocatorRequest

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0xC MemoryRequest Base class
0xC 0x20 char[32] macBankName
0x2C 0x4 int32_t mnBankId
0x30 0x4 int32_t mnParentBankId
0x34 0x4 int32_t mnResourceType
0x38 0x4 int32_t mnSize
0x3C 0x4 HeapMalloc* mpHeapAllocator Not documented here
0x40 0x4 LinearMalloc* mpLinearAllocator Not documented here

Remastered

Offset Length Type Name Description Comments
0x0 0x10 MemoryRequest Base class
0x10 0x20 char[32] macBankName
0x30 0x4 int32_t mnBankId
0x34 0x4 int32_t mnParentBankId
0x38 0x4 int32_t mnResourceType
0x3C 0x4 int32_t mnSize
0x40 0x8 HeapMalloc* mpHeapAllocator Not documented here
0x48 0x8 LinearMalloc* mpLinearAllocator Not documented here

CgsMemory::MemoryIO::CreateLinearAllocatorRequest

Structurally identical to CreateResourceRequest.

CgsMemory::MemoryIO::CreateGeneralAllocatorRequest

Structurally identical to CreateResourceRequest.

CgsMemory::MemoryIO::MemoryRequest

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0xC MemoryEvent Base class

Remastered

Offset Length Type Name Description Comments
0x0 0x10 MemoryEvent Base class

CgsMemory::MemoryIO::MemoryEvent

PlayStation 3, Xbox 360, PC

Offset Length Type Name Description Comments
0x0 0x4 BaseEventReceiverQueue* mpUser Not documented here
0x4 0x4 int32_t mnEventId
0x8 0x4 EventType meEventType

Remastered

Offset Length Type Name Description Comments
0x0 0x8 BaseEventReceiverQueue* mpUser Not documented here
0x8 0x4 int32_t mnEventId
0xC 0x4 EventType meEventType

rw::ResourceDescriptor

See base resource types for identification of each index.

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x30 BaseResourceDescriptors<6u> Base class

Xbox 360

Offset Length Type Name Description Comments
0x0 0x28 BaseResourceDescriptors<5u> Base class

PC, Remastered

Offset Length Type Name Description Comments
0x0 0x20 BaseResourceDescriptors<4u> Base class

rw::BaseResourceDescriptors<6u>

Offset Length Type Name Description Comments
0x0 0x30 BaseResourceDescriptor[6] m_baseResourceDescriptors

rw::BaseResourceDescriptors<5u>

Offset Length Type Name Description Comments
0x0 0x28 BaseResourceDescriptor[5] m_baseResourceDescriptors

rw::BaseResourceDescriptors<4u>

Offset Length Type Name Description Comments
0x0 0x20 BaseResourceDescriptor[4] m_baseResourceDescriptors

rw::BaseResourceDescriptor

Offset Length Type Name Description Comments
0x0 0x4 uint32_t m_size
0x4 0x4 uint32_t m_alignment

Enumerations

CgsMemory::MemoryIO::EventType

Name Value Comments
0 E_EVENT_TYPE_CREATE_BANK
1 E_EVENT_TYPE_DESTROY_BANK
2 E_EVENT_TYPE_CREATE_RW_LINEAR_ALLOCATOR
3 E_EVENT_TYPE_CREATE_RW_GENERAL_ALLOCATOR
4 E_EVENT_TYPE_CREATE_ALLOCATOR
5 E_EVENT_TYPE_DESTROY_ALLOCATOR
6 E_EVENT_TYPE_CREATE_RESOURCE
7 E_EVENT_TYPE_CACHE_BANK
8 E_EVENT_TYPE_UNCACHE_BANK
9 E_EVENT_TYPE_COUNT

EMemoryType

PlayStation 3

Name Value Comments
E_MEMTYPE_MAIN 0
E_MEMTYPE_GRAPHICS_SYSTEM 1
E_MEMTYPE_GRAPHICS_LOCAL 2
E_MEMTYPE_DISPOSABLE 3
E_MEMTYPE_NUMTYPES 4

Xbox 360

Name Value Comments
E_MEMTYPE_MAIN 0
? 1 PHYSICAL
E_MEMTYPE_DISPOSABLE 2
? 3 DUMMY
E_MEMTYPE_NUMTYPES 4

PC, Remastered

Name Value Comments
E_MEMTYPE_MAIN 0
E_MEMTYPE_DISPOSABLE 1
? 2 DUMMY
? 3 DUMMY
E_MEMTYPE_NUMTYPES 4

Base resource types

PlayStation 3

Name Index
main memory 0
disposable 1
uninitialized 2
disposable uninitialized 3
graphics system 4
graphics local 5

Xbox 360

Name Index
main memory 0
disposable 1
physical 2
uninitialized 3
disposable uninitialized 4

PC, Remastered

Name Index
main memory 0
disposable 1
uninitialized 2
disposable uninitialized 3