python-uncompyle反编译

python的编译后文件pyc,可以将pyc文件反编译为py文件。

相应的工具:uncompyle

github地址:https://github.com/rocky/python-uncompyle6/

安装:pip install uncompyle

安装好后,注意执行的命令为uncompyle6,而不是uncompyle

查看帮助命令:uncompyle6 --helpuncompyle6 -h

反编译单个文件 :uncompyle6 foo.pyc > foo.py

反编译多个文件:uncompyle6 -o . *.pyc

例子:


uncompyle6 foo.pyc bar.pyc  # decompile foo.pyc, bar.pyc to stdout

uncompyle6 -o . foo.pyc bar.pyc  # decompile to ./foo.py and ./bar.py

uncompyle6 -o . *.pyc # decompile *.pyc to *.py

你可能感兴趣的:(python-uncompyle反编译)