uncompyle6是一個原生python的跨版本反編譯器和fragment反編譯器,是decompyle、uncompyle、uncompyle2等的接替者。
uncompyle6可將python字節碼轉換回等效的python源代碼,它接受python 1.3版到3.8版的字節碼,這其中跨越了24年的python版本,此外還包括Dropbox的Python 2.5字節碼和一些PyPy字節碼。
github項目:https://github.com/rocky/python-uncompyle6
------------------
0x01 安裝
pip install uncompyle6
(事實上,pip install uncompyle2 也會跳到安裝uncompyle6)
0x02 使用
-o outfile必須先寫,例如有一個pcat.pyc,想反編譯輸出文件為pcat.py
uncompyle6 -o pcat.py pcat.pyc
0x03 windows上使用uncompyle6
事實上比uncompyle2容易多了,在windows里pip安裝后,會在%python_home%\Scripts\目錄下生成uncompyle6.exe
所以只要你把%python_home%\Scripts\加入到windows的環境變量里,即可像在linux上般使用uncompyle6命令。