Pyinstaller Extractorは、Pyinstaller生成された実行可能ファイルの内容を抽出するPythonスクリプトです。
PYCファイルのヘッダーは自動的に固定されているため、Python Bytecode Decompilerがそれを認識します。スクリプトは、Python 2.xと3.xの両方で実行できます。 Pyinstallerバージョン2.0、2.1、3.0、3.1、3.2、3.3、3.4、3.5、3.6、4.0、4.1、4.2、4.3、4.4、4.5、4.5.1、4.6、4.7、4.8、4.9、4.10、5.0、5.0.1、5.1、5.1、5.2、5.3、5.4、5.4.1、5.5、5.6、5.6、5.6.2。 5.8.0、5.9.0、5.10.0、5.10.1、5.11.0、5.12.0、5.13.0、5.13.1、5.13.2、6.0.0、6.1.0、6.2.0、6.3.0、6.4.0、6.5.0、6.6.0、6.7.0、6.8.0、6.9.0、6.9.0.0、6.11.0、6.1.1.1.おそらく他のバージョンでも動作するでしょう。
このプロジェクトはもともとSourceForgeでホストされていました。
スクリプトは、引数としてexeの名前を渡すことで実行できます。
$ python pyinstxtractor.py <filename>
X:>python pyinstxtractor.py <filename>
実行可能ファイルを生成するために使用された同じバージョンのPythonでスクリプトを実行することをお勧めします。これは、PYZアーカイブを抽出しながら、非群れのエラー(もしあれば)を防ぐためです。
X:> python pyinstxtractor.py test.exe
[+] Processing disttest.exe
[+] Pyinstaller version: 2.1+
[+] Python version: 36
[+] Length of package: 5612452 bytes
[+] Found 59 files in CArchive
[+] Beginning extraction...please standby
[+] Possible entry point: pyiboot01_bootstrap.pyc
[+] Possible entry point: test.pyc
[+] Found 133 files in PYZ archive
[+] Successfully extracted pyinstaller archive: disttest.exe
You can now use a python decompiler on the pyc files within the extracted directory
PYCを抽出した後、Uncompyle6やDecompyle ++などのPython Decompilerを使用できます。
X:> uncompyle6.exe test.exe_extractedtest.pyc
X:> uncompyle6.exe test.exe_extractedPYZ-00.pyz_extracted__future__.pyc
pyinstxtractorは、他のツールを必要とせずにLinux Elfバイナリをネイティブに抽出できます。
他の質問や情報については、WikiとFAQをご覧ください
GNU一般公開ライセンスv3.0