Packet Decryption for 2Moons

11/27/2008 20:30 I_Mystic_I#16
They are functions created in c++ to decrypt the encrypted packet data and to encrypt the packet data you want to send. If you still dont kno what to do ill put up examples for you guys...
11/27/2008 20:52 Systemerror#17
Well, I did try stuff in c++, but in the end I still got nowhere :( Hope, I'm nothing bothering you too much though. I'm sure all the others got it working proper.
11/28/2008 19:27 wln6672#18
i know it's C++ but i have no idea how to use it? make a program with it? maybe i try to figure it out and thanks for a lesson. :P
11/28/2008 19:50 xhugox#19
Thanks for this thing Mystic.

Mystic released the decryption/encryption operation of 2moons, we still need to get the packets from the game, run it through this functions and read/send it then.

So we need either create a proxy or a attach to 2moons with a selfmade program to get this data.
11/29/2008 21:23 I_Mystic_I#20
Here is a quick example that i threw together.


Code:
// Encrypted Data Recved From Server
unsigned char PacketData[] = { 0x0B, 0x41, 0x57, 0xCE, 0x16, 0x80, 0x3A, 0xEC, 0x3D, 0xAB, 0x11, 0x87, 0x24, 0xB0, 0x08, 0x1F, 0x62, 0x0F, 0x36, 0x99, 0x72, 0xE7, 0x10, 0xB4, 0x3A, 0xC7, 0xC7, 0x10, 0x14, 0x2F, 0xAD, 0xF8, 0xC7, 0x51, 0xEB, 0x7D, 0xDE, 0x48, 0xF2, 0x64, 0xF5, 0x63, 0xD9, 0x4F, 0xEC, 0x7A, 0xC0, 0x56, 0xA3, 0x35, 0x8F, 0x19, 0xBA, 0x2C, 0x96, 0x00, 0x91, 0x07, 0xBD, 0x2B, 0x88, 0x1E, 0xA4, 0x32 };

// Buffer For The Decrypted Data
unsigned char * DecryptedData;
DecryptedData = new unsigned char[sizeof(PacketData)];

// Decrypt The Data And Place It Into The DecryptedData Buffer
DecryptData(PacketData, DecryptedData, sizeof(PacketData));

// Encrypt The DecryptedData Buffer 
EncryptData(DecryptedData, sizeof(DecryptedData)-4, 0x0F);

***Notes***
- The FlagByte argument in the EncryptData() function is set to 0x0F when you send your first packet to the server. Which should be the packet with the opcode of 0x80000200. After that you should receive a packet with the opcode of 0x81000200. This is where the FlagByte changes when you pull two bytes out of this packet and ^(XOR) them together. You use the value you receive from ^'ing those bytes together and use it as your FlagByte.