Read/edit table

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
lorak
Posts: 36
Joined: Wed Aug 31, 2016 6:12 pm

Read/edit table

Post by lorak »

This sample file is a set of 30 tables with raw data similar to the table shown below. I am able to read it directly in an hex editor, although it is a very pedestrian way and time consuming.

Here is the first table from my sample file. It contains 14 records.

Code: Select all

14 05 00 00 07 01 40 00 14 05 00 00 12 02 C0 00 
6C 07 00 00 06 03 C0 00 00 00 00 00 00 00 00 00
6C 07 00 00 03 04 40 00 6C 07 00 00 01 05 40 00
14 05 00 00 04 06 C0 00 00 00 00 00 00 00 00 00
6C 07 00 00 09 07 40 00 14 05 00 00 0C 08 C0 00
6C 07 00 00 0E 09 40 00 6C 07 00 00 08 0A 40 00
6C 07 00 00 0B 0B C0 00 00 00 00 00 00 00 00 00
14 05 00 00 0D 0C C0 00 6C 07 00 00 02 0D 40 00
14 05 00 00 1D 0E C0 00 00 00 00 00 00 00 00 00


Let's look at the first record of the table to show you how to read it.

Code: Select all

14 05 00 00 07 01 40


Each record in the table is conformed by 6 fields:
  1. First field of the record corresponds to the first 2 bytes, in this case, 14 05. We need to read it from right to left though, i.e., 0514.
  2. Second and third fields correspond to the 3rd and 4th bytes and both are 00.
  3. The 4th field is a number between 0-29 (decimal) associated to the 5th byte, 07 in this case. Of course in the table we are dealing with the hexadecimal representation.
  4. The fifth field is the record number, 1 for the first record and so on. It is associated to the 6th byte.
  5. Finally, the sixth field can take one of 2 values only, C0 or 40. Then, we have a 00. Following two bytes correspond to the first field value of next record and so on until the last one.

It would be great if anyone could help me to extract/transform each table from my sample into something more natural to work with (I mean, more natural for humans). For example, a kind of editor for this file or a way to extract a file for each table. Of course decimal numbers instead of hexadecimal would be perfect.

Thanks.