CFI-CTF2018_Automated_Reversing

[CFI-CTF 2018]Automated Reversing

打开全是elf文件

image-20230418210205327

每个文件的格式都是固定的

image-20230418210947989

仅有中间这里有区别

写脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
for i in range(1, 1009):
path = r"binaries\binary{}".format(i)
f = open(path, "rb")
buf = f.read()
flag = buf[0xce]
operate = buf[0xca]
num = buf[0xcb]
if operate == 0xf2:
flag ^= num
elif operate == 0xea:
flag += num
elif operate == 0xc2:
flag -= num
print(chr(flag&0xff), end="")

flag{1s_th1s_4_pr0g_ch4ll_0r_4_r3ve3se_ch4ll?}