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

Unable to extract key

KenJyn76 opened this issue · comments

I've been trying to debug this for a little while now, but I'm not all too familiar with Python nowadays. Running the unpacker decompiles everything fine, but it's unable to decrypt the files that come out. The key file is there, and I can extract the key myself manually, but the unpacker is mixing up a variable type somewhere. Here's the traceback:


[-] Exception occured while trying to get the encryption key.
Traceback (most recent call last):
  File "D:\Tools\Python EXE Unpacker\python_exe_unpack.py", line 163, in __get_encryption_key
    (total, okay, failed, verify_failed) = PythonExectable.decompile_pyc(None, [encrypted_key_path_pyc], encrypted_key_path_py)
  File "D:\Tools\Python EXE Unpacker\python_exe_unpack.py", line 85, in decompile_pyc
    return uncompyle6.main.main(dir_decompiled, dir_decompiled, pyc_files, None, None, None, False, False, False, False, False)
  File "C:\Python37\lib\site-packages\uncompyle6\main.py", line 176, in main
    infile = os.path.join(in_base, filename)
  File "C:\Python37\lib\ntpath.py", line 76, in join
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Tools\Python EXE Unpacker\python_exe_unpack.py", line 381, in <module>
    main()
  File "D:\Tools\Python EXE Unpacker\python_exe_unpack.py", line 364, in main
    pyinstaller.unpacked(file_name)
  File "D:\Tools\Python EXE Unpacker\python_exe_unpack.py", line 244, in unpacked
    self.__decrypt()
  File "D:\Tools\Python EXE Unpacker\python_exe_unpack.py", line 227, in __decrypt
    encryption_key = self.__get_encryption_key(encrypted_key_path)
  File "D:\Tools\Python EXE Unpacker\python_exe_unpack.py", line 177, in __get_encryption_key
    print("[-] Error message: {0}".format(e.message))
AttributeError: 'TypeError' object has no attribute 'message'