I'm reversing this game and got stuck. To make it simple, You have some amount of coins in the game (float
or double
) and you can spend it on some things. I started sniffing network traffic and noticed that with different amount of coins, only 2 bytes change.
I've bought different amount of coins and copied those two bytes:
(5)
1111 0100 0000 0011 (F4 03)
---------------------------
(6)
1101 1000 0000 0100 (D8 04)
---------------------------
(7)
1011 1100 0000 0101 (BC 05)
---------------------------
(8)
1010 0000 0000 0110 (A0 06)
---------------------------
(9)
1000 0100 0000 0111 (84 07)
---------------------------
(10)
1110 1000 0000 0111 (E8 07)
(11)
1100 1100 0000 1000 (CC 08)
---------------------------
(12)
1011 0000 0000 1001 (B0 09)
---------------------------
(13)
1001 0100 0000 1010 (94 0a)
---------------------------
(14)
1111 1000 0000 1010 (F8 0a)
---------------------------
(15)
1101 1100 0000 1011 (DC 0B)
---------------------------
(16)
1100 0000 0000 1100 (C0 0C)
---------------------------
(17)
1010 0100 0000 1101 (A4 0D)
---------------------------
(18)
1000 1000 0000 1110 (88 0E)
---------------------------
(19)
1110 1100 0000 1110 (EC 0E)
---------------------------
(20)
1101 0000 0000 1111 (D0 0F)
First line represents the amount of coins that I have, and the second is it's corresponding bytes in hex from wireshark. I don't know which encoding method is used for this. Maybe someone has some experience and knows the algorithm behind it. Thanks.
Update
8
1010 0000 0000 0110 (A0 06)
-----------------------------
16
1100 0000 0000 1100 (C0 0C)
--------------------------
256
1100 1000 0000 0001 (C8 01)
----------------------------
512
1001 0000 0000 0011 (90 03)
-----------------------------
2048
1100 0000 0000 1100 (C0 0C)
----------------------------
4096
1000 0000 0001 1001 (80 19)
-----------------------------
8192
1000 0000 0011 0010 (80 32)
------------------------------
Notice that 2048
and 16
have same code. I can't understand why this happened, how does it differentiate 16
and 2048
?
Different amount of coins can be spend in different rooms, for example 8
and 16
are spend in one room, it has maximum limit of 30
. 256
and 512
on room number two and the rest in the room number three. When I enter into a room with different amount of coins all I'm looking is the differences between bytes in the same room, different rooms have different bytes in them which as I understand describe the room itself. Is it possible that I'm missing some bytes?
But when I enter room number three with different coins 2048
4096
8192
these are the only bytes that are changing.
UPDATE 2
64 - 00110010
128 - 01100100
1024 - 1010000000000110
So we have
8 1010000000000110
16 1100000000001100
32 ?
64 00110010
128 01100100
256 1100100000000001
512 1001000000000011
1024 1010000000000110
2048 1100000000001100
4096 1000000000011001
8192 1000000000110010
I can't get 32
since I could not enter none of the rooms with that value.
300
isb0 ea
(Can't get1
coin since minimal value is 5) The values are not integers since I can havefloat
s too, I assume that even integer values like 1, 2, 3... are represented as floats 1.0, 2.0 3.0 etc.