MIX File Format

MIX/TLK Specification
[Work In Progress]
This document describes MIX, a file format for storing files used by Westwood Studios for Blade Runner. MIX files SHOULD contain at least one file and MAY contain multiple files. The MIX file itself consists of two segments of information: The header segment which contains information on the entries and the data segment.
Header Segment:

OffsetByte LengthDescription
0000 2Number of Entries
0002 4Byte length of Data Segment
Entry Descriptors [ByteLength = 12 * NumberOfEntries]
Entry 0
0006+0 4ID File name hash
0006+4 4Byte offset in Data Segment
0006+8 4Byte length of entry data
Entry 1
0018+0 4ID File name hash
0018+4 4Byte offset in Data Segment
0018+8 4Byte length of entry data
Entry 2
0030+0 4ID File name hash
0030+4 4Byte offset in Data Segment
0030+8 4Byte length of entry data
+++
Entry n
0042+0 4ID File name hash
0042+4 4Byte offset in Data Segment
0042+8 4Byte length of entry data


Data Segment:
Data Segment contains the file data. Offset from Entry Descriptors does not include header segment byte length.

Pictorially, it looks like:


Looking at the output of the header segment we see that the ID column is in ascending order. This is used to quickly look up a file using the binary search algorithm. The binary search algorithm implemented in Blade Runner used a signed integer, hence the overflow which is shown in red.

ID Offset Length
823d302f 00233b77 00000389
920d1fef 0022eb6e 00000a67
978e1940 00030874 000036ee
97999629 000019e2 0000b2b4
a629042b 00233f00 00000093
a85cdbfe 0023407b 0000011d
b19cf691 001d0436 0000073e
b19d0add 00225cec 00000a26
b19d36c1 0020872a 000004aa
b19d3ac9 0020d40e 00001602
b19d3e95 001dadfc 00001704
b598f2bd 001fa510 00000b02
b598f691 001c8c04 00000544
d19d0add 0022b6c0 00000e72
d598f691 001d01be 00000278
d5990add 00225300 000009ec
d59936c1 00207fcc 0000075e
d5993ac9 0020c94e 00000ac0
d5993e95 001da71c 000006e0
d59d0add 0022c532 0000027e
d76203f7 0004c242 000004b0
dd8234e9 0022ea94 000000da
e54837e3 0022ea3f 00000055
e5adf8fb 0022c7b0 0000052e
e5eadebe 002323aa 0000051c
e762181f 00033f62 000182e0
f3d4ce19 0001d5d6 0000fd26
f6efa690 0000cc96 00006b42
fbd2ce19 000137d8 00009dfe
fd614219 0004c6f2 0013c3be
0802e5dd 00000000 000019e2
09413dc5 00188ab0 0003e93c
0d502bd9 00234198 000000ac
114237e7 00231c2a 00000780
271e2003 00233f93 000000e8
5cc7e4ea 002328c6 0000040a
65621c1c 0002d2fc 00003578
69d30225 00232cd0 00000ea7
69df160d 0022f5d5 00002655