Tags: reverse engineering
Rating: 1.0
## **IDA **and** guess**...
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-
retable=[23, 14, 2, 21, 11, 3, 4, 16, 22, 5, 18, 6, 12, 7, 19, 1, 8, 20, 9, 10, 13, 24, 0, 17, 15]
exp='6351486A40091E7A7A0C0B0249484D43716B305A121B273953'
testinp="AFFCTF{00000000000000000}"
print(testinp)
tmp=''
for i in range(25):
tmp+=testinp[retable[i]]
print(tmp)
v13=[0]*5
for i in range(25):
if tmp[i]!='0':
#print(i,tmp[i],int(i/5),int(exp[i*2:i*2+2],16)^ord(tmp[i]))
v13[int(i/5)]=int(exp[i*2:i*2+2],16)^ord(tmp[i])
print(v13)
dexp=''
for i in range(25):
#print(chr(int(exp[i*2:i*2+2],16)^v13[int(i/5)]))
dexp+=chr(int(exp[i*2:i*2+2],16)^v13[int(i/5)])
print(dexp)
res=''
for i in range(25):
#print(dexp[ret.index(i)])
res+=dexp[retable.index(i)]
print(res)
```
```
AFFCTF{00000000000000000}
00F00CT00F0{000F00000}A00
[14, 74, 121, 5, 102]
m_FdNCT00Fr{014Ftn5_t}A_5
AFFCTF{1t5_N0t_50_r4nd0m}
```