So I have been a part of the forums for a long time and as we all do, we take breaks from the game to do life stuff but lately I've had some free time and decided to pick this project back up. I have always been interested in games communication and have done some work on it, but there are still some things I haven't figured out.
@guesswho-.- If you're still around let me know, I have a decent amount of freetime now rather than when I first PM'd you and hope you're still around to shed some light on this
I'll try to best explain what is going on. I am currently running that Sharingla 1-click and Client for my research. I was thinking of starting back at A3 though cause it may be simpler to work on and it's really about the nostalgia at this point.
1. Here is a MITM (or proxy) if some call it that. This was a "proxy" that was posted in the Conquer Online forums called (Pojerv Proxy) that I heavily modified to work with Dekaron. There are still a lot of things to improve on it, but that will come in due time. I have also built a C++ Console Application that mimics this for testing and to learn different skills.
[Only registered and activated users can see links. Click Here To Register...]
2. I believe I have things figured out for the most part using Zektors Encryption / Decryption that was posted some time ago. As far as my understanding goes:
3. Right now I am just trying to figure out the basics of the communications before I start trying to dive into the structure of each packet which leads me to the following things I don't know:
This is the part I am really stuck on because I don't know how the checksum is being calculated or if there is such thing as decrypting it properly. I have done tests where I encrypt the entire packet, swap the re-encrypted packet's checksum with the one initially received and everything is sent and received fine between the game and client. The moment I use the re-encrypted packet's checksum, the server nor client accepts it properly. This is where I am asking for help from those who have looked into this before if they are even still on the forums. Below is an example of what I am seeing.
================================================== ==================================================
The above is from my C++ helper application. Here is where it gets even weirder. Below is the same implementation but in C#
Here you can see that the packet has been encrypted properly include the calculated checksum. Between both examples the decrypted data is exactly the same but for the life of me I cannot narrow down why the checksum is completly different between the C# and C++ versions. To top it all off it seems like there is some randomness on the re-encrypted packets in the C# application. Sometimes it's good and sometimes it's not. I have no clue what I am missing.
Below you can see the output where I was checking if the packet checksum match the re-encrypted data.
The code for checking the checksum is pretty simple as it's just Take() is the first 4 bytes and returns a bool if it's equal to one another.
If you have stuck around this long, thanks for reading the post. If anyone has any information that they're willing to share please PM me. I know these days the forums are pretty dead and finding those who are interested in this is difficult vs those who are just looking for the latest files.
@guesswho-.- If you're still around let me know, I have a decent amount of freetime now rather than when I first PM'd you and hope you're still around to shed some light on this
I'll try to best explain what is going on. I am currently running that Sharingla 1-click and Client for my research. I was thinking of starting back at A3 though cause it may be simpler to work on and it's really about the nostalgia at this point.
1. Here is a MITM (or proxy) if some call it that. This was a "proxy" that was posted in the Conquer Online forums called (Pojerv Proxy) that I heavily modified to work with Dekaron. There are still a lot of things to improve on it, but that will come in due time. I have also built a C++ Console Application that mimics this for testing and to learn different skills.
[Only registered and activated users can see links. Click Here To Register...]
2. I believe I have things figured out for the most part using Zektors Encryption / Decryption that was posted some time ago. As far as my understanding goes:
- If the client is sending the initial packet which is 20080, it is encrypted with 0x19.
- The server will then respond with 20081 which is 64 bytes in length. The session key is then derived by (buffer[24] ^ buffer[28]) ^ 0x19. This packet should still be encrypted with key 0x19 but every other packet after that shouldn't be. The AuthServer is a little odd because it still seems like all the packets are 0x19 until the game server. I'm a little unsure if this is correct or not, but from my findings, doing it this way has always given me back the correct packet.
- When switching servers or going from login screen to getting in the game the same 2 packets are always sent as they are sort of the handshake for the session. The Session Key should change every time 20081 is sent to the client
3. Right now I am just trying to figure out the basics of the communications before I start trying to dive into the structure of each packet which leads me to the following things I don't know:
- There are times where the packet checksum is not correct. My understanding is, if the packet is decrypted properly and re-encrypted with the proper key, the checksum should be the same as the original packet. Please correct me if I am wrong here.
This is the part I am really stuck on because I don't know how the checksum is being calculated or if there is such thing as decrypting it properly. I have done tests where I encrypt the entire packet, swap the re-encrypted packet's checksum with the one initially received and everything is sent and received fine between the game and client. The moment I use the re-encrypted packet's checksum, the server nor client accepts it properly. This is where I am asking for help from those who have looked into this before if they are even still on the forums. Below is an example of what I am seeing.
================================================== ==================================================
Code:
PacketID: [50D0000] | PacketLength: [52]
0 1 2 3 4 5 6 7 8 9 A B C D E F
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0000 D1 EE 82 66 18 87 24 86 7F 68 77 37 3F A1 16 80 ...f..$..hw7?...
0016 34 E6 59 DF C2 82 9D 8A E7 41 8E 96 79 34 72 E4 4.Y......A..y4r.
0032 D9 4F F5 62 60 56 1F 7A EB DC D1 D1 EA 82 87 97 .O.b`V.z........
0048 FD C5 08 8D ....
0 1 2 3 4 5 6 7 8 9 A B C D E F
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0000 D0 79 AF DD 10 19 00 34 5C DD 78 AE 05 0D 00 00 .y.....4\.x.....
0016 41 05 00 10 AE 78 DD 5C A0 90 E5 6B 27 FC 00 00 A....x.\...k'...
0032 00 00 00 01 A0 00 F3 00 00 A1 16 80 18 E6 59 DF ..............Y.
0048 40 EE 99 8A [MENTION=321756]...[/MENTION]
0 1 2 3 4 5 6 7 8 9 A B C D E F
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0000 51 91 3C C2 18 87 24 86 7F 68 77 37 3F A1 16 80 Q.<...$..hw7?...
0016 34 E6 59 DF C2 82 9D 8A E7 41 8E 96 79 34 72 E4 4.Y......A..y4r.
0032 D9 4F F5 62 60 56 1F 7A EB DC D1 D1 EA 82 87 97 .O.b`V.z........
0048 FD C5 08 8D ....
Checksum does not match
o_checksum: D1 EE 82 66
n_checksum: 51 91 3C C2
Packet body is encrypted successfully
Code:
PacketID: [50D0000] | PacketLength: [52]
0 1 2 3 4 5 6 7 8 9 A B C D E F
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0000 D1 EE 82 66 18 87 24 86 7F 68 77 37 3F A1 16 80 ...f..$..hw7?...
0016 34 E6 59 DF C2 82 9D 8A E7 41 8E 96 79 34 72 E4 4.Y......A..y4r.
0032 D9 4F F5 62 60 56 1F 7A EB DC D1 D1 EA 82 87 97 .O.b`V.z........
0048 FD C5 08 8D ....
0 1 2 3 4 5 6 7 8 9 A B C D E F
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0000 D0 79 AF DD 10 19 00 34 5C DD 78 AE 05 0D 00 00 .y.....4\.x.....
0016 41 05 00 10 AE 78 DD 5C A0 90 E5 6B 27 FC 00 00 A....x.\...k'...
0032 00 00 00 01 A0 00 F3 00 00 A1 16 80 18 E6 59 DF ..............Y.
0048 40 EE 99 8A [MENTION=321756]...[/MENTION]
0 1 2 3 4 5 6 7 8 9 A B C D E F
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
0000 D1 EE 82 66 18 87 24 86 7F 68 77 37 3F A1 16 80 ...f..$..hw7?...
0016 34 E6 59 DF C2 82 9D 8A E7 41 8E 96 79 34 72 E4 4.Y......A..y4r.
0032 D9 4F F5 62 60 56 1F 7A EB DC D1 D1 EA 82 87 97 .O.b`V.z........
0048 FD C5 08 8D ....
Below you can see the output where I was checking if the packet checksum match the re-encrypted data.
Code:
[Send] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Recv] Packet [0x22000001] checksum is correct [Send] Packet [0x50D0001] checksum is correct [Recv] Packet [0x50D0000] checksum is correct [Recv] Packet [0x5040000] checksum is not correct [Recv] Packet [0x5040000] checksum is not correct [Send] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0000] checksum is not correct [Recv] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0002] checksum is not correct [Send] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Send] Packet [0xE010002] checksum is correct [Recv] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is not correct [Recv] Packet [0x50D0000] checksum is not correct [Send] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0002] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0002] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Send] Packet [0xE010002] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is not correct [Send] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is correct [Send] Packet [0x50D0000] checksum is correct [Recv] Packet [0x50D0000] checksum is correct
Code:
bool isChecksumCorrect = buffer.Take(4).SequenceEqual(encryptedBuffer.Take(4));
if (isChecksumCorrect)
WriteLine(string.Format("[Recv] Packet [0x{0:X2}] checksum is correct", getPacketID(decryptedBuffer)), ConsoleColor.Green);
else
WriteLine(string.Format("[Recv] Packet [0x{0:X2}] checksum is not correct", getPacketID(decryptedBuffer)), ConsoleColor.Red);