WithSecureLabs / python-exe-unpacker

A helper script for unpacking and decompiling EXEs compiled from python code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

source_files is null

Dustyposa opened this issue · 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?

Any work arounds yet?

Not yet

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

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

@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.

@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?

I used uncompyle6. And then proceeded.

commented

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.