예제 #1
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;
        }
예제 #2
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))));
        }