1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
public T1()
{
try
{
string text = null;
string text2 = null;
string text3 = null;
text = Environment.GetEnvironmentVariable("AchivePoint1");
text2 = Environment.GetEnvironmentVariable("AchivePoint2");
text3 = Environment.GetEnvironmentVariable("AchivePoint3");
if (text == null || text2 == null || text3 == null)
{
return;
}
ulong num = ulong.Parse(text);
ulong num2 = ulong.Parse(text2);
ulong num3 = ulong.Parse(text3);
ulong[] array = new ulong[3];
byte[] array2 = new byte[40];
byte[] array3 = new byte[40];
byte[] array4 = new byte[12];
byte[] first = new byte[40]
{
101, 5, 80, 213, 163, 26, 59, 38, 19, 6,
173, 189, 198, 166, 140, 183, 42, 247, 223, 24,
106, 20, 145, 37, 24, 7, 22, 191, 110, 179,
227, 5, 62, 9, 13, 17, 65, 22, 37, 5
};
byte[] array5 = new byte[19]
{
60, 100, 36, 86, 51, 251, 167, 108, 116, 245,
207, 223, 40, 103, 34, 62, 22, 251, 227
};
array[0] = num;
array[1] = num2;
array[2] = num3;
Check1(array[0], array[1], array[2], array2);
if (first.SequenceEqual(array2))
{
ParseKey(array, array4);
for (int i = 0; i < array5.Length; i++)
{
array5[i] = (byte)(array5[i] ^ array4[i % array4.Length]);
}
MessageBox.Show("flag{" + Encoding.Default.GetString(array5) + "}", "Congratulations!", MessageBoxButtons.OK);
}
}
catch (Exception)
{
}
}
private static void Check1(ulong x, ulong y, ulong z, byte[] KeyStream)
{
int num = -1;
for (int i = 0; i < 320; i++)
{
x = (((x >> 29) ^ (x >> 28) ^ (x >> 25) ^ (x >> 23)) & 1) | (x << 1);
y = (((y >> 30) ^ (y >> 27)) & 1) | (y << 1);
z = (((z >> 31) ^ (z >> 30) ^ (z >> 29) ^ (z >> 28) ^ (z >> 26) ^ (z >> 24)) & 1) | (z << 1);
if (i % 8 == 0)
{
num++;
}
KeyStream[num] = (byte)((KeyStream[num] << 1) | (uint)(((z >> 32) & 1 & ((x >> 30) & 1)) ^ ((((z >> 32) & 1) ^ 1) & ((y >> 31) & 1))));
}
}
private static void ParseKey(ulong[] L, byte[] Key)
{
for (int i = 0; i < 3; i++)
{
for (int j = 0; j < 4; j++)
{
Key[i * 4 + j] = (byte)((L[i] >> j * 8) & 0xFF);
}
}
}
|