Binary Chunks

From Director

Binaries have chunks in them. This is a breakdown of the chunks. Note that endianness does not always apply, but from what I've seen if it is a little endian binary at least the chunk kind and length are the same.

IMAP[edit | edit source]

The IMAP or Initialisation Map, is the first chunk after the file header in standard (not afterburner) files.
01000000 2C000000 3A070000 00000000 00000000 00000000
Field Name Size (Bytes) Type Description
Chunk Kind 4 string A unique identifier for the chunk, in this case "IMAP"
Chunk Length 4 uint32 The length of the chunk, excluding kind + length
MemoryMapCount 4 int32 The amount of memory maps in the binary
MemoryMapOffset 4 int32 The offset to the memory map from the start of the binary, this is the current active memory map.
MemoryMapFileVersion 4 int32 The file version of the memory map.
Reserved 2 int16 Reserved
Unknown 2 int16 The purpose is not known.
Reserved2 4 int32 Reserved

MMAP[edit | edit source]

The MMAP or Memory Map, which points out where all chunks are in the binary (not available in afterburner files).
6D6D6170 00000720 00180014 0000005A 00000048 FFFFFFFF FFFFFFFF 00000022 52494658 000090C0 00000000 00010000 00000000 696D6170 00000018 0000000C 00010000 002ED89C 6D6D6170 00000720 0000002C 00000000 002ED3DC 4B45592A 00000174 00000754 00000000 00000000 56574346 00000050 000008D0 00000000 00000000 43415374 00000091 00000A22 00000000 00000000 43415374 0000002F 00000992 00000000 00000000 56575343 000000E8 00001DC6 00000000 00000000 42495444 000006B9 000083A0 00000000 00000000 46586D70 00000875 000014D6 00000000 00000000 536F7264 0000002A 00000928 00000000 00000000 56574649 0000006A 00001D54 00000000 00000000 434C5554 00000600 00001EE2 00000000 00000000 66726565 00000000 00000000 000C0000 00000017 53435246 00000024 00001EB6 00000000 00000000 5657464D 00000000 000090C0 00000000 00000000 43415374 00000050 00000ECA 00000000 00000000 43415374 0000009D 00000BF0 00000000 00000000 5448554D 00000524 00008B94 00000000 00000000 4C637478 000000B2 00000F22 00000000 00000000 736E6420 00000000 00008A62 00000000 00000000 66726565 00000000 00000000 000C0000 00000021 66726565 00000000 00000000 000C0000 0000003E 66726565 00000000 00000000 000C0000 0000001E 4341532A 00000030 0000095A 00000000 00000000 43415374 00000092 00000ABC 00000000 00000000 42495444 00000435 00007F62 00000000 00000000 43415374 00000092 00000B56 00000000 00000000 42495444 000003F8 00007B62 00000000 00000000 4C6E616D 00000036 00001442 00000000 00000000 66726565 00000000 00000000 000C0000 0000001F 66726565 00000000 00000000 000C0000 00000020 66726565 00000000 00000000 000C0000 00000029 66726565 00000000 00000000 000C0000 00000016 66726565 00000000 00000000 000C0000 00000015 43415374 00000072 00000D3C 00000000 00000000 4C736372 00000094 0000130A 00000000 00000000 4C736372 0000008E 00000FDC 00000000 00000000 43415374 0000004F 000009CA 00000000 00000000 4C736372 0000008E 00001072 00000000 00000000 4C736372 0000008E 00001108 00000000 00000000 66726565 00000000 00000000 000C0000 0000002A 66726565 00000000 00000000 000C0000 0000002D 4C736372 00000094 000013A6 00000000 00000000 43415374 0000009D 00000C96 00000000 00000000 66726565 00000000 00000000 000C0000 0000002E 66726565 00000000 00000000 000C0000 00000030 466D6170 0000004E 00001480 00000000 00000000 66726565 00000000 00000000 000C0000 00000031 66726565 00000000 00000000 000C0000 00000032 66726565 00000000 00000000 000C0000 00000037 42495444 0000566F 000024EA 00000000 00000000 53545854 00000121 00008A6A 00000000 00000000 43415374 00000082 00000DB6 00000000 00000000 43415374 00000082 00000E40 00000000 00000000 66726565 00000000 00000000 000C0000 00000038 66726565 00000000 00000000 000C0000 00000039 66726565 00000000 00000000 000C0000 0000003C 4C736372 000000AE 0000119E 00000000 00000000 4C736372 000000AE 00001254 00000000 00000000 66726565 00000000 00000000 000C0000 0000003D 66726565 00000000 00000000 000C0000 0000003F 66726565 00000000 00000000 000C0000 0000000D 66726565 00000000 00000000 000C0000 00000040 66726565 00000000 00000000 000C0000 00000041 66726565 00000000 00000000 000C0000 00000042 66726565 00000000 00000000 000C0000 00000043 66726565 00000000 00000000 000C0000 00000044 66726565 00000000 00000000 000C0000 00000045 66726565 00000000 00000000 000C0000 00000046 66726565 00000000 00000000 000C0000 00000047 66726565 00000000 00000000 000C0000 FFFFFFFF 89BE0073 BE620000 0000002E F5DC0000 00000511 010089BE 0073BE62 00000000 002EF5DC 00000000 06120000 89BE0073 BE620000 0000002E F5DC0000 00000710 000089BE 0073BE62 00000000 002EF5DC 00000000 08200000 89BE0073 BE620000 0000002E F5DC0000 00000920 000089BE 0073BE62 00000000 002EF5DC 00000000 0A200000 89BE0073 BE620000 0000002E F5DC0000 00000B22 010189BE 0073BE62 00000000 002EF5DC 00000000 0C100101 89BE0073 BE620000 0000002E F5DC0000 00000D11 040189BE 0073BE62 00000000 002EF5DC 00000000 0E100401 89BE0073 BE620000 0000002E F5DC0000 00000F12 010189BE 0073BE62 00000000 002EF5DC 00000000 10200101 89BE0073 BE620000 0000002E F5DC0000 00001120 010189BE 0073BE62 00000000 002EF5DC 00000000 12100101 89BE0073 BE620000 0000002E F5DC0000 00001310 010189BE 0073BE62 00000000 002EF5DC 00000000 14210401
Field Name Size (Bytes) Type Description
Chunk Kind 4 string A unique identifier for the chunk, in this case "MMAP"
Chunk Length 4 int32 The length of the chunk, excluding kind + length
HeaderSize 2 int16 The size of the header.
EntrySize 2 int16 The size of each entry.
NumberOfEntries 4 int32 The number of entries.
NonZeroEntries 4 int32 The number of non-zero entries.
FirstFreeEntry 4 int32 The first free entry.
FirstJunkEntry1 4 int32 The first junk entry.
FirstJunkEntry2 4 int32 The second junk entry.
Resources Variable Slice of Resource An array of Resource structures. Refer below for its structure

MMAP - Resources[edit | edit source]

Resources start straight after FirstJunkEntry2.

Field Name Size (Bytes) Type Description
ResourceId - int The ID of the resource, based on index position.
Kind 4 string The type of the chunk.
Size 4 int32 The size of the chunk.
Offset 4 int32 The offset of the chunk.
Unknown1 2 int16 Unknown purpose field.
Unknown2 2 int16 Unknown purpose field.
Unknown3 4 int32 Unknown purpose field.

KEY*[edit | edit source]

The KEY* or Key Mapping Pointers, allocates ownership of chunks to casts.
4B45592A 00000174 000C000C 0000001E 00000012 00000008 00000005 42495444 0000000C 00000006 434C5554 00000014 00000010 736E6420 0000001A 00000019 42495444 0000001C 0000001B 42495444 00000034 00000023 53545854 00000033 00000026 42495444 00000012 00000026 5448554D 00000018 00000400 4341532A 00000009 00000400 46586D70 0000002F 00000400 466D6170 00000013 00000400 4C637478 0000000E 00000400 53435246 0000000A 00000400 536F7264 00000004 00000400 56574346 0000000B 00000400 56574649 0000000F 00000400 5657464D 00000007 00000400 56575343 00000022 00000400 5657746B 00000022 00000400 5657746B 00000022 00000400 5657746B 00000022 00000400 5657746B 00000022 00000400 5657746B 00000000 00000000 003E0000 00100100 0009635A 00000000 00000030 0083FD00 00010084 FDA00084 89D40084 FC8CFFFF 0084FE14 AA55AA55 AA55AA55 00000000 0000003B 00000000 00000030
Field Name Size (Bytes) Type Description
Chunk Kind 4 string A unique identifier for the chunk, in this case "KEY*"
Chunk Length 4 int32 The length of the chunk.
Header Size 2 int16 The size of the header.
Record Size 2 int16 The size of each record.
Record Count 4 int32 The number of records.
Active Records 4 int32 The number of active records.
Records Variable Array An array of KeyRecord structures. It repeats for RecordCount times.

KEY* - KeyRecord[edit | edit source]

Field Name Size (Bytes) Type Description
ElementIndex 4 int32 The index of the element.
CastIndex 4 int32 The index of the cast.
BlockType 4 string The type of the block.
CastNumber Not stored in binary, calculated at read time. If ElementIndex >= 1024, CastNumber = ElementIndex - 1024, else CastNumber = -1.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.