|
本帖最后由 LINCONNECTOR 于 2021-3-2 07:05 编辑
public void GetEncode(byte[] data)
{
int num = 16;
int num2 = 0;
int num3 = 0;
int num4 = 0;
int num5 = 0;
bool flag = false;
int num6 = (int)(data[this.ptr] & byte.MaxValue) << 24;
num6 |= (int)(data[this.ptr + 1] & byte.MaxValue) << 16;
num6 |= (int)(data[this.ptr + 2] & byte.MaxValue) << 8;
num6 |= (int)(data[this.ptr + 3] & byte.MaxValue);
num6 ^= AES.ReadInt(this.keys, num);
int num7 = (int)(data[this.ptr + 4] & byte.MaxValue) << 24;
num7 |= (int)(data[this.ptr + 5] & byte.MaxValue) << 16;
num7 |= (int)(data[this.ptr + 6] & byte.MaxValue) << 8;
num7 |= (int)(data[this.ptr + 7] & byte.MaxValue);
num7 ^= AES.ReadInt(this.keys, num + 4);
int num8 = (int)(data[this.ptr + 8] & byte.MaxValue) << 24;
num8 |= (int)(data[this.ptr + 9] & byte.MaxValue) << 16;
num8 |= (int)(data[this.ptr + 10] & byte.MaxValue) << 8;
num8 |= (int)(data[this.ptr + 11] & byte.MaxValue);
num8 ^= AES.ReadInt(this.keys, num + 8);
int num9 = (int)(data[this.ptr + 12] & byte.MaxValue) << 24;
num9 |= (int)(data[this.ptr + 13] & byte.MaxValue) << 16;
num9 |= (int)(data[this.ptr + 14] & byte.MaxValue) << 8;
num9 |= (int)(data[this.ptr + 15] & byte.MaxValue);
num9 ^= AES.ReadInt(this.keys, num + 12);
for (int i = 0; i < 9; i++)
{
num += 16;
if (!flag)
{
flag = true;
int num10 = AES.ReadInt(this.keys, num);
num10 ^= (int)AES.Encrypt_Mask[num6 >> 24 & 255];
num10 ^= (int)AES.Encrypt_Mask[(num7 >> 16 & 255) + 256];
num10 ^= (int)AES.Encrypt_Mask[(num8 >> 8 & 255) + 512];
num10 ^= (int)AES.Encrypt_Mask[(num9 & 255) + 768];
num5 = num10;
int num11 = AES.ReadInt(this.keys, num + 4);
num11 ^= (int)AES.Encrypt_Mask[num7 >> 24 & 255];
num11 ^= (int)AES.Encrypt_Mask[(num8 >> 16 & 255) + 256];
num11 ^= (int)AES.Encrypt_Mask[(num9 >> 8 & 255) + 512];
num11 ^= (int)AES.Encrypt_Mask[(num6 & 255) + 768];
num4 = num11;
int num12 = AES.ReadInt(this.keys, num + 8);
num12 ^= (int)AES.Encrypt_Mask[num8 >> 24 & 255];
num12 ^= (int)AES.Encrypt_Mask[(num9 >> 16 & 255) + 256];
num12 ^= (int)AES.Encrypt_Mask[(num6 >> 8 & 255) + 512];
num12 ^= (int)AES.Encrypt_Mask[(num7 & 255) + 768];
num2 = num12;
int num13 = AES.ReadInt(this.keys, num + 12);
num13 ^= (int)AES.Encrypt_Mask[num9 >> 24 & 255];
num13 ^= (int)AES.Encrypt_Mask[(num6 >> 16 & 255) + 256];
num13 ^= (int)AES.Encrypt_Mask[(num7 >> 8 & 255) + 512];
num13 ^= (int)AES.Encrypt_Mask[(num8 & 255) + 768];
num3 = num13;
}
else
{
flag = false;
int num10 = AES.ReadInt(this.keys, num);
num10 ^= (int)AES.Encrypt_Mask[num5 >> 24 & 255];
num10 ^= (int)AES.Encrypt_Mask[(num4 >> 16 & 255) + 256];
num10 ^= (int)AES.Encrypt_Mask[(num2 >> 8 & 255) + 512];
num10 ^= (int)AES.Encrypt_Mask[(num3 & 255) + 768];
num6 = num10;
int num11 = AES.ReadInt(this.keys, num + 4);
num11 ^= (int)AES.Encrypt_Mask[num4 >> 24 & 255];
num11 ^= (int)AES.Encrypt_Mask[(num2 >> 16 & 255) + 256];
num11 ^= (int)AES.Encrypt_Mask[(num3 >> 8 & 255) + 512];
num11 ^= (int)AES.Encrypt_Mask[(num5 & 255) + 768];
num7 = num11;
int num12 = AES.ReadInt(this.keys, num + 8);
num12 ^= (int)AES.Encrypt_Mask[num2 >> 24 & 255];
num12 ^= (int)AES.Encrypt_Mask[(num3 >> 16 & 255) + 256];
num12 ^= (int)AES.Encrypt_Mask[(num5 >> 8 & 255) + 512];
num12 ^= (int)AES.Encrypt_Mask[(num4 & 255) + 768];
num8 = num12;
int num13 = AES.ReadInt(this.keys, num + 12);
num13 ^= (int)AES.Encrypt_Mask[num3 >> 24 & 255];
num13 ^= (int)AES.Encrypt_Mask[(num5 >> 16 & 255) + 256];
num13 ^= (int)AES.Encrypt_Mask[(num4 >> 8 & 255) + 512];
num13 ^= (int)AES.Encrypt_Mask[(num2 & 255) + 768];
num9 = num13;
}
}
num += 16;
int num14 = AES.ReadInt(this.keys, num);
int num15 = (int)(AES.SE[num5 >> 24 & 255] & byte.MaxValue);
num15 <<= 24;
num14 ^= num15;
int num16 = (int)(AES.SE[num4 >> 16 & 255] & byte.MaxValue);
num16 <<= 16;
num14 ^= num16;
int num17 = (int)(AES.SE[num2 >> 8 & 255] & byte.MaxValue);
num17 <<= 8;
num14 ^= num17;
int num18 = (int)AES.SE[num3 & 255];
num14 ^= num18;
num6 = num14;
num14 = AES.ReadInt(this.keys, num + 4);
num15 = (int)(AES.SE[num4 >> 24 & 255] & byte.MaxValue);
num15 <<= 24;
num14 ^= num15;
num16 = (int)(AES.SE[num2 >> 16 & 255] & byte.MaxValue);
num16 <<= 16;
num14 ^= num16;
num17 = (int)(AES.SE[num3 >> 8 & 255] & byte.MaxValue);
num17 <<= 8;
num14 ^= num17;
num18 = (int)AES.SE[num5 & 255];
num14 ^= num18;
num7 = num14;
num14 = AES.ReadInt(this.keys, num + 8);
num15 = (int)(AES.SE[num2 >> 24 & 255] & byte.MaxValue);
num15 <<= 24;
num14 ^= num15;
num16 = (int)(AES.SE[num3 >> 16 & 255] & byte.MaxValue);
num16 <<= 16;
num14 ^= num16;
num17 = (int)(AES.SE[num5 >> 8 & 255] & byte.MaxValue);
num17 <<= 8;
num14 ^= num17;
num18 = (int)AES.SE[num4 & 255];
num14 ^= num18;
num8 = num14;
num14 = AES.ReadInt(this.keys, num + 12);
num15 = (int)(AES.SE[num3 >> 24 & 255] & byte.MaxValue);
num15 <<= 24;
num14 ^= num15;
num16 = (int)(AES.SE[num5 >> 16 & 255] & byte.MaxValue);
num16 <<= 16;
num14 ^= num16;
num17 = (int)(AES.SE[num4 >> 8 & 255] & byte.MaxValue);
num17 <<= 8;
num14 ^= num17;
num18 = (int)AES.SE[num2 & 255];
num14 ^= num18;
num9 = num14;
data[this.ptr] = (byte)(num6 >> 24 & 255);
data[this.ptr + 1] = (byte)(num6 >> 16 & 255);
data[this.ptr + 2] = (byte)(num6 >> 8 & 255);
data[this.ptr + 3] = (byte)(num6 & 255);
data[this.ptr + 4] = (byte)(num7 >> 24 & 255);
data[this.ptr + 5] = (byte)(num7 >> 16 & 255);
data[this.ptr + 6] = (byte)(num7 >> 8 & 255);
data[this.ptr + 7] = (byte)(num7 & 255);
data[this.ptr + 8] = (byte)(num8 >> 24 & 255);
data[this.ptr + 9] = (byte)(num8 >> 16 & 255);
data[this.ptr + 10] = (byte)(num8 >> 8 & 255);
data[this.ptr + 11] = (byte)(num8 & 255);
data[this.ptr + 12] = (byte)(num9 >> 24 & 255);
data[this.ptr + 13] = (byte)(num9 >> 16 & 255);
data[this.ptr + 14] = (byte)(num9 >> 8 & 255);
data[this.ptr + 15] = (byte)(num9 & 255);
}
|
|