Exemple #1
0
        public static void HandleSetTimezoneInformation(ref WorldClass session)
        {
            PacketWriter packetWriter = new PacketWriter(ServerMessage.SetTimeZoneInformation, true);

            while (true)
            {
IL_CE:
                uint arg_AE_0 = 935220141u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_AE_0 ^ 259876853u)) % 5u)
                    {
                    case 0u:
                    {
                        string text;
                        packetWriter.WriteString(text, true);
                        arg_AE_0 = (num * 2656952854u ^ 2225828889u);
                        continue;
                    }

                    case 1u:
                    {
                        BitPack arg_66_0 = new BitPack(packetWriter, 0uL, 0uL, 0uL, 0uL);
                        string  text     = Module.smethod_34 <string>(1790255161u);
                        arg_66_0.Write <int>(TimeHandler.smethod_0(text), 7);
                        arg_66_0.Write <int>(TimeHandler.smethod_0(text), 7);
                        arg_66_0.Flush();
                        arg_AE_0 = (num * 1324747197u ^ 2173534419u);
                        continue;
                    }

                    case 3u:
                        goto IL_CE;

                    case 4u:
                    {
                        string text;
                        packetWriter.WriteString(text, true);
                        session.Send(ref packetWriter);
                        arg_AE_0 = (num * 3452712060u ^ 2771268710u);
                        continue;
                    }
                    }
                    return;
                }
            }
        }
        public static void HandleAuthResponse(ref PacketReader packet, WorldClass session)
        {
            BitUnpack arg_28_0 = new BitUnpack(packet);

            packet.Skip(23);
            Globals.ClientSalt = packet.ReadBytes(16u);
            packet.ReadBytes(24u);
            arg_28_0.GetBit();
            packet.ReadBytes(AuthenticationHandler.smethod_1(packet));
            while (true)
            {
IL_921:
                uint arg_82F_0 = 2017539580u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_82F_0 ^ 973532324u)) % 57u)
                    {
                    case 0u:
                        TimeHandler.HandleSetTimezoneInformation(ref session);
                        arg_82F_0 = (num * 3644867839u ^ 4102176202u);
                        continue;

                    case 1u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 3925958146u ^ 429357566u);
                        continue;
                    }

                    case 2u:
                    {
                        BitPack bitPack;
                        bitPack.Flush();
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 3843609867u ^ 274333066u);
                        continue;
                    }

                    case 3u:
                    {
                        PacketWriter packetWriter;
                        byte[,] array;
                        int num2;
                        packetWriter.WriteUInt8(array[num2, 1]);
                        arg_82F_0 = (num * 2139226297u ^ 222787957u);
                        continue;
                    }

                    case 4u:
                    {
                        int num3 = 0;
                        arg_82F_0 = (num * 1275993637u ^ 3289780354u);
                        continue;
                    }

                    case 5u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        BitPack bitPack;
                        bool    flag;
                        bitPack.Write <bool>(flag);
                        bool bit;
                        bitPack.Write <bool>(bit);
                        bitPack.Flush();
                        arg_82F_0 = (num * 190331667u ^ 3544293151u);
                        continue;
                    }

                    case 6u:
                    {
                        PacketWriter packetWriter;
                        int          num3;
                        byte[,] array2;
                        packetWriter.WriteUInt8(array2[num3, 0]);
                        arg_82F_0 = 979003297u;
                        continue;
                    }

                    case 7u:
                    {
                        SHA256Managed hashAlgorithm_;
                        byte[]        array3;
                        AuthenticationHandler.smethod_4(hashAlgorithm_, array3, array3.Length >> 1, array3.Length - (array3.Length >> 1));
                        SHA256Managed hashAlgorithm_2;
                        SHA256Managed hashAlgorithm_3;
                        AuthenticationHandler.smethod_3(hashAlgorithm_2, AuthenticationHandler.smethod_5(hashAlgorithm_3), 0, 32, AuthenticationHandler.smethod_5(hashAlgorithm_3), 0);
                        arg_82F_0 = (num * 4247721102u ^ 2164875264u);
                        continue;
                    }

                    case 8u:
                        goto IL_921;

                    case 9u:
                    {
                        int num3;
                        byte[,] array2;
                        arg_82F_0 = ((num3 < AuthenticationHandler.smethod_9(array2) / 2) ? 942732371u : 402681424u);
                        continue;
                    }

                    case 10u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 1272726928u ^ 3573012072u);
                        continue;
                    }

                    case 11u:
                    {
                        int num4;
                        arg_82F_0 = ((num4 != 32) ? 1613600137u : 94715230u);
                        continue;
                    }

                    case 12u:
                    {
                        SHA256Managed hashAlgorithm_;
                        SHA256Managed hashAlgorithm_2;
                        AuthenticationHandler.smethod_4(hashAlgorithm_2, AuthenticationHandler.smethod_5(hashAlgorithm_), 0, 32);
                        AuthenticationHandler.sha2_3_grml = AuthenticationHandler.smethod_5(hashAlgorithm_2);
                        int num4 = 0;
                        int num5 = 0;
                        arg_82F_0 = (num * 1594528258u ^ 4035022218u);
                        continue;
                    }

                    case 13u:
                        arg_82F_0 = (num * 3592674904u ^ 3437742173u);
                        continue;

                    case 14u:
                        AuthenticationHandler.HandleConnectTo(session, 3724, 1, null);
                        arg_82F_0 = (num * 4096365546u ^ 2720471261u);
                        continue;

                    case 15u:
                    {
                        bool         bit          = false;
                        PacketWriter packetWriter = new PacketWriter(ServerMessage.AuthResponse, true);
                        arg_82F_0 = (num * 1668503324u ^ 4008787019u);
                        continue;
                    }

                    case 16u:
                    {
                        int num4;
                        arg_82F_0 = ((num4 < 40) ? 1976385685u : 1159001732u);
                        continue;
                    }

                    case 17u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 3445906520u ^ 4063066220u);
                        continue;
                    }

                    case 18u:
                    {
                        BitPack bitPack;
                        bitPack.Write <int>(0);
                        bitPack.Write <int>(0);
                        arg_82F_0 = (num * 621848300u ^ 3406194050u);
                        continue;
                    }

                    case 19u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 3867729530u ^ 1908424397u);
                        continue;
                    }

                    case 20u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 1394835192u ^ 145004486u);
                        continue;
                    }

                    case 21u:
                    {
                        PacketWriter packetWriter;
                        byte[,] array2;
                        packetWriter.WriteInt32(AuthenticationHandler.smethod_9(array2) / 2);
                        byte[,] array;
                        packetWriter.WriteInt32(AuthenticationHandler.smethod_9(array) / 2);
                        arg_82F_0 = (num * 3125389306u ^ 6579303u);
                        continue;
                    }

                    case 22u:
                    {
                        byte[,] array;
                        int num2;
                        arg_82F_0 = ((num2 < AuthenticationHandler.smethod_9(array) / 2) ? 248887578u : 276684735u);
                        continue;
                    }

                    case 23u:
                    {
                        int num4;
                        num4++;
                        int num5;
                        num5++;
                        arg_82F_0 = (num * 2780937424u ^ 1515612061u);
                        continue;
                    }

                    case 24u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 192068700u ^ 4062459581u);
                        continue;
                    }

                    case 25u:
                    {
                        byte[,] expr_4C2 = new byte[12, 2];
                        AuthenticationHandler.smethod_8(expr_4C2, fieldof(< PrivateImplementationDetails >.struct7_0).FieldHandle);
                        byte[,] array    = expr_4C2;
                        byte[,] expr_4D7 = new byte[19, 2];
                        AuthenticationHandler.smethod_8(expr_4D7, fieldof(< PrivateImplementationDetails >.B1151C6C80B16E10C2CAD0E6524E20DB89985020).FieldHandle);
                        byte[,] array2 = expr_4D7;
                        arg_82F_0      = (num * 775829900u ^ 1086551519u);
                        continue;
                    }

                    case 26u:
                        Manager.WorldMgr.SendHotfixes(session);
                        arg_82F_0 = (num * 2297567052u ^ 3529457580u);
                        continue;

                    case 27u:
                    {
                        BitPack bitPack;
                        bitPack.Write <int>(0);
                        arg_82F_0 = (num * 2838081966u ^ 1401284309u);
                        continue;
                    }

                    case 28u:
                    {
                        BitPack bitPack;
                        bitPack.Write <int>(0);
                        arg_82F_0 = (num * 1276988104u ^ 1332711413u);
                        continue;
                    }

                    case 29u:
                        new PacketWriter(ServerMessage.EnableCrypt, false);
                        session.Account = new Account
                        {
                            Id               = 1,
                            Email            = Module.smethod_35 <string>(2737471542u),
                            PasswordVerifier = Module.smethod_36 <string>(1789483827u),
                            Salt             = Module.smethod_36 <string>(2533110280u),
                            IP               = "",
                            SessionKey       = "",
                            SecurityFlags    = 0,
                            OS               = Module.smethod_36 <string>(2605452825u),
                            Expansion        = 5,
                            IsOnline         = false
                        };
                        arg_82F_0 = (num * 3099364030u ^ 778753807u);
                        continue;

                    case 30u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt8(6);
                        arg_82F_0 = (num * 960037049u ^ 4251590658u);
                        continue;
                    }

                    case 31u:
                    {
                        int num3;
                        num3++;
                        arg_82F_0 = (num * 2647826660u ^ 3081572510u);
                        continue;
                    }

                    case 32u:
                    {
                        int num5 = 0;
                        arg_82F_0 = (num * 2855624283u ^ 1934999727u);
                        continue;
                    }

                    case 33u:
                    {
                        PacketWriter packetWriter;
                        session.Send(ref packetWriter);
                        arg_82F_0 = 394845639u;
                        continue;
                    }

                    case 34u:
                    {
                        PacketWriter packetWriter;
                        BitPack      bitPack = new BitPack(packetWriter, 0uL, 0uL, 0uL, 0uL);
                        arg_82F_0 = (num * 3839928679u ^ 2674270183u);
                        continue;
                    }

                    case 35u:
                    {
                        BitPack bitPack;
                        bitPack.Write <int>(0);
                        arg_82F_0 = (num * 1275983207u ^ 2624941272u);
                        continue;
                    }

                    case 36u:
                        new PacketWriter(ServerMessage.SuspendComms, true).WriteUInt32(20u);
                        arg_82F_0 = (num * 3412051023u ^ 3748987744u);
                        continue;

                    case 37u:
                    {
                        PacketWriter packetWriter;
                        byte[,] array;
                        int num2;
                        packetWriter.WriteUInt8(array[num2, 0]);
                        arg_82F_0 = 1152594217u;
                        continue;
                    }

                    case 38u:
                    {
                        BitPack bitPack;
                        bitPack.Write <int>(0);
                        arg_82F_0 = (num * 1357121348u ^ 1027085582u);
                        continue;
                    }

                    case 39u:
                    {
                        SHA256Managed hashAlgorithm_2 = AuthenticationHandler.smethod_6();
                        byte[]        array3;
                        SHA256Managed hashAlgorithm_3;
                        AuthenticationHandler.smethod_4(hashAlgorithm_3, array3, 0, array3.Length >> 1);
                        arg_82F_0 = (num * 3349724847u ^ 3826309419u);
                        continue;
                    }

                    case 40u:
                    {
                        bool flag = true;
                        arg_82F_0 = (num * 2469044217u ^ 389509509u);
                        continue;
                    }

                    case 41u:
                    {
                        int num4;
                        int num5;
                        AuthenticationHandler.sessionKey[num4] = AuthenticationHandler.sha2_3_grml[num5];
                        arg_82F_0 = 121248238u;
                        continue;
                    }

                    case 42u:
                    {
                        SHA256Managed hashAlgorithm_2;
                        AuthenticationHandler.sha2_3_grml = AuthenticationHandler.smethod_5(hashAlgorithm_2);
                        arg_82F_0 = (num * 3186781206u ^ 568291510u);
                        continue;
                    }

                    case 43u:
                    {
                        SHA256Managed hashAlgorithm_2;
                        AuthenticationHandler.smethod_7(hashAlgorithm_2);
                        SHA256Managed hashAlgorithm_3;
                        AuthenticationHandler.smethod_3(hashAlgorithm_2, AuthenticationHandler.smethod_5(hashAlgorithm_3), 0, 32, AuthenticationHandler.smethod_5(hashAlgorithm_3), 0);
                        arg_82F_0 = (num * 273351295u ^ 2423198895u);
                        continue;
                    }

                    case 44u:
                    {
                        PacketWriter packetWriter;
                        int          num3;
                        byte[,] array2;
                        packetWriter.WriteUInt8(array2[num3, 1]);
                        arg_82F_0 = (num * 3258273611u ^ 1239887723u);
                        continue;
                    }

                    case 46u:
                    {
                        HMACSHA256 expr_182 = AuthenticationHandler.smethod_2(Globals.SessionKey);
                        AuthenticationHandler.smethod_3(expr_182, Globals.ServerSalt, 0, Globals.ServerSalt.Length, Globals.ServerSalt, 0);
                        AuthenticationHandler.smethod_3(expr_182, Globals.ClientSalt, 0, Globals.ClientSalt.Length, Globals.ClientSalt, 0);
                        AuthenticationHandler.smethod_4(expr_182, AuthenticationHandler.arr1, 0, AuthenticationHandler.arr1.Length);
                        byte[]        array3          = AuthenticationHandler.smethod_5(expr_182);
                        SHA256Managed hashAlgorithm_3 = AuthenticationHandler.smethod_6();
                        SHA256Managed hashAlgorithm_  = AuthenticationHandler.smethod_6();
                        arg_82F_0 = (num * 1844584669u ^ 1891453460u);
                        continue;
                    }

                    case 47u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt32(0u);
                        arg_82F_0 = (num * 1008232628u ^ 30771472u);
                        continue;
                    }

                    case 48u:
                    {
                        int num2 = 0;
                        arg_82F_0 = (num * 1707978014u ^ 2368748458u);
                        continue;
                    }

                    case 49u:
                    {
                        SHA256Managed hashAlgorithm_2;
                        AuthenticationHandler.smethod_3(hashAlgorithm_2, AuthenticationHandler.sha2_3_grml, 0, 32, AuthenticationHandler.sha2_3_grml, 0);
                        SHA256Managed hashAlgorithm_;
                        AuthenticationHandler.smethod_4(hashAlgorithm_2, AuthenticationHandler.smethod_5(hashAlgorithm_), 0, 32);
                        arg_82F_0 = (num * 1428097193u ^ 1748239185u);
                        continue;
                    }

                    case 50u:
                    {
                        BitPack bitPack;
                        bitPack.Write <int>(0);
                        arg_82F_0 = (num * 2377469058u ^ 4212942142u);
                        continue;
                    }

                    case 51u:
                    {
                        SHA256Managed hashAlgorithm_2;
                        AuthenticationHandler.smethod_3(hashAlgorithm_2, AuthenticationHandler.sha2_3_grml, 0, 32, AuthenticationHandler.sha2_3_grml, 0);
                        arg_82F_0 = (num * 116417243u ^ 3699589835u);
                        continue;
                    }

                    case 52u:
                    {
                        bool flag;
                        arg_82F_0 = (((!flag) ? 1888186652u : 1737280166u) ^ num * 1515350310u);
                        continue;
                    }

                    case 53u:
                    {
                        PacketWriter packetWriter;
                        packetWriter.WriteUInt8(6);
                        arg_82F_0 = (num * 200448416u ^ 3957963237u);
                        continue;
                    }

                    case 54u:
                    {
                        BitPack bitPack;
                        bitPack.Flush();
                        arg_82F_0 = (num * 2761573231u ^ 325309565u);
                        continue;
                    }

                    case 55u:
                        arg_82F_0 = (num * 1571901877u ^ 4021021157u);
                        continue;

                    case 56u:
                    {
                        int num2;
                        num2++;
                        arg_82F_0 = (num * 3035465689u ^ 1114317311u);
                        continue;
                    }
                    }
                    return;
                }
            }
        }