题目链接:https://buuoj.cn/challenges#[GWCTF%202019]pyre
题目是个.pyc文件
现在python中安装 uncompyle 库
运行命令
uncompyle6 attachment.pyc > attachment.py
获得.py脚本
print 'Welcome to Re World!'
print 'Your input1 is your flag~'
l = len(input1)
for i in range(l):
num = ((input1[i] + i) % 128 + 128) % 128
code += num
for i in range(l - 1):
code[i] = code[i] ^ code[(i + 1)]
print code
code = ['\x1f', '\x12', '\x1d', '(', '0', '4', '\x01', '\x06', '\x14', '4', ',', '\x1b', 'U', '?', 'o', '6', '*', ':', '\x01', 'D', ';', '%', '\x13']
写个脚本跑一下
code = ['\x1f', '\x12', '\x1d', '(', '0', '4', '\x01', '\x06', '\x14', '4', ',', '\x1b', 'U', '?', 'o', '6', '*', ':', '\x01', 'D', ';', '%', '\x13']
length = len(code)
flag = ""
code.reverse()
for i in range(1,length):
code[i] = chr(ord(code[i]) ^ ord(code[i-1]))
code.reverse()
for i in range(len(code)):
flag += chr((ord(code[i]) - i)%128 )
print(flag)
flag:GWHT{Just_Re_1s_Ha66y!}