I added comments, if you still don't understand, look at my 2nd post.
Quote:
Originally Posted by scottdavey
Code:
public byte[] AuthResponse(string ip, byte[] key1, byte[] key2)
{
ushort PacketType = 0x41f;
byte[] Packet = new byte[32];
fixed (byte* p = Packet)
{
*((ushort*)p) = (ushort)Packet.Length; // *((ushort*)p) denotes that an unsigned short (the length of the packet: 32) is being written to the array at the index 0. WriteUInt16(32, Packet, 0); takes its place.
*((ushort*)(p + 2)) = (ushort)PacketType; // *((ushort*)(p + 2)) means that another unsigned short (the packet type: 1055 or 0x41f) is being written to the array at index 2. WriteUInt16(1055, Packet, 2); takes its place.
*(p + 4) = key2[3]; // key2 - is being written at index 4. The byte order of Conquer packets is Little Endian.
*(p + 5) = key2[2]; // key2 - has 4 bytes, therefore it is a 32 bit integer since 1 byte has 8 bits, but key2 and key1 are contained in byte arrays in this source. Others might just use 32 bit integers.
*(p + 6) = key2[1]; // key2 - notice that there is no presence of a data type (ex: (ushort*)), this means that a single byte is being written.
*(p + 7) = key2[0]; // key2 - "+ 7" denotes the offset that this element is being written to in the array.
*(p + 8) = key1[3]; // key1 is written just like key2.
*(p + 9) = key1[2]; // WriteUInt32(Key2, Packet, 4); and WriteUInt32(Key1, Packet, 8); would takes its places, but these are byte arrays, and not integers.
*(p + 10) = key1[1];
*(p + 11) = key1[0];
for (int i = 0; i < ip.Length; i++) // ip is a string, and this loop is converting each character in the string to a byte, and writing that byte to the packet array at index 12 + i for each character in the string. WriteString(ServerIP, Packet, 12); takes its place.
{
*(p + 12 + i) = Convert.ToByte(ip[i]);
}
*(p + 28) = 0xb8; // The port is hardcoded into this source at index 28 and 29. The port is a 16 bit unsigned integer (ushort), and there are 8 bits to a byte, therefore it takes 2 bytes to write the port to the array.
*(p + 29) = 0x16; // WriteUInt16(Port, Packet, 28); takes its place, but it could have also been written as *((ushort*)(p + 28)) = 5816 or 0x16b8;
}
return Packet;
}
/*public static byte[] AuthResponseEx(string ServerIP, uint Key1, uint Key2, ushort Port)
{
byte[] Packet = new byte[33];
WriteUInt16(32, Packet, 0);
WriteUInt16(1055, Packet, 2);
WriteUInt32(Key2, Packet, 4);
WriteUInt32(Key1, Packet, 8);
WriteString(ServerIP, Packet, 12);
WriteUInt16(Port, Packet, 28);
return Packet;
}*/
Quote:
Originally Posted by scottdavey
Obviously I will need to edit there encrypt thing I think.
If you see:
*(p + SOME_OFFSET) = SOME_BYTE;
Then use:
Packet[SOME_OFFSET] = SOME_BYTE;
If you see:
*((ushort*) (p + SOME_OFFSET)) = (ushort) SOME_USHORT;
The use:
WriteUInt16(SOME_USHORT, Packet, SOME_OFFSET);
If you see:
*((uint*) (p + SOME_OFFSET)) = (uint) SOME_UINT;
The use:
WriteUInt32(SOME_UINT, Packet, SOME_OFFSET);
If you see:
for (int i = 0; i < SOME_STRING.Length; i++)
{
*(p + SOME_OFFSET+ i) = Convert.ToByte(SOME_STRING[i]);
}
Then use:
WriteString(SOME_STRING, Packet, SOME_OFFSET);
If you see:
*(p + SOME_OFFSET) = SOME_STRING.Length;
for (int i = 0; i < SOME_STRING.Length; i++)
{
*(p + SOME_OFFSET + 1 + i) = Convert.ToByte(SOME_STRING[i]);
}
Then use:
WriteStringWithLength(SOME_STRING, Packet, SOME_OFFSET);
[QUESTION]How do i bypass Xtrap for any private server?[QUESTION] 10/12/2009 - Cabal Online - 3 Replies Exactly what the title says.
I keep on getting an xTrap error when i try and load ANY private server that uses XTrap and it's driving me absolutely insane.
I cant figure out why it's showing me the error. If anyone has any bypasser for Helix / PaRaDoX
or any other server u know that has xTrap can u either PM me the bypass or post it here pls......this is driving me nuts
Bump.
[QUESTION]How do i bypass Xtrap for any private server?[QUESTION] 10/02/2009 - Cabal Private Server - 2 Replies Exactly what the title says.
I keep on getting an xTrap error when i try and load ANY private server that uses XTrap and it's driving me absolutely insane.
I cant figure out why it's showing me the error. If anyone has any bypasser for Helix / PaRaDoX
or any other server u know that has xTrap can u either PM me the bypass or post it here pls......this is driving me nuts