private static void WriteAddOnInfo(RealmPacketOut packet, ClientAddOn addOn)
        {
            packet.Write((byte)2);
            packet.Write(true);
            bool flag = addOn.AddOnCRC != 1276933997U;

            packet.Write(flag);
            if (flag)
            {
                packet.Write(ClientAddonHandler.BlizzardPublicKey);
            }
            packet.Write(0);
            packet.Write(false);
        }
Exemple #2
0
        private static void WriteAddOnInfo(RealmPacketOut packet, ClientAddOn addOn)
        {
            packet.Write((byte)AddOnType.Blizzard);
            packet.Write(true);

            // If the CRC32 of the addon's modulus doesnt match the CRC32 of the official blizzard public key
            // We could support
            bool hasDifferentPublicKey = (addOn.AddOnCRC != BlizzardAddOnCRC);

            packet.Write(hasDifferentPublicKey);
            if (hasDifferentPublicKey)
            {
                // This is actually the modulus used in the SSignature verification
                packet.Write(BlizzardPublicKey);
            }
            packet.Write(0);


            packet.Write(false);
        }
Exemple #3
0
        private static ClientAddOn ReadAddOn(BinaryReader binReader)
        {
            var name = binReader.ReadCString();

            if (binReader.BaseStream.Position + 9 > binReader.BaseStream.Length)
            {
                return(new ClientAddOn {
                    Name = name
                });
            }

            var addon = new ClientAddOn
            {
                Name         = name,
                HasSignature = binReader.ReadByte(),
                AddOnCRC     = binReader.ReadUInt32(),
                ExtraCRC     = binReader.ReadUInt32()
            };

            //Console.WriteLine("AddOn: {0} - {1} - {2} - {3}", addon.Name, addon.HasSignature, addon.AddOnCRC, addon.ExtraCRC);
            return(addon);
        }
        public static void SendAddOnInfoPacket(IRealmClient client)
        {
            using (RealmPacketOut packet = new RealmPacketOut(RealmServerOpCode.SMSG_ADDON_INFO))
            {
                if (client.Addons.Length > 0)
                {
                    int num1;
                    using (BinaryReader binReader = new BinaryReader((Stream) new MemoryStream(client.Addons)))
                    {
                        int num2 = binReader.ReadInt32();
                        for (int index = 0; index < num2; ++index)
                        {
                            ClientAddOn addOn = ClientAddonHandler.ReadAddOn(binReader);
                            ClientAddonHandler.WriteAddOnInfo(packet, addOn);
                        }

                        num1 = binReader.ReadInt32();
                    }

                    Console.WriteLine("CMSG ADDON Unk: " + (object)num1);
                }

                packet.Write(0);
                for (int index = 0; index < 0; ++index)
                {
                    packet.Write(0);
                    packet.Write(new byte[16]);
                    packet.Write(new byte[16]);
                    packet.Write(0);
                    packet.Write(0);
                }

                client.Send(packet, false);
            }

            client.Addons = (byte[])null;
        }
        private static ClientAddOn ReadAddOn(BinaryReader binReader)
        {
            var name = binReader.ReadCString();
            if (binReader.BaseStream.Position + 9 > binReader.BaseStream.Length)
            {
                return new ClientAddOn { Name = name };
            }

            var addon = new ClientAddOn
                            {
                                Name = name,
                                HasSignature = binReader.ReadByte(),
                                AddOnCRC = binReader.ReadUInt32(),
                                ExtraCRC = binReader.ReadUInt32()
                            };
            //Console.WriteLine("AddOn: {0} - {1} - {2} - {3}", addon.Name, addon.HasSignature, addon.AddOnCRC, addon.ExtraCRC);
            return addon;
        }
        private static void WriteAddOnInfo(RealmPacketOut packet, ClientAddOn addOn)
        {
            packet.Write((byte)AddOnType.Blizzard);
            packet.Write(true);

            // If the CRC32 of the addon's modulus doesnt match the CRC32 of the official blizzard public key
            // We could support
            bool hasDifferentPublicKey = (addOn.AddOnCRC != BlizzardAddOnCRC);
            packet.Write(hasDifferentPublicKey);
            if (hasDifferentPublicKey)
            {
                // This is actually the modulus used in the SSignature verification
                packet.Write(BlizzardPublicKey);
            }
            packet.Write(0);

            packet.Write(false);
        }