title: Python Debugged EXE Output to PYC <class 'ValueError'>; bad marshal data (unknown type code) Error
body: <p>I am trying to completely de-compile an EXE file I made using <em>Pyinstaller</em>. I am using a tool called <em>pyinstxtractor</em> AKA <em>PyInstallerExtractor</em> to debug the EXE. I am trying to convert the output of the debugger to a PYC file, but when I prepend the magic numbers from a current PYC file within the output of the debugger to the output I am converting to a PYC file I think the file gets corrupt, like I am doing it wrong. The reason I think this is because I am using <em>uncompyle6</em> to convert the PYC file back to Python code I get this error:</p>
  <pre><code># 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 &quot;C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py&quot;, 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 &quot;C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py&quot;, 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 &quot;C:\Users\deanm\anaconda3\Scripts\uncompyle6-script.py&quot;, line 33, in &lt;module&gt;
      sys.exit(load_entry_point('uncompyle6==3.7.4', 'console_scripts', 'uncompyle6')())
    File &quot;C:\Users\deanm\anaconda3\lib\site-packages\uncompyle6-3.7.4-py3.8.egg\uncompyle6\bin\uncompile.py&quot;, line 193, in main_bin
    File &quot;C:\Users\deanm\anaconda3\lib\site-packages\uncompyle6-3.7.4-py3.8.egg\uncompyle6\main.py&quot;, line 316, in main
    File &quot;C:\Users\deanm\anaconda3\lib\site-packages\uncompyle6-3.7.4-py3.8.egg\uncompyle6\main.py&quot;, line 183, in decompile_file
    File &quot;C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py&quot;, line 163, in load_module
      return load_module_from_file_object(
    File &quot;C:\Users\deanm\anaconda3\lib\site-packages\xdis-5.0.7-py3.8.egg\xdis\load.py&quot;, line 306, in load_module_from_file_object
      raise ImportError(
  ImportError: Ill-formed bytecode file test_decompile.pyc
  &lt;class 'ValueError'&gt;; bad marshal data (unknown type code)
  </code></pre>
  <p>Here are screenshots of me attempting to convert the debugger output to a PYC file (in order from copy to paste):</p>
  <p><a href="https://i.stack.imgur.com/hRWkq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hRWkq.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/AVDqu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AVDqu.png" alt="enter image description here" /></a></p>