buuctf 逆向pyre
最近看到不少py逆向,记录一道题
下载原件发现是pyc文件,先利用uncompyle生成py文件(之前用py3.8.6的版本下载死活不行,在老学长的帮助下发现uncompyle库不支持最新版本,没办法含泪删掉重下)
下载指令
pip install uncompyle
下载成功后生成py文件,比如想把1.pyc 生成 2.py文件用指令
uncompyle6 1.pyc > 2.py
一般都可以成功,看这道题,用上面的方法得到py文件
# uncompyle6 version 3.7.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)]
# Embedded file name: encode.py
# Compiled at: 2019-08-19 21:01:57
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