下载后是一个pyc文件,在线反编译一下得到源码
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 #元素+下标,与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']
i=len(code)
for j in range(i-2,-1,-1):#要倒着异或,,从倒数第二个开始,到0,(因为前面是正序的)
code[j]=chr(ord(code[j])^ord(code[j+1]))
for j in range(i):
print(chr((ord(code[j])-j)%128),end='')
得到flag为 GWHT{Just_Re_1s_Ha66y!}