コード例 #1
0
ファイル: QQTea.cs プロジェクト: pwg17/PCQQ-Protocol
        public static byte[] Decrypt(byte[] In, int offset, int len, byte[] key)
        {
            var temp = new byte[In.Length];

            Buffer.BlockCopy(In, 0, temp, 0, In.Length);
            if (len % 8 != 0 || len < 16)
            {
                return(null);
            }
            byte[] array = new byte[len];
            for (int i = 0; i < len; i += 8)
            {
                QQTea.decode(temp, offset, i, array, 0, i, key);
            }
            for (int j = 8; j < len; j++)
            {
                array[j] ^= temp[offset + j - 8];
            }
            int num = (int)(array[0] & 7);

            len = len - num - 10;
            byte[] array2 = new byte[len];
            Array.Copy(array, num + 3, array2, 0, len);
            return(array2);
        }
コード例 #2
0
        public static byte[] Decrypt(byte[] In, int offset, int len, byte[] key)
        {
            if (len % 8 != 0 || len < 16)
            {
                return(null);
            }
            byte[] array = new byte[len];
            for (int i = 0; i < len; i += 8)
            {
                QQTea.decode(In, offset, i, array, 0, i, key);
            }
            for (int j = 8; j < len; j++)
            {
                array[j] ^= In[offset + j - 8];
            }
            int num = (int)(array[0] & 7);

            len = len - num - 10;
            byte[] array2 = new byte[len];
            Array.Copy(array, num + 3, array2, 0, len);
            return(array2);
        }