I'm trying to read an unknown type file (a save game file, I change the value and then see the file in Hex editor) !
And i want to read the integer values. I know where it is ! but the hex value is quite strange! I use Decimal here for easy understanding!
(byte-byte -> integer )
//128,63 -> 1 128 = 10000000 63=00111111
//0, 64 -> 2(10) 00000000-0100000064= 01000000
//64-64 -> 3(11) 01000000-01000000
//128-64 -> 4(100) 10000000-01000000
//160-64 -> 5(101) 160=10100000-01000000
//192-64 -> 6(110) 192=11000000-01000000
//224-64 -> 7(111) 11100000-01000000
//0-65 -> 8 (1000) 00000000-01000001
//16-65 -> 9(1001) 00010000-01000001
//32-65 ->10(1010) 00100000-01000001
//48-65 ->11(1011) 00110000-01000001
//64-65 ->12(1100) 01000000-01000001
//80-65 ->13(1101) 01010000-01000001
//96-65 ->14(1110) 01100000-01000001
//112-65 ->15(1111) 01110000-01000001
//128-65 ->16(10000) 10000000-01000001
//136-65 ->17(10001) 10001000-01000001
//144-65 ->18(10010) 10010000-01000001
//152-65 ->19(10011) 10011000-01000001
//160-65 ->20(10100) 10100000-01000001
//168-65 ->21(10101) 10101000-01000001
//176-65 ->22(10110) 10110000-01000001
//32-66 ->40(101000) 00100000-01000010
//48,64,80
//160-66 ->80(1010000) 10100000-01000010
//162-66 ->81(1010001) 10100010-01000010
//164-66 ->82(1010010) 10100100-01000010
(bigger values, int,int,int -> byte-byte )
//80,81,82 -> 160-66,162-66,164-66
//180,181,182 -> : 52-67,53-67,54-67
//20,21,22 -> 160 ,168 , 176 -65
//30,40,50 -> 240-65,248-65, 0-66 (3 integer -> 3 (2bytes))
//128-191 -> -1 10000000-10111111
//0-192 -> -2 00000000-11000000
//64-192 -> -3 01000000-11000000
The values is like above. It use 4 byte (but only 2 byte have values) . It seems that the left-most bit of 2nd byte are for Signed!
There is some rule , but i find it hard to figure out !
Thanks !