如何反编译由 Python 生成的 EXE

这取决于代码是用 py2exe 还是 pyinstaller 生成的。

对于 py2exe,你可以使用 unpy2exedecompile-py2exe。我最终没有使用这些,因为我的 exe 是 PyInstaller 的。

对于 PyInstaller,使用 pyinstxtractor

使用后,我得到了一堆内置模块的 pyd 文件,以及主脚本的 pyc 文件。你可以用 uncompyle6decompyle3 反编译 pyc 文件,但我使用了免费在线服务 pylingual.io,效果非常好。


Check out similar posts by category: Python