0

I am manually parsing a database file and came across something odd. I have my row length and offset. The database seems to be fixed width columns delimited by 00 values - mostly, it isn't a hard and fast rule it seems.

I am able to get the correct ID numbers from Bill, Bob and John, but Joe's ID isn't coming back to me correctly and hoping someone can shed some light on it. Here is the data

00 00 00 00 0D C3 A6 12 C3 A6 6D 06 64 00 65 00 09 7B 0E 00  Bill
00 E2 80 A2 C3 A3 C3 A1 C3 A5 4F 06 64 00 65 00 11 41 04 00  Bob
10 C3 A4 C2 B9 C3 AF 5A 04 64 00 65 00 E2 80 A6 C3 95 0F 00  Joe
00 00 31 C3 A4 4B C3 AA E2 80 A6 03 64 00 65 00 4F 5B 17 00  John

For the ones that work, it is the numbers at the end separated by 00s, so Bill's would be 09 7B 0E.

If I use that in the Hex Converter here: https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ I get the right ID of 949001, same with Bob and John.

I am new to all these new numbering systems with Endianness and figured maybe there was another one I am missing that could convert E2 80 A6 C3 95 0F somehow to 1037701 which is the right one for Joe. I have tried taking just the last 3, last two, middle sections, reversing order...

Alan
  • 2,046
  • 2
  • 20
  • 43
  • Weird. Going by what you've discovered this is Little Endian. Bob's ID is `278801` and John's is `1530703`. So `1037701` as a 32-bit unsigned or signed integer would have to look like `85 D5 0F 00`, but there is no such pattern in the data you posted (actually, there is no 85 or D5 at all). `C3 95 0F 00` is `1021379`, which is closer to the other IDs although not preceded by `00` Are you absolutely sure of the data you pasted above here? – s.m. Sep 25 '18 at 15:40
  • One thing I'm noticing (and you sure have noticed too) is that each record seems to have the group `64 00 65 00` preceding the interesting part, but Joe's is offset by 3 places to the left. Not that this solves the issue, but hey. – s.m. Sep 25 '18 at 15:45
  • This is really weird, I am not sure where that corrupted data came from. I went back to the original files and the ID # is correct there. My editor / visualizer does some basic alignment, but not much editing of bytes... https://youtu.be/3-1CukxNWQY – Alan Sep 25 '18 at 18:11

0 Answers0