Esempio n. 1
0
        public void Encrypt(byte[] data, int count)
        {
            if (this.IsInitialized)
            {
                goto IL_2C;
            }
IL_08:
            int arg_12_0 = -407049644;

IL_0D:
            switch ((arg_12_0 ^ -1406051805) % 4)
            {
            case 0:
IL_2C:
                this.SARC4Encrypt.ProcessBuffer(data, count);
                arg_12_0 = -2042246406;
                goto IL_0D;

            case 2:
                goto IL_08;

            case 3:
                throw BNetCrypt.smethod_0(Module.smethod_33 <string>(2782540870u));
            }
        }
Esempio n. 2
0
        public void Decrypt(byte[] data, int count)
        {
            if (this.IsInitialized)
            {
                goto IL_2C;
            }
IL_08:
            int arg_12_0 = -669052452;

IL_0D:
            switch ((arg_12_0 ^ -2090713909) % 4)
            {
            case 0:
                goto IL_08;

            case 2:
IL_2C:
                this.SARC4Decrypt.ProcessBuffer(data, count);
                arg_12_0 = -110949926;
                goto IL_0D;

            case 3:
                throw BNetCrypt.smethod_0(Module.smethod_33 <string>(2782540870u));
            }
        }
Esempio n. 3
0
        public BNetCrypt(byte[] sessionKey)
        {
            this.IsInitialized = false;
            if (this.IsInitialized)
            {
                throw BNetCrypt.smethod_0(Module.smethod_36 <string>(56398324u));
            }
            this.SARC4Encrypt = new SARC4();
            this.SARC4Decrypt = new SARC4();
            HMACSHA256 hashAlgorithm_  = BNetCrypt.smethod_1(sessionKey);
            HMACSHA256 hashAlgorithm_2 = BNetCrypt.smethod_1(sessionKey);

            this.SARC4Encrypt.PrepareKey(BNetCrypt.smethod_2(hashAlgorithm_2, BNetCrypt.ServerEncryptionKey));
            this.SARC4Decrypt.PrepareKey(BNetCrypt.smethod_2(hashAlgorithm_, BNetCrypt.ServerDecryptionKey));
            this.IsInitialized = true;
        }