Ejemplo n.º 1
0
        public static void HandleAuthChallenge(ref PacketReader packet, WorldClass2 session)
        {
            session.initiated = true;
            PacketWriter packetWriter;

            while (true)
            {
IL_B5:
                uint arg_91_0 = 678710099u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_91_0 ^ 1840759029u)) % 6u)
                    {
                    case 1u:
                        AuthenticationHandler.smethod_0(packetWriter, AuthenticationHandler.clientSeed = new byte[16]);
                        AuthenticationHandler.smethod_0(packetWriter, AuthenticationHandler.serverSeed = new byte[16]);
                        arg_91_0 = (num * 1123221691u ^ 983032136u);
                        continue;

                    case 2u:
                        packetWriter = new PacketWriter(ServerMessage.AuthChallenge, false);
                        arg_91_0     = (num * 2546250082u ^ 4201805034u);
                        continue;

                    case 3u:
                        goto IL_B5;

                    case 4u:
                        AuthenticationHandler.smethod_0(packetWriter, new byte[16]);
                        arg_91_0 = (num * 1487317018u ^ 3313288268u);
                        continue;

                    case 5u:
                        packetWriter.WriteUInt8(1);
                        arg_91_0 = (num * 320817430u ^ 2502966289u);
                        continue;
                    }
                    goto Block_1;
                }
            }
Block_1:
            session.Send(ref packetWriter);
        }
Ejemplo n.º 2
0
        public static void HandleConnectTo(WorldClass session, ushort port = 3724, byte conn = 0, WorldClass2 session2 = null)
        {
            PacketWriter packetWriter = new PacketWriter(ServerMessage.ConnectTo, true);

            while (true)
            {
IL_65:
                uint arg_48_0 = 1189851645u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_48_0 ^ 117810876u)) % 4u)
                    {
                    case 0u:
                        goto IL_65;

                    case 1u:
                        packetWriter.WriteUInt64(12330219965770517405uL);
                        arg_48_0 = (num * 886289363u ^ 1599573856u);
                        continue;

                    case 3u:
                        packetWriter.WriteUInt32(14u);
                        arg_48_0 = (num * 798883457u ^ 2791294625u);
                        continue;
                    }
                    goto Block_1;
                }
            }
Block_1:
            RsaCrypt rsaCrypt = new RsaCrypt();

            try
            {
                rsaCrypt.InitializeEncryption <byte[]>(RsaStore.D, RsaStore.P, RsaStore.Q, RsaStore.DP, RsaStore.DQ, RsaStore.InverseQ, false);
                while (true)
                {
IL_53C:
                    uint arg_4A2_0 = 1950399364u;
                    while (true)
                    {
                        uint num;
                        switch ((num = (arg_4A2_0 ^ 117810876u)) % 35u)
                        {
                        case 0u:
                        {
                            byte[] array;
                            int    num2;
                            array[num2] = (byte)AuthenticationHandler.payloadOrder[num2];
                            arg_4A2_0   = 778837338u;
                            continue;
                        }

                        case 1u:
                        {
                            byte[] array2;
                            array2[10] = 0;
                            array2[11] = 0;
                            arg_4A2_0  = (num * 3426925493u ^ 1622493560u);
                            continue;
                        }

                        case 2u:
                        {
                            byte[] array2;
                            array2[18] = 0;
                            arg_4A2_0  = (num * 3672511218u ^ 2614652434u);
                            continue;
                        }

                        case 3u:
                        {
                            byte[] array2;
                            array2[0] = 67;
                            arg_4A2_0 = (num * 70935332u ^ 306833328u);
                            continue;
                        }

                        case 4u:
                        {
                            byte[] array2;
                            byte[] array3;
                            array2[22] = array3[1];
                            arg_4A2_0  = (num * 3674763274u ^ 3649142947u);
                            continue;
                        }

                        case 5u:
                        {
                            byte[] array2;
                            array2[13] = 0;
                            array2[14] = 0;
                            arg_4A2_0  = (num * 788135060u ^ 2778562157u);
                            continue;
                        }

                        case 6u:
                            goto IL_53C;

                        case 7u:
                        {
                            byte[] array2;
                            array2[1] = 253;
                            array2[2] = 184;
                            arg_4A2_0 = (num * 4034181865u ^ 116591846u);
                            continue;
                        }

                        case 8u:
                        {
                            byte[] array2;
                            array2[15] = 0;
                            array2[16] = 0;
                            arg_4A2_0  = (num * 1808574983u ^ 3232411455u);
                            continue;
                        }

                        case 9u:
                        {
                            byte[] array2 = new byte[255];
                            arg_4A2_0 = (num * 3052653591u ^ 3793484446u);
                            continue;
                        }

                        case 10u:
                            arg_4A2_0 = (num * 566048763u ^ 581218626u);
                            continue;

                        case 11u:
                        {
                            byte[] array2;
                            array2[233] = 42;
                            arg_4A2_0   = (num * 3199619518u ^ 4104188893u);
                            continue;
                        }

                        case 12u:
                        {
                            byte[] array2;
                            array2[5] = 127;
                            arg_4A2_0 = (num * 534924131u ^ 1301694869u);
                            continue;
                        }

                        case 13u:
                        {
                            byte[] array2;
                            array2[20] = 0;
                            byte[] array3 = AuthenticationHandler.smethod_10(port);
                            array2[21] = array3[0];
                            arg_4A2_0  = (num * 1558897694u ^ 577623817u);
                            continue;
                        }

                        case 14u:
                        {
                            byte[] array2;
                            array2[6] = 0;
                            arg_4A2_0 = (num * 1594444616u ^ 3121916550u);
                            continue;
                        }

                        case 15u:
                        {
                            byte[] array2;
                            AuthenticationHandler.smethod_13(new byte[0].GenerateRandomKey(20), 0, array2, 234, 20);
                            arg_4A2_0 = (num * 1673846917u ^ 3902196868u);
                            continue;
                        }

                        case 16u:
                        {
                            byte[] expr_2B6 = new byte[32];
                            AuthenticationHandler.smethod_8(expr_2B6, fieldof(< PrivateImplementationDetails >.struct8_0).FieldHandle);
                            byte[] array2;
                            AuthenticationHandler.smethod_13(expr_2B6, 0, array2, 93, 32);
                            AuthenticationHandler.smethod_13(new byte[108], 0, array2, 125, 108);
                            arg_4A2_0 = (num * 3680003173u ^ 2041052791u);
                            continue;
                        }

                        case 17u:
                        {
                            byte[] array2;
                            Array  arg_297_0 = rsaCrypt.Encrypt <byte[]>(array2, false);
                            byte[] array4    = new byte[256];
                            AuthenticationHandler.smethod_14(arg_297_0, array4, 256);
                            arg_4A2_0 = (num * 2289352343u ^ 161977499u);
                            continue;
                        }

                        case 18u:
                        {
                            int num2;
                            num2++;
                            arg_4A2_0 = 1213188245u;
                            continue;
                        }

                        case 19u:
                        {
                            rsaCrypt.InitializeDecryption <byte[]>(RsaStore.Exponent, RsaStore.Modulus, false);
                            byte[] array = new byte[AuthenticationHandler.payloadOrder.Length];
                            arg_4A2_0 = (num * 163108824u ^ 2004099280u);
                            continue;
                        }

                        case 20u:
                        {
                            byte[] array2;
                            array2[7] = 0;
                            arg_4A2_0 = (num * 669897089u ^ 3823184314u);
                            continue;
                        }

                        case 21u:
                        {
                            int num2 = 0;
                            arg_4A2_0 = (num * 1178352322u ^ 2056709069u);
                            continue;
                        }

                        case 22u:
                        {
                            string string_ = Module.smethod_35 <string>(848950031u);
                            arg_4A2_0 = (num * 560797187u ^ 1592203457u);
                            continue;
                        }

                        case 23u:
                            packetWriter.WriteUInt8(conn);
                            arg_4A2_0 = (num * 264353632u ^ 1806577887u);
                            continue;

                        case 24u:
                        {
                            int num2;
                            arg_4A2_0 = ((AuthenticationHandler.payloadOrder[num2] <= 16) ? 423310451u : 557178527u);
                            continue;
                        }

                        case 25u:
                        {
                            byte[] array2;
                            array2[3] = 34;
                            array2[4] = 1;
                            arg_4A2_0 = (num * 4152105185u ^ 2192753377u);
                            continue;
                        }

                        case 26u:
                        {
                            byte[] array;
                            int    num2;
                            array[num2] = (byte)(AuthenticationHandler.payloadOrder[num2] - 3);
                            arg_4A2_0   = (num * 3507665298u ^ 2968893570u);
                            continue;
                        }

                        case 27u:
                        {
                            byte[] array2;
                            array2[12] = 0;
                            arg_4A2_0  = (num * 618037152u ^ 1046649983u);
                            continue;
                        }

                        case 28u:
                        {
                            byte[] array2;
                            array2[19] = 0;
                            arg_4A2_0  = (num * 1680293565u ^ 2487070996u);
                            continue;
                        }

                        case 29u:
                        {
                            int num2;
                            arg_4A2_0 = ((num2 >= AuthenticationHandler.payloadOrder.Length) ? 858439922u : 70439534u);
                            continue;
                        }

                        case 30u:
                        {
                            byte[] array4;
                            AuthenticationHandler.smethod_0(packetWriter, array4);
                            arg_4A2_0 = (num * 216092153u ^ 2688375690u);
                            continue;
                        }

                        case 31u:
                        {
                            byte[] array2;
                            array2[8] = 1;
                            array2[9] = 0;
                            arg_4A2_0 = (num * 3445269463u ^ 748842564u);
                            continue;
                        }

                        case 33u:
                        {
                            byte[] array2;
                            array2[17] = 0;
                            arg_4A2_0  = (num * 40612712u ^ 3030126910u);
                            continue;
                        }

                        case 34u:
                        {
                            byte[] array2;
                            string string_;
                            AuthenticationHandler.smethod_13(AuthenticationHandler.smethod_12(AuthenticationHandler.smethod_11(), string_), 0, array2, 23, 71);
                            arg_4A2_0 = (num * 376848159u ^ 536405427u);
                            continue;
                        }
                        }
                        goto Block_7;
                    }
                }
                Block_7 :;
            }
            finally
            {
                if (rsaCrypt != null)
                {
                    while (true)
                    {
                        IL_57F :
                        uint arg_566_0 = 461746135u;
                        while (true)
                        {
                            uint num;
                            switch ((num = (arg_566_0 ^ 117810876u)) % 3u)
                            {
                            case 0u:
                                goto IL_57F;

                            case 2u:
                                AuthenticationHandler.smethod_15(rsaCrypt);
                                arg_566_0 = (num * 3554924306u ^ 496472224u);
                                continue;
                            }
                            goto Block_10;
                        }
                    }
                    Block_10 :;
                }
            }
            if (session2 == null)
            {
                goto IL_5B1;
            }
IL_58A:
            int arg_594_0 = 202372283;

IL_58F:
            switch ((arg_594_0 ^ 117810876) % 4)
            {
            case 0:
IL_5B1:
                session.Send(ref packetWriter);
                arg_594_0 = 910700601;
                goto IL_58F;

            case 2:
                goto IL_58A;

            case 3:
                session2.Send(ref packetWriter);
                return;
            }
        }