编程语言
首页 > 编程语言> > 攻防世界_Re_新手区_python-trade

攻防世界_Re_新手区_python-trade

作者:互联网

pyc文件,使用EasyPythonDecompiler反汇编

得到源码

# Embedded file name: 1.py
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'

直接上脚本8

import base64
correct = 'XlNkVmtUI1MgXWBZXCFeKY+AaXNt'
x=base64.b64decode(correct)
for i in x:
  s=(int(i)-16)^32
  print(chr(s),end='')

flag
nctf{d3c0mpil1n9_PyC}

标签:python,XlNkVmtUI1MgXWBZXCFeKY,base64,trade,Re,flag,print,message,correct
来源: https://www.cnblogs.com/1ucky/p/16161204.html