Member
Packet decoding on NA patch?
Hey all,
I noticed yesterdays patch added some encryption on NA packets. Has anyone gotten around to deciphering it yet? It doesn't seem as complex as the Russian encryption it seems to only change 2 bytes out of every 4.
IE: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 becomes cb 02 00 00 92 02 00 00 59 02 00 00 20 02 00.
Here is the code the Russians are using for their client:
Code:
byte Inline(ref uint cry)
{
cry += 3532013U;
byte n = (byte)(cry >> 16);
return (byte)(((int)n == 0) ? 254 : n);
}
byte[] CtoSDecrypt(byte[] BodyPacket, uint UnkKey)
{
byte[] Array = new byte[BodyPacket.Length];
uint cry = (uint)((ulong)UnkKey + (ulong)BodyPacket.Length) * UnkKey ^ 1973428001u;
int n = 4 * (BodyPacket.Length / 4);
for (int i = n - 1; i >= 0; i--)
Array[i] = (byte)((uint)BodyPacket[i] ^ (uint)Inline(ref cry));
for (int i = n; i < BodyPacket.Length; i++)
Array[i] = (byte)((uint)BodyPacket[i] ^ (uint)Inline(ref cry));
return Array;
}
byte[] StoCDecrypt(byte[] BodyPacket)
{
byte[] Array = new byte[BodyPacket.Length];
uint cry = (uint)(BodyPacket.Length ^ 522286496);
int n = 4 * (BodyPacket.Length / 4);
for (int i = n - 1; i >= 0; i--)
Array[i] = (byte)((uint)BodyPacket[i] ^ (uint)Inline(ref cry));
for (int i = n; i < BodyPacket.Length; i++)
Array[i] = (byte)((uint)BodyPacket[i] ^ (uint)Inline(ref cry));
return Array;
}
From what I understand the key to decrypt the messages from the server to client is static and the key to encrypt a message to the server changes every time. The current bot programs watch the packets when a buff is cast and gets the current key. They then use this key to do stuff while blocking that buff command to the server.
Anyone care to adapt this to NA?
Thanks!
These ads disappear when you log in.