Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Decompiling .pyc files python 2.7 #6

Open
0lam opened this issue Mar 15, 2019 · 0 comments
Open

Error Decompiling .pyc files python 2.7 #6

0lam opened this issue Mar 15, 2019 · 0 comments

Comments

@0lam
Copy link

0lam commented Mar 15, 2019

Hi, thanks for the very useful code.

However, when I ran it I experienced some issues decompiling .pyc files written in python 2.7

First issue I had was with the temp .pyc file that is created in order to prepend the "magic bytes", which generated this output :

Traceback (most recent call last): File "python-exe-unpacker-master\python_exe_unpack.py", line 381, in <module> main() File "python-exe-unpacker-master\python_exe_unpack.py", line 374, in main magic_prepend.prepend(prepend_file) File "python-exe-unpacker-master\python_exe_unpack.py", line 339, in prepend os.remove(edited_pyc.name) WindowsError: [Error 32]

The workaround for me was to replace line 339 in by 'pass' which seemed to solve the issue with the only downside of leaving the temp file in the temp directory. This issue might just come from the way temp files are dealt with in windows.

Second issue, which I think might come from using python 2.7 gives the following output

Traceback (most recent call last): File "python-exe-unpacker-master\python_exe_unpack.py", line 381, in main() File "python-exe-unpacker-master\python_exe_unpack.py", line 374, in main magic_prepend.prepend(prepend_file) File "python-exe-unpacker-master\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-unpacker-master\python_exe_unpack.py", line 85, in decompile_pyc return uncompyle6.main.main(dir_decompiled, dir_decompiled, pyc_files, None, output_file) File "C:\Users\Stage\AppData\Roaming\Python\Python27\site-packages\uncompyle6\main.py", line 112, in main infile = os.path.join(in_base, filename) File "C:\Users\Stage\Anaconda3\envs\decompyle\lib\ntpath.py", line 65, in join result_drive, result_path = splitdrive(path) File "C:\Users\Stage\Anaconda3\envs\decompyle\lib\ntpath.py", line 115, in splitdrive if len(p) > 1: TypeError: object of type 'NoneType' has no len()

The workaround for me was to replace None by an empty string '' on line 325 of the main executable.

Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant