Bl4ckC4t
Bl4ckC4t

Reputation: 157

Attempting to decompile a python 3.9 .pyc binary

I have been really struggling trying to decompile one python 3.9 .pyc binary. Most tools that i've tried, such as: decompile3, uncompyle6, ..etc seem to all return me the error

ImportError: Unknown magic number 23117

However, one of the tools did work to an extent. It's called python-exe-unpacker (https://github.com/countercept/python-exe-unpacker) and it did manage to unpack the binary partially. Here is the output it gives.

[*] On Python 3.9
[*] Processing File.pyc
[*] Pyinstaller version: 2.1+
[*] This exe is packed using pyinstaller
[*] Unpacking the binary now
[*] Python version: 39
[*] Length of package: 6598404 bytes
[*] Found 31 files in CArchive
[*] Beginning extraction...please standby
[*] Found 232 files in PYZ archive
[*] Successfully extracted pyinstaller exe.

In the unpack folder that it produces it extracts various files, one of which is python39.dll and the supposed source code of the .pyc file, except that it is quite corrupted and you can only read very small and few parts of it (mainly strings and function names). So is there any way in which I might be able to fully decompile it and get the full source code of the application?

Upvotes: 4

Views: 5550

Answers (0)

Related Questions