Dbi files

The current status of the extractor tool could recaped as: the only hard thing left are the dbi files. I’m focusing on the hardest reverse engineering first, so I’m leaving anything that is fairly easier for later.

Why are they hard? They are basically a custom format that I haven’t been able to relate to any other game, tool or software in general.

So far, I’ve been able to find out the following:

  1. It’s an indexed file.
    1. It contains the number of elements at the top of the file, in the header.
      This header takes 0x420 bytes where 0x400 bytes are a color palette.
    2. The index is at the bottom of the file and uses 8 byte strings for names and a 4 bytes index in the file.
    3. Elements start after the header.
    4. Each element is 0x2000 long
    5. You can get the start of a file by jumping at 0x420 + index * 0x2000
  2. It contains a color palette of 0x400 bytes in the header.
  3. It contains images. I’ve been able to get this from Listbox.dbiturret
    I’m not making this up, this a turret from the game 😀
    I still need to get this through the palette and it should look nice.
  4. Before each image data, there’s the size of the image. On Listbox.dbi you can use the width and height of the images (present in the header) + padding to get the size of the image. On others, the number is too small.
  5. Images in it are encoded/compressed/obfuscated/encrypted (except but Listbox.dbi), which is not.
    I’ve found a 32 bits field that is set to 0 on Listbox.dbi and 1 in the rest.

    My current focus is to understand what this field is really saying and interpret the image data correctly. I think images are compressed, as the sizes are too small.

  6. It contains other data, just after the image itself.
    After each image, there are a lot of indices. I think they could relate to terrain types, but I don’t know what is that used for; let me copy some examples:

    1. JUNG611 (jungle)
    2. ARID395 (arid)
    3. DESE830 (desert)
    4. BORE828 (???)

And these are the findings of the last week! If I’m able to crack down the compression for the dbi files I will start coding the game soon 🙂