pyc文件,用在线pyc反编译工具pyc反编译
import base64
def encode(message):
s = ''
for i in message:
x = ord(i) ^ 32
x = x + 16
s += chr(x)
return base64.b64encode(s)
correct = 'XlNkVmtUI1MgXWBZXCFeKY+AaXNt'
flag = ''
print 'Input flag:'
flag = raw_input()
if encode(flag) == correct:
print 'correct'
else:
print 'wrong'
flag值经过encode函数,返回值为base64加密
写脚本先base64解密
import base64
s='XlNkVmtUI1MgXWBZXCFeKY+AaXNt'
s=base64.b64decode(s)
print(s)
b'^SdVkT#S ]`Y\\!^)\x8f\x80ism'
逆向脚本
s="b'^SdVkT#S ]`Y\\!^)\x8f\x80ism'"
flag = ''
for i in s:
x = ord(i) - 16
x = x ^ 32
flag += chr(x)
print(flag)
nctf{d3c0mpil1n9_PyC}