3

I am currently trying to reverse engineer a proprietary serialization format. In some of the sections the encoding is unknown to me. What I was able to figure out:

  • 1 byte 0b00?????? "6bit signed int" (0x00 = 0, 0x3F = 63, 0x40 = -64, 0x7F = -1)
  • 2 byte 0xC? 0x?? "12 bit signed int" (0xC0 0x40 = 64, 0xC7 0xFF = 2047, 0xC8 0x00 = -2048, 0xCF 0xBF = -65)
  • 3 byte 0xD? 0x?? 0x?? "20bit signed int"
  • 4 byte 0xE? 0x?? 0x?? 0x?? "28bit signed int"

Everything big endian, btw.

  • Strings seem to be 0xF3 ... 0x00

Does somebody know/recognize this encoding?

3
  • LEB128 is a weird variable length format that uses high bits to signal if you should use the next byte or terminate. Posting the language can be helpful, as some standard encodings are used in different languages. – douggard Dec 6 '16 at 18:03
  • @douggard Well, it's not LEB128. Even your description doesn't match my description above. – Manuel Kasten Dec 11 '16 at 12:36
  • Sorry, your description wasn't very clear. – douggard Dec 11 '16 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.