mercredi 4 mai 2016

Converting binary data to numeric format

I am working with a set of data that is stored within a SQLite table in an (unknown) binary data format (BLOB type within the SQLite db), and I need to get it into corresponding numeric format. The data is quite simple (just a list of decimal format numbers, once translated from binary), and I have deduced a few things about the format so far. I also have an example of matched binary (hex) -> numeric data that I can work from (see below)

What is clear is that each number (I am assuming that the data is stored as a number and not as a string, but I may be wrong) is represented by 8 bytes (#0-7), but in all cases the first three bytes are null (0x00), while the last byte seems to be some kind of record termination (0x40). That leaves four bytes (#3-6) to represent the actual numeric data. Another thing that I've noticed is that the hexadecimal value of byte #6 seems to increase as the numeric value increases. I can't find any trends in the hex values of the other bytes.

Anyone have any ideas about what this format might be or how I might deduce it?

00 00 00 80 9F 68 49 40     50.8174
00 00 00 80 45 EC 49 40     51.8459
00 00 00 60 6A FF 49 40     51.9954
00 00 00 60 2D B1 4A 40     53.3842
00 00 00 00 61 04 4B 40     54.0342
00 00 00 60 00 28 4B 40     54.3125
00 00 00 20 8C 31 4B 40     54.3871
00 00 00 00 55 82 4B 40     55.0182
00 00 00 00 FD 86 4B 40     55.0546
00 00 00 C0 60 06 4C 40     56.0498
00 00 00 C0 88 7B 4C 40     56.9651
00 00 00 20 B8 03 4D 40     58.0291
00 00 00 80 C3 06 4D 40     58.0528
00 00 00 40 60 08 4D 40     58.0654
00 00 00 C0 9D 63 4D 40     58.7783
00 00 00 20 C3 87 4D 40     59.0606
00 00 00 00 66 BB 4D 40     59.4641
00 00 00 80 B7 4F 4E 40     60.6228
00 00 00 80 77 02 4F 40     62.0193
00 00 00 40 9E 09 4F 40     62.0751
00 00 00 20 19 50 4F 40     62.6258
00 00 00 80 1F 64 50 40     65.5644
00 00 00 80 B4 C3 50 40     67.0579
00 00 00 20 C5 D7 50 40     67.3714
00 00 00 60 DF D8 50 40     67.3886
00 00 00 60 26 42 51 40     69.0336
00 00 00 00 E9 68 51 40     69.6392
00 00 00 00 D8 02 52 40     72.0444
00 00 00 00 5E 04 52 40     72.0682
00 00 00 20 2C 05 52 40     72.0808
00 00 00 60 66 06 52 40     72.1000
00 00 00 E0 D1 41 52 40     73.0284
00 00 00 A0 2B 6E 52 40     73.7214
00 00 00 40 AB B3 52 40     74.8073
00 00 00 C0 C3 CD 52 40     75.2151
00 00 00 20 03 D6 52 40     75.3439
00 00 00 20 14 DC 52 40     75.4387
00 00 00 C0 F7 20 53 40     76.5151
00 00 00 C0 77 6B 53 40     77.6792
00 00 00 C0 2A 6B 54 40     81.6745
00 00 00 20 D7 81 54 40     82.0288
00 00 00 00 79 C5 54 40     83.0855
00 00 00 E0 45 00 56 40     88.0043
00 00 00 C0 7B 01 56 40     88.0232
00 00 00 E0 1F 40 56 40     89.0019
00 00 00 A0 9C 40 58 40     97.0096
00 00 00 40 B8 60 58 40     97.5112
00 00 00 C0 76 80 58 40     98.0072
00 00 00 40 D9 83 58 40     98.0601
00 00 00 20 C4 00 59 40     100.0120
00 00 00 40 8F 01 59 40     100.0244
00 00 00 00 D3 01 59 40     100.0285
00 00 00 C0 E0 01 59 40     100.0293
00 00 00 80 E6 01 59 40     100.0297
00 00 00 C0 83 02 59 40     100.0393
00 00 00 00 19 03 59 40     100.0484
00 00 00 80 2E 03 59 40     100.0497
00 00 00 E0 3B 03 59 40     100.0505
00 00 00 E0 3D 04 59 40     100.0663
00 00 00 E0 D7 04 59 40     100.0757
00 00 00 00 2C 07 59 40     100.1121
00 00 00 00 F3 80 5A 40     106.0148
00 00 00 60 CD C0 5A 40     107.0125

Aucun commentaire:

Enregistrer un commentaire