Example #1
0
        public static void HandleServerAddonsList(Packet packet)
        {
            // This packet requires _addonCount from CMSG_AUTH_SESSION to be parsed.
            if (_addonCount == -1)
            {
                packet.WriteLine("CMSG_AUTH_SESSION was not received - cannot successfully parse this packet.");
                packet.ReadToEnd();
                return;
            }

            for (var i = 0; i < _addonCount; i++)
            {
                packet.ReadByte("Addon State", i);

                var sendCrc = packet.ReadBoolean("Use CRC", i);

                if (sendCrc)
                {
                    var usePublicKey = packet.ReadBoolean("Use Public Key", i);

                    if (usePublicKey)
                    {
                        var pubKey = packet.ReadChars(256);
                        packet.Write("[{0}] Public Key: ", i);

                        foreach (var t in pubKey)
                            packet.Write(t.ToString(CultureInfo.InvariantCulture));
                    }

                    packet.ReadInt32("Unk Int32", i);
                }

                if (packet.ReadBoolean("Use URL File", i))
                    packet.ReadCString("Addon URL File", i);
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_8_9464))
            {
                var bannedCount = packet.ReadInt32("Banned Addons Count");

                for (var i = 0; i < bannedCount; i++)
                {
                    packet.ReadInt32("ID", i);

                    var unkStr2 = packet.ReadBytes(16);
                    packet.WriteLine("[{0}] Unk Hash 1: {1}", i, Utilities.ByteArrayToHexString(unkStr2));

                    var unkStr3 = packet.ReadBytes(16);
                    packet.WriteLine("[{0}] Unk Hash 2: {1}", i, Utilities.ByteArrayToHexString(unkStr3));

                    packet.ReadInt32("Unk Int32 3", i);

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
                        packet.ReadInt32("Unk Int32 4", i);
                }
            }
        }
Example #2
0
        public static void HandleServerAddonsList(Packet packet)
        {
            for (var i = 0; i < _addonCount; i++)
            {
                packet.ReadByte("Addon State");

                var sendCrc = packet.ReadBoolean("Use CRC");

                if (sendCrc)
                {
                    var usePublicKey = packet.ReadBoolean("Use Public Key");

                    if (usePublicKey)
                    {
                        var pubKey = packet.ReadChars(256);
                        packet.Writer.Write("Public Key: ");

                        foreach (var t in pubKey)
                            packet.Writer.Write(t);
                    }

                    packet.ReadInt32("Unk Int32");
                }

                var unkByte2 = packet.ReadBoolean("Use URL File");

                if (!unkByte2)
                    continue;

                packet.ReadCString("Addon URL File");
            }

            if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_0_8_9464))
            {
                var bannedCount = packet.ReadInt32("Banned Addons Count");

                for (var i = 0; i < bannedCount; i++)
                {
                    packet.ReadInt32("ID");

                    var unkStr2 = packet.ReadBytes(16);
                    packet.Writer.WriteLine("Unk Hash 1: " + Utilities.ByteArrayToHexString(unkStr2));

                    var unkStr3 = packet.ReadBytes(16);
                    packet.Writer.WriteLine("Unk Hash 2: " + Utilities.ByteArrayToHexString(unkStr3));

                    packet.ReadInt32("Unk Int32 3");

                    if (ClientVersion.AddedInVersion(ClientVersionBuild.V3_3_3a_11723))
                        packet.ReadInt32("Unk Int32 4");
                }
            }
        }