这个工具折磨了我很久,搭配题目记录一下...
题目


Die

打包工具: PyInstaller
建议下载GitHub的:GitHub - extremecoders-re/pyinstxtractor: PyInstaller Extractor
单独的一个 pyInstaller.py 会很麻烦
步骤:
将exe拖到pyinstxtractor-master文件夹下面,打开cmd
python pyinstxtractor.py ezpy.exe

成功的话会出现一个类似ezpy.exe_extracted这样后缀的文件夹

点进去,能在文件下找到与exe同名的pyc文件

在早些的版本中,XX.exe_extracted文件下,是一个同名的无后缀的文件,需要我们自己补上
注意!!!你要确保使用工具的环境是和Python version一样(我这里是需要3.11)
不然,ezpy.exe_extracted文件夹点进去,类似PYZ-00.pyz_extracted的文件夹会是空的!!

不过文件夹下同名的文件ezpy.pyc倒是不影响反编译成py
我使用的是新版本的pyinstxtractor,不用补magic
在Python3.7及以上版本的编译后二进制文件中,头部除了四字节Magic Number,还有四个字节的空位和八个字节的时间戳+大小信息,后者对文件反编译没有影响,全部填充0即可;
Python3.3 - Python3.7(包含3.3)版本中,只需要Magic Number和八位时间戳+大小信息
Python3.3 以下的版本中,只有Magic Number和四位时间戳。
本题目用uncompyle6反编译会报错(就是这里坑了我很久)
我没有pycdc,所以找了一个线上反编译工具
这里推荐两个(第一个有次数限制,第二个没有):
Pyc 转 Py - 百川在线工具箱 (chaitin.cn)
反编译ezpy.pyc

就是一个base64,肯定是换了表
发现需要 Litctfbase64 模块,这个是出题人自己定义的
去 PYZ-00.pyz_extracted 文件夹中找到
PYZ-00.pyz_extracted
非常重要,一般一个稍微大一点的项目都会分成多个py
文件,甚至会依赖其他模块,这些被依赖的文件解析后都会放入PYZ-00.pyz_extracted
中,可以说这里放的是核心代码。

反编译Litctfbase64.pyc

得到了base64的换表
找一个在线自定义base64编解码网站
推荐:在线自定义base64编解码、在线二进制转可打印字符、在线base2、base4、base8、base16、base32、base64--查错网 (chacuo.net)

flag
LitCTF{61happy_LitCTF_nice_base64}