如图 使用unk_403040处的数据执行switch 并且最后的对比数据也在这里面
我们把switch用的数据和对比数据提取出来
[10, 4, 16, 8, 3, 5, 1, 4, 32, 8, 5, 3, 1, 3, 2, 8, 11, 1, 12, 8, 4, 4, 1, 5, 3, 8, 3, 33, 1, 11, 8, 11, 1, 4, 9, 8, 3, 32, 1, 2, 81, 8, 4, 36, 1, 12, 8, 11, 1, 5, 2, 8, 2, 37, 1, 2, 54, 8, 4, 65, 1, 2, 32, 8, 5, 1, 1, 5, 3, 8, 2, 37, 1, 4, 9, 8, 3, 32, 1, 2, 65, 8, 12, 1]
[34, 63, 52, 50, 114, 51, 24, 167, 49, 241, 40, 132, 193, 30, 122]
可以发现 input的每一位都是单独处理的 遇到1就换下一位 所以我们可以倒叙处理对比数据得到input
f = open('so.in') a = [] for i in range(21): s = f.readline() for j in range(16): if j % 4 == 0: a.append(int(s[j*3:j*3+2],16)) print a b = [] for i in range(7): s = f.readline() for j in range(16): if j ==4 or j ==12 : b.append(int(s[j*3:j*3+2],16)) b.append(0x7a) print b v5 = 0 v3 = 0 v9 = 14 flag = '' for i in range(len(a)-1,-1,-1): if i == 0: flag += chr(v3) if a[i] == 1 and a[i-1] != 1 : v5 = b[v9] v9 = v9 - 1 flag += chr(v3) elif a[i] == 2 and a[i-1] != 3 and a[i-1] != 4 and a[i-1] != 5: v3 = v5 - a[i+1] elif a[i] == 3 and a[i-1] != 2 and a[i-1] != 4 and a[i-1] != 5: v3 = v5 + a[i+1] elif a[i] == 4 and a[i-1] != 3 and a[i-1] != 2 and a[i-1] != 5: v3 = v5 ^ a[i+1] elif a[i] == 5 and a[i-1] != 3 and a[i-1] != 4 and a[i-1] != 2: v3 = v5 // a[i+1] elif a[i] == 8: v5 = v3 elif a[i] == 11: v3 = v5 + 1 elif a[i] == 12: v3 = v5 - 1 print flag[::-1]
so.in数据
0A 00 00 00 04 00 00 00 10 00 00 00 08 00 00 00 03 00 00 00 05 00 00 00 01 00 00 00 04 00 00 00 20 00 00 00 08 00 00 00 05 00 00 00 03 00 00 00 01 00 00 00 03 00 00 00 02 00 00 00 08 00 00 00 0B 00 00 00 01 00 00 00 0C 00 00 00 08 00 00 00 04 00 00 00 04 00 00 00 01 00 00 00 05 00 00 00 03 00 00 00 08 00 00 00 03 00 00 00 21 00 00 00 01 00 00 00 0B 00 00 00 08 00 00 00 0B 00 00 00 01 00 00 00 04 00 00 00 09 00 00 00 08 00 00 00 03 00 00 00 20 00 00 00 01 00 00 00 02 00 00 00 51 00 00 00 08 00 00 00 04 00 00 00 24 00 00 00 01 00 00 00 0C 00 00 00 08 00 00 00 0B 00 00 00 01 00 00 00 05 00 00 00 02 00 00 00 08 00 00 00 02 00 00 00 25 00 00 00 01 00 00 00 02 00 00 00 36 00 00 00 08 00 00 00 04 00 00 00 41 00 00 00 01 00 00 00 02 00 00 00 20 00 00 00 08 00 00 00 05 00 00 00 01 00 00 00 01 00 00 00 05 00 00 00 03 00 00 00 08 00 00 00 02 00 00 00 25 00 00 00 01 00 00 00 04 00 00 00 09 00 00 00 08 00 00 00 03 00 00 00 20 00 00 00 01 00 00 00 02 00 00 00 41 00 00 00 08 00 00 00 0C 00 00 00 01 00 00 00 07 00 00 00 22 00 00 00 07 00 00 00 3F 00 00 00 07 00 00 00 34 00 00 00 07 00 00 00 32 00 00 00 07 00 00 00 72 00 00 00 07 00 00 00 33 00 00 00 07 00 00 00 18 00 00 00 07 00 00 00 A7 FF FF FF 07 00 00 00 31 00 00 00 07 00 00 00 F1 FF FF FF 07 00 00 00 28 00 00 00 07 00 00 00 84 FF FF FF 07 00 00 00 C1 FF FF FF 07 00 00 00 1E 00 00 00