Python Forum
Identifying if the program I have is python and then decompiling
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Identifying if the program I have is python and then decompiling
#8
(Jun-01-2022, 07:41 PM)DeaD_EyE Wrote: First try, if the program was written with Python and packed with PyInstaller: https://github.com/extremecoders-re/pyinstxtractor

Decompiler for pyc-files:

Python >3.7: https://github.com/rocky/python-decompile3
Python all : https://pypi.org/project/uncompyle6/

Tool to analyze Binary files: https://ghidra-sre.org/


I guess he has taken the easy way. Program written with Python and packed as distribution with PyInstaller.

(Jun-01-2022, 07:41 PM)DeaD_EyE Wrote: First try, if the program was written with Python and packed with PyInstaller: https://github.com/extremecoders-re/pyinstxtractor

Decompiler for pyc-files:

Python >3.7: https://github.com/rocky/python-decompile3
Python all : https://pypi.org/project/uncompyle6/

Tool to analyze Binary files: https://ghidra-sre.org/


I guess he has taken the easy way. Program written with Python and packed as distribution with PyInstaller.

Thanks for your reply. I was hopeful from your post I might be getting somewhere with this. I ran into some snags and Ill relate them to you, maybe something will be of some more help.

First, as I originally mentioned the program in question was written for a Mac. I tried pyinstxtractor but couldn't get it to run on the Mac (I suspect I need to install a full python install, not just use the built in OS version).

So I installed python on a Win10 box. The first thing I noticed is that the program I trying to decompile wouldn't run on the Win10 machine. I assume the packer makes an executable that is platform specific.

after adding an extension .pyo to the file I tried pyinstxtractor again. This is the output

Output:
C:\Users\David>D:\pyinstxtractor.py d:\SA.pyo [+] Processing d:\SA.pyo [+] Pyinstaller version: 2.0 [+] Python version: 309 [+] Length of package: 9419143 bytes Traceback (most recent call last): File "D:\pyinstxtractor.py", line 423, in <module> main() File "D:\pyinstxtractor.py", line 411, in main arch.parseTOC() File "D:\pyinstxtractor.py", line 235, in parseTOC struct.unpack( \ struct.error: unpack requires a buffer of 6906162 bytes
I also tried decompyle3 d:\SA.pyo
Output:
Unknown magic number 64207 in D:\SA.pyo
I installed the Java SDK and ran ghidra-sre. I havent figured out how to use the program but it looks like it is trying to load a project file not a python file. Maybe I'm missing something.

Couldn't figure ut how to install uncompyle6 but I'm pretty fried. Will look at it again tomorrow.

Does any of this information help or give you any more clues?

Thanks
Reply


Messages In This Thread
RE: Identifying if the program I have is python and then decompiling - by jpnyc - Jun-02-2022, 10:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Identifying keywords in text drchips 6 103,850 Mar-29-2022, 12:32 PM
Last Post: snippsat
  trying to put a a filter on identifying a straight CompleteNewb 1 1,683 Dec-01-2021, 11:11 PM
Last Post: CompleteNewb
  Identifying string success flag graham23s 4 3,159 Aug-14-2019, 09:27 PM
Last Post: graham23s
  identifying a dictionary with an attribute? Skaperen 7 3,868 Oct-04-2018, 05:48 AM
Last Post: Skaperen
  Identifying only specific words in a string GilbyScarChest 2 2,723 Aug-08-2018, 03:22 AM
Last Post: GilbyScarChest
  Identifying the value of all adjacent elements in an array JoeB 2 8,677 Nov-23-2017, 05:10 PM
Last Post: JoeB
  Identifying object types microphone_head 5 4,508 Oct-01-2017, 02:04 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020