for i in range(11,16) : #第二段 for j in range(32,127) : a = j ^ 0x76 x = ((a ^ 0xe) << 2) & 0xffffffcc y = ((a ^ 0xe) & 0xcc) >> 2 jie = x | y if jie > 0x100: #包含有结果不是可见字符的纯数字,只放低字节,比如0x15c的情况所以只存0x5c jie = jie - 0x100 if jie == shuzi[i] : #print i st.append(chr(j))
第六个函数:
1 2 3 4 5 6 7 8 9 10 11 12 13
void sub_80486FE() { signed int v0; // [esp+8h] [ebp-8h] signed int i; // [esp+Ch] [ebp-4h]
shuzi = [0x10,0x1a,0x17,0x11,0x0d,0x4f,0x73,0x5d,0x7a,0x70,0x29,0x4e,0x12,0x43,0x47,0x0e,0x29,0x1a,0x42,0x13,0x12,0x29,0x13,0x45,0x07,0x19,0x01,0x28,0x23,0x18,0x0f,0x0b] st = [] shuzi2 = [] s = '' for i in range(0,32) : shuzi2.append(shuzi[i] ^ 0x76) s += chr((shuzi[i] ^ 0x76)) #print shuzi print s print shuzi2 for i in range(5,10) : #第一段 for j in range(32,127) : a = j ^ 0x76 x = (2*((a ^ 0xffffffad) - 0xffffff00)) & 0xffffffaa y = ((((a ^ 0xffffffad) - 0xffffff00) + 0xffffff00) & 0xaa) >> 1 jieguo = x | y jieguo = jieguo - 0x100 if jieguo == shuzi[i] : #print jieguo st.append(chr(j)) #print chr(j) print st
for i in range(11,16) : #第二段 for j in range(32,127) : a = j ^ 0x76 x = ((a ^ 0xe) << 2) & 0xffffffcc y = ((a ^ 0xe) & 0xcc) >> 2 jie = x | y if jie > 0x100: #包含有结果不是可见字符的纯数字,只放低字节,比如0x15c的情况所以只存0x5c jie = jie - 0x100 if jie == shuzi[i] : #print i st.append(chr(j)) print st
# x = a # y = b # # x = x ^ (y+1) # | # y = y ^ x ^ (y+1) # | # x = x ^ (y+1) ^ y ^ x ^ (y+1)
# x = x ^ (y+1) # y = y ^ x ^ (y+1) # x = y
# y = b ^ a ^ (b+1) # x = b
print s[17:31] s4 = 'l4ed_e3' #第三段 for i in range(0,7) : a = shuzi[i+17] ^ shuzi[30-i] ^ (shuzi[i+17] + 1) ^ 0x76 st.append(chr(a)) print st for i in range(0,7) : st.append(s4[6-i]) st.insert(5,'_') st.insert(11,'_') st.insert(0,'flag{') st.append('}') print st # for i in range(13,28) : # x = ord(st[i]) # x = x ^ 0x76 # st[i] = chr(x) print ''.join(st)