9

I have exe build by pyinstaller, so, i unpack it, and now i want unpack file *.pyz, where containing all script files, but filenames without extensions (only file names and is_packet in tuple True\False). Example files list, where return Zlib

BeautifulSoup
ConfigParser
HTMLParser
PyQt4
Queue
StringIO
UserDict
_LWPCookieJar
_MozillaCookieJar
__future__
_abcoll
_strptime
_threading_local

How you can see, files without extensions and all files encrypted. Example this unpacked files: http://www.sendspace.com/file/pky00m

So, how i can decompile it? Thanks

1
  • 3
    a pyz file is a zipped file. Use the archiveviewer.py provided with pyinstaller to view and extract such archives Sep 11, 2013 at 2:35

1 Answer 1

14

I have written a python script which will take a pyinstaller generated exe file and extract its contents including the PYZ file and every thing within

After using that script use Easy Python Decompiler to decompile the generated pyc files.

If you are more interested , I have written a detailed paper on reversing such an application. Here is the link.

http://tuts4you.com/download.php?view.3541

5
  • 1
    How do you determine which decompiled .pyc is the "entry" script, versus all the modules and library files? Feb 2, 2017 at 16:11
  • 1
    @Demonslay335 The entry script is usually located in the root directory within the decompiled folder. It is kept as-is (i.e not pyc compiled) within the CArchive. Hence you can try opening those files in a text editor to find out the one. Feb 2, 2017 at 17:24
  • Looks promising. I get: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 841-842: truncated \UXXXXXXXX escape
    – Tetora
    Nov 18, 2017 at 14:44
  • 2
    Be careful with "Easy Python Decompiler". It may contain "Trojan horse" as an example. I haven't found this software at open source.
    – lol lol
    Feb 21, 2020 at 10:18
  • Well, I can verify that this should be marked as the correct answer. The tools do as described and work very well. Thanks a lot for your efforts!
    – Tjad Clark
    Sep 13, 2020 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.