示例#1
0
        public void WriteString(string data, int bits, bool isCString = true, int additionalCount = 0)
        {
            byte[] array = AuthPacket.smethod_42(AuthPacket.smethod_12(), data);
            while (true)
            {
IL_BA:
                uint arg_92_0 = 88256940u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_92_0 ^ 1145632018u)) % 7u)
                    {
                    case 1u:
                        this.Write <int>(array.Length + additionalCount, bits);
                        arg_92_0 = (num * 3933157738u ^ 3858785379u);
                        continue;

                    case 2u:
                        this.Flush();
                        arg_92_0 = 1411661349u;
                        continue;

                    case 3u:
                        this.Write <byte[]>(array);
                        arg_92_0 = (num * 3707020536u ^ 2244404174u);
                        continue;

                    case 4u:
                        goto IL_BA;

                    case 5u:
                        arg_92_0 = (((!isCString) ? 3123080973u : 3522398342u) ^ num * 866731608u);
                        continue;

                    case 6u:
                        this.Write <byte[]>(new byte[1]);
                        arg_92_0 = (num * 4187764293u ^ 4101948329u);
                        continue;
                    }
                    return;
                }
            }
        }
示例#2
0
        public AuthPacket(byte[] data, int size)
        {
            while (true)
            {
IL_C9:
                uint arg_A5_0 = 1445719530u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_A5_0 ^ 859620147u)) % 6u)
                    {
                    case 1u:
                        this.Header.Message = this.Read <byte>(6);
                        arg_A5_0            = (num * 1334912898u ^ 628600217u);
                        continue;

                    case 2u:
                        arg_A5_0 = ((this.Read <bool>(1) ? 393606493u : 137688773u) ^ num * 4214401147u);
                        continue;

                    case 3u:
                        this.stream = AuthPacket.smethod_3(AuthPacket.smethod_2(data));
                        this.Header = new AuthPacketHeader();
                        arg_A5_0    = (num * 515657235u ^ 1769185713u);
                        continue;

                    case 4u:
                        this.Header.Channel = (AuthChannel)this.Read <byte>(4);
                        arg_A5_0            = (num * 2930748750u ^ 179895641u);
                        continue;

                    case 5u:
                        goto IL_C9;
                    }
                    goto Block_2;
                }
            }
Block_2:
            this.Data = new byte[size];
            AuthPacket.smethod_4(data, 0, this.Data, 0, size);
        }
示例#3
0
        public AuthPacket()
        {
            while (true)
            {
IL_42:
                uint arg_2A_0 = 575686330u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_2A_0 ^ 1375028428u)) % 3u)
                    {
                    case 1u:
                        this.stream = AuthPacket.smethod_1(AuthPacket.smethod_0());
                        arg_2A_0    = (num * 3148369998u ^ 2997472847u);
                        continue;

                    case 2u:
                        goto IL_42;
                    }
                    return;
                }
            }
        }
示例#4
0
        public void WriteFourCC(string data)
        {
            byte[] value = AuthPacket.smethod_42(AuthPacket.smethod_12(), data);
            while (true)
            {
IL_3F:
                uint arg_27_0 = 2115914845u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_27_0 ^ 427277530u)) % 3u)
                    {
                    case 1u:
                        this.Write <byte[]>(value);
                        arg_27_0 = (num * 1839703030u ^ 159873758u);
                        continue;

                    case 2u:
                        goto IL_3F;
                    }
                    return;
                }
            }
        }
示例#5
0
        public void Write <T>(T value, int bits)
        {
            BinaryWriter binaryWriter_ = this.stream as BinaryWriter;
            int          num           = 0;
            int          num2          = 0;
            byte         value2;

            while (true)
            {
IL_236:
                uint arg_1EC_0 = 3853054254u;
                while (true)
                {
                    uint num3;
                    switch ((num3 = (arg_1EC_0 ^ 3822343185u)) % 15u)
                    {
                    case 0u:
                        this.preByte = 0;
                        arg_1EC_0    = (num3 * 1308454025u ^ 2360235369u);
                        continue;

                    case 1u:
                        num       = bits;
                        arg_1EC_0 = (num3 * 615170171u ^ 1083175457u);
                        continue;

                    case 2u:
                        goto IL_236;

                    case 3u:
                        num2      = (this.count & 7);
                        arg_1EC_0 = ((num2 != 0) ? 4047609542u : 3817100251u);
                        continue;

                    case 4u:
                        num       = 8 - num2;
                        arg_1EC_0 = ((num >= bits) ? 2275874581u : 2260975821u);
                        continue;

                    case 5u:
                        arg_1EC_0 = ((bits != 0) ? 2292956640u : 2290361256u);
                        continue;

                    case 6u:
                        arg_1EC_0 = (num3 * 1271639527u ^ 1190542238u);
                        continue;

                    case 7u:
                        arg_1EC_0 = (((num2 != 0) ? 4225350203u : 3087155715u) ^ num3 * 567680321u);
                        continue;

                    case 8u:
                        bits     -= num;
                        arg_1EC_0 = (num3 * 1418491570u ^ 710958391u);
                        continue;

                    case 9u:
                        this.Write <byte>(value2);
                        arg_1EC_0 = 3397105997u;
                        continue;

                    case 10u:
                    {
                        Stream expr_D1 = AuthPacket.smethod_5(binaryWriter_);
                        AuthPacket.smethod_41(expr_D1, AuthPacket.smethod_40(expr_D1) - 1L);
                        arg_1EC_0 = (num3 * 2093632183u ^ 3005065087u);
                        continue;
                    }

                    case 12u:
                    {
                        ulong num4;
                        value2      = (byte)(((ulong)this.preByte & (ulong)(~(ulong)((1L << (num & 31)) - 1L << (num2 & 31)))) | (num4 >> bits - num & (ulong)((long)((1 << num) - 1))) << num2);
                        this.count += num;
                        arg_1EC_0   = 3527270891u;
                        continue;
                    }

                    case 13u:
                    {
                        ulong num4 = (ulong)AuthPacket.smethod_15(value, AuthPacket.smethod_14(typeof(ulong).TypeHandle));
                        value2    = 0;
                        arg_1EC_0 = (num3 * 2889322655u ^ 1901488133u);
                        continue;
                    }

                    case 14u:
                        arg_1EC_0 = (((AuthPacket.smethod_6(AuthPacket.smethod_5(binaryWriter_)) <= 0L) ? 1517721775u : 1685766937u) ^ num3 * 506475948u);
                        continue;
                    }
                    goto Block_6;
                }
            }
Block_6:
            this.preByte = value2;
        }
示例#6
0
        public void Write <T>(T value)
        {
            BinaryWriter binaryWriter = this.stream as BinaryWriter;

            while (true)
            {
IL_1FB:
                uint arg_18E_0 = 3721335647u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_18E_0 ^ 3850814296u)) % 24u)
                    {
                    case 0u:
                        return;

                    case 1u:
                        goto IL_107;

                    case 2u:
                        goto IL_14F;

                    case 3u:
                        this.Flush();
                        arg_18E_0 = (num * 825481829u ^ 3064178000u);
                        continue;

                    case 4u:
                        goto IL_11F;

                    case 5u:
                        goto IL_137;

                    case 6u:
                        arg_18E_0 = (num * 4014390826u ^ 3274484134u);
                        continue;

                    case 7u:
                    {
                        TypeCode typeCode;
                        switch (typeCode)
                        {
                        case TypeCode.SByte:
                            goto IL_234;

                        case TypeCode.Byte:
                            goto IL_107;

                        case TypeCode.Int16:
                            goto IL_94;

                        case TypeCode.UInt16:
                            goto IL_20F;

                        case TypeCode.Int32:
                            goto IL_11F;

                        case TypeCode.UInt32:
                            goto IL_137;

                        case TypeCode.Int64:
                            goto IL_222;

                        case TypeCode.UInt64:
                            goto IL_247;

                        case TypeCode.Single:
                            goto IL_14F;

                        default:
                            arg_18E_0 = (num * 2762671822u ^ 313630772u);
                            continue;
                        }
                        break;
                    }

                    case 8u:
                        return;

                    case 9u:
                        goto IL_204;

                    case 10u:
                        goto IL_20F;

                    case 11u:
                        return;

                    case 12u:
                    {
                        TypeCode typeCode = AuthPacket.smethod_19(AuthPacket.smethod_14(typeof(T).TypeHandle));
                        arg_18E_0 = 2367109391u;
                        continue;
                    }

                    case 13u:
                        goto IL_94;

                    case 14u:
                        goto IL_222;

                    case 15u:
                    {
                        byte[] byte_ = value as byte[];
                        AuthPacket.smethod_39(binaryWriter, byte_);
                        arg_18E_0 = (num * 3201777706u ^ 281211471u);
                        continue;
                    }

                    case 16u:
                        goto IL_234;

                    case 18u:
                        arg_18E_0 = ((!AuthPacket.smethod_38(AuthPacket.smethod_14(typeof(T).TypeHandle), AuthPacket.smethod_14(typeof(byte[]).TypeHandle))) ? 2322063593u : 3547962235u);
                        continue;

                    case 19u:
                        goto IL_1FB;

                    case 20u:
                        goto IL_247;

                    case 21u:
                        return;

                    case 22u:
                        return;

                    case 23u:
                        arg_18E_0 = (((binaryWriter != null) ? 3400374826u : 2994678575u) ^ num * 3971327378u);
                        continue;
                    }
                    goto Block_4;
IL_94:
                    AuthPacket.smethod_25(binaryWriter, AuthPacket.smethod_24(value));
                    arg_18E_0 = 2155509429u;
                    continue;
IL_107:
                    AuthPacket.smethod_23(binaryWriter, AuthPacket.smethod_22(value));
                    arg_18E_0 = 3704779824u;
                    continue;
IL_11F:
                    AuthPacket.smethod_29(binaryWriter, AuthPacket.smethod_28(value));
                    arg_18E_0 = 3309188710u;
                    continue;
IL_137:
                    AuthPacket.smethod_31(binaryWriter, AuthPacket.smethod_30(value));
                    arg_18E_0 = 2848762291u;
                    continue;
IL_14F:
                    AuthPacket.smethod_37(binaryWriter, AuthPacket.smethod_36(value));
                    arg_18E_0 = 2335994440u;
                }
            }
Block_4:
            return;

IL_204:
            throw AuthPacket.smethod_10("");
IL_20F:
            AuthPacket.smethod_27(binaryWriter, AuthPacket.smethod_26(value));
            return;

IL_222:
            AuthPacket.smethod_33(binaryWriter, AuthPacket.smethod_32(value));
            return;

IL_234:
            AuthPacket.smethod_21(binaryWriter, AuthPacket.smethod_20(value));
            return;

IL_247:
            AuthPacket.smethod_35(binaryWriter, AuthPacket.smethod_34(value));
        }
示例#7
0
        public T Read <T>(int bits)
        {
            ulong num  = 0uL;
            int   num2 = 0;

            while (true)
            {
IL_174:
                uint arg_137_0 = 3555674250u;
                while (true)
                {
                    uint num3;
                    switch ((num3 = (arg_137_0 ^ 3548092431u)) % 12u)
                    {
                    case 0u:
                        arg_137_0 = (((num2 < bits) ? 1393347338u : 1826137086u) ^ num3 * 3315800535u);
                        continue;

                    case 1u:
                        num2      = bits;
                        arg_137_0 = (num3 * 2296605026u ^ 3989491448u);
                        continue;

                    case 2u:
                        goto IL_174;

                    case 3u:
                        this.bytePart = this.Read <byte>();
                        arg_137_0     = (num3 * 1061505809u ^ 2825260414u);
                        continue;

                    case 5u:
                        bits     -= num2;
                        arg_137_0 = 3196994772u;
                        continue;

                    case 6u:
                        arg_137_0 = ((this.count % 8 != 0) ? 2688345364u : 3582494364u);
                        continue;

                    case 7u:
                    {
                        int num4;
                        num        |= (ulong)((ulong)(this.bytePart >> num4 & (int)((byte)(1 << num2) - 1)) << bits);
                        this.count += num2;
                        arg_137_0   = (num3 * 711456157u ^ 1145706872u);
                        continue;
                    }

                    case 8u:
                        arg_137_0 = ((bits != 0) ? 3190377533u : 3490406871u);
                        continue;

                    case 9u:
                        arg_137_0 = (num3 * 4100535845u ^ 100802830u);
                        continue;

                    case 10u:
                        this.ProcessedBytes++;
                        arg_137_0 = (num3 * 1932297174u ^ 2224319960u);
                        continue;

                    case 11u:
                    {
                        int num4 = this.count & 7;
                        num2      = 8 - num4;
                        arg_137_0 = 3565036863u;
                        continue;
                    }
                    }
                    goto Block_4;
                }
            }
Block_4:
            return((T)((object)AuthPacket.smethod_15(num, AuthPacket.smethod_14(typeof(T).TypeHandle))));
        }
示例#8
0
 public string ReadString(int count)
 {
     return(AuthPacket.smethod_13(AuthPacket.smethod_12(), this.Read(count)));
 }