python-exe-unpacker icon indicating copy to clipboard operation
python-exe-unpacker copied to clipboard

source_files is null

Open Dustyposa opened this issue 6 years ago • 8 comments

Hello, when i run pyz file, course an error.

$ python python_exe_unpack.py -p out00-PYZ.pyz
[*] On Python 3.7
Traceback (most recent call last):
  File "python_exe_unpack.py", line 381, in <module>
    main()
  File "python_exe_unpack.py", line 374, in main
    magic_prepend.prepend(prepend_file)
  File "python_exe_unpack.py", line 325, in prepend
    (total, okay, failed, verify_failed) = PythonExectable.decompile_pyc(None, [edited_pyc.name], edited_py_name)
  File "python_exe_unpack.py", line 85, in decompile_pyc
    return uncompyle6.main.main(dir_decompiled, dir_decompiled, pyc_files, None, output_file)
  File "D:\ProgramData\Anaconda3\lib\site-packages\uncompyle6\main.py", line 190, in main
    for source_path in source_files:
TypeError: 'NoneType' object is not iterable

How can i solve it?

Dustyposa avatar Aug 06 '19 09:08 Dustyposa

Any work arounds yet?

delrius-euphoria avatar Dec 17 '20 14:12 delrius-euphoria

Not yet

Dustyposa avatar Dec 21 '20 03:12 Dustyposa

Just dont bother, do it manually. I did it manually.

delrius-euphoria avatar Dec 21 '20 10:12 delrius-euphoria

Just dont bother, do it manually. I did it manually.

Hi, Can you let me know how to do that. I try inserting using hex editior but getting error ImportError: Ill-formed bytecode file d:\Personal\Python\python-exe-unpacker-master\unpacked\main.exe\Main.pyc <class 'ValueError'>; read length must be non-negative or -1

Kannansowmyan avatar Jan 12 '21 07:01 Kannansowmyan

@kannansowayan What did you try? I dont have the code I used, but I used python for this, something simple.

with open('main','rb') as file:

and so on. Its not anything much complicated, though create a backup and also change from main.pyc to main to open with python.

delrius-euphoria avatar Jan 12 '21 11:01 delrius-euphoria

@kannansowayan What did you try? I dont have the code I used, but I used python for this, something simple.

with open('main','rb') as file:

and so on. Its not anything much complicated, though create a backup and also change from main.pyc to main to open with python.

Thanks for the response. I am using uncompyle6 to decompile the file (extracted as part of single .exe file). I had extracted it only as main, but when i try to decompile it gave error, so i added extension .pyc manually. Also based on suggestions in various forums, i tried inserting bytes but still getting one error or other.

I see you are reading the file simple, post that how do you decompile do you use dis or any other library to move from bytecode to actual source?

Kannansowmyan avatar Jan 12 '21 12:01 Kannansowmyan

I used uncompyle6. And then proceeded.

delrius-euphoria avatar Jan 12 '21 13:01 delrius-euphoria

Got the same issue when I tried to decrypt an encrypted file.

[*] Encrypted pyc file is found. Decrypt it? [y/n]y
[-] Exception occured while trying to get the encryption key.

ZM-J avatar Jan 29 '21 07:01 ZM-J