and the encryption itself is fairly simple. The encryption
itself is a simple Xor routine and ill show you how you
can use that. However, i dont know yet how the
client currently is Creating the Xortable. Luckily
the Xortable is always at the same address
you can find the base Address in the Function call one
Call above the Send call. The start of that Function
looks like this ( Shaiya Encryption function ):
Code:
CMP BYTE PTR DS:[2242E21],0 E SHORT game.004010DF CMP DWORD PTR DS:[2242E18],0 JNZ SHORT game.004010CA MOV EAX,DWORD PTR SS:[ESP+8] PUSH ESI PUSH EAX MOV EAX,DWORD PTR SS:[ESP+C] MOV ECX,EAX MOV ESI,game.02242E28 CALL game.004051B0
This line is currently intresting for us. It moves the
base Address of the Xortable into ESI. So 0x2242E28 would
be the address. This Address + 0x104 is currently a
Packetcounter. This Counter is also used for the Encryption.
The Xortable starts at Xortable base address + 0x108.
So we have the following Addresses for our Encryption function:
0x2242F2C = Packetcounter
0x2242F30 = Xortable start
Now we can use the following function to
Encrypt our Packets:
Code:
int packetcounter = 0x2242F2C;
int Xortable = 0x2242F30;
char* encryptpacket( char * packet )
{
int encryptcounter = *(int*)packetcounter;
// ( how many packets have been encrypted yet )
for( int i = 0; i < packetsize; ++i )
{
packet[i] ^= *(char*)( XorTable + i + 108 + encryptcounter );
}
encryptcounter += 1;
*(int*)packetcounter = encryptcounter;
return packet;
}
You can only use this Function after you have at least send
one Loginpacket ( this are the first Packets that gets encryted ).
Simply because when the First Packet is to be sent but the
Xortable isnt created yet, the Client will create it and encrypt the
Packet. I might be wrong at any point, i did not test this yet,
i was just bored and took a look at it with OllyDBG
regards
Wurstbrot123






