Skip to content

Instantly share code, notes, and snippets.

@fredimachado
Created January 19, 2012 00:36
Show Gist options
  • Save fredimachado/1636773 to your computer and use it in GitHub Desktop.
Save fredimachado/1636773 to your computer and use it in GitHub Desktop.
4.2.2 14545
// Handler: 6C7260 - http://paste2.org/p/1874034
[Parser(Opcode.TEST_422_13022, ClientVersionBuild.V4_2_2_14545)]
public static void Handle13022(Packet packet)
{
var bytes = new byte[8];
bytes[0] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[4] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[5] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[1] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[6] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[3] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[7] = (byte)(packet.ReadBit() ? 1 : 0);
bytes[2] = (byte)(packet.ReadBit() ? 1 : 0);
if (bytes[2] != 0) bytes[2] ^= packet.ReadByte();
if (bytes[4] != 0) bytes[4] ^= packet.ReadByte();
if (bytes[7] != 0) bytes[7] ^= packet.ReadByte();
if (bytes[0] != 0) bytes[0] ^= packet.ReadByte();
packet.ReadSingle("Unk float");
if (bytes[5] != 0) bytes[5] ^= packet.ReadByte();
if (bytes[1] != 0) bytes[1] ^= packet.ReadByte();
if (bytes[6] != 0) bytes[6] ^= packet.ReadByte();
if (bytes[3] != 0) bytes[3] ^= packet.ReadByte();
packet.Writer.WriteLine("GUID: {0}", new Guid(BitConverter.ToUInt64(bytes, 0)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment