IDA打开
代码大概意思是他打开flag文件,通过加密来生成output文件。
我们需要拿output文件逆向出flag文件。
编写exp
flag = []
data = [198, 232, 816, 200, 1536, 300, 6144, 984, 51200, 570, 92160, 1200, 565248, 756, 1474560, 800, 6291456, 1782, 65536000]
print(data)
for i in range(1, 20): # Corrected: starting loop from 1
if (i & 1) != 0 :
flag.append(chr(data[i-1] >> i)) # Access the elements data[i-1] to avoid the off-by-one error
else:
flag.append(chr(data[i-1] // i)) # Use the corrected index
print("".join(flag))