我正在尝试完全反编译我使用 Pyinstaller 制作的 EXE 文件。我正在使用一个名为 pyinstxtractor 又名 PyInstallerExtractor 的工具来调试 EXE。我正在尝试将调试器的输出转换为 PYC 文件,但是当我将调试器输出中当前 PYC 文件中的幻数添加到我要转换为 PYC 文件的输出时,我认为该文件已损坏,就像我做错了一样。我认为这是因为我使用 uncompyle6 将 PYC 文件转换回 Python 代码我收到此错误:
# path . must point to a Python source that can be compiled, or Python bytecode (.pyc, .pyo)
File '-o' doesn't exist. Skipped
Traceback (most recent call last):
File "C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py", line 293, in load_module_from_file_object
co = marshal.loads(bytecode)
ValueError: bad marshal data (unknown type code)
Traceback (most recent call last):
File "C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py", line 293, in load_module_from_file_object
co = marshal.loads(bytecode)
ValueError: bad marshal data (unknown type code)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\deanm\anaconda3\Scripts\uncompyle6-script.py", line 33, in <module>
sys.exit(load_entry_point('uncompyle6==3.7.4', 'console_scripts', 'uncompyle6')())
File "C:\Users\deanm\anaconda3\lib\site-packages\uncompyle6-3.7.4-py3.8.egg\uncompyle6\bin\uncompile.py", line 193, in main_bin
File "C:\Users\deanm\anaconda3\lib\site-packages\uncompyle6-3.7.4-py3.8.egg\uncompyle6\main.py", line 316, in main
File "C:\Users\deanm\anaconda3\lib\site-packages\uncompyle6-3.7.4-py3.8.egg\uncompyle6\main.py", line 183, in decompile_file
File "C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py", line 163, in load_module
return load_module_from_file_object(
File "C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py", line 306, in load_module_from_file_object
raise ImportError(
ImportError: Ill-formed bytecode file test_decompile.pyc
<class 'ValueError'>; bad marshal data (unknown type code)
以下是我尝试将调试器输出转换为 PYC 文件的屏幕截图(按从复制到粘贴的顺序):
我也遇到同样的问题,请问你解决了吗?