1

I have decompiled exe using pyextractor script and generated these files:

PYZ-00.pyz
PYZ-00.pyz_extracted
gui
pyi_rth_tkinter
pyi_rth_multiprocessing
pyi_rth_pkgres
pyi_rth_win32comgenpy
pyiboot01_bootstrap
pyimod01_os_path
pyimod02_archive
pyimod03_importers
struc

I know that gui is the entry file. After updating header of gui , decompiled it to gui.py file. (my process is similar to this one https://hshrzd.wordpress.com/2018/01/26/solving-a-pyinstaller-compiled-crackme/)

My question is how to generate exe file so that it contains all the files from PYZ-00.pyz_extracted folder?

1

You can extract some file from .exe using pyi-archive_viewer, modify them and put back. But be attention, all files in .exe are compressed using DEFLATE (zlib.compress() - you can watch this in source code of PyInstaller). So, when putting back you need compress file to the exact size, that was when you extracted it.

  • Hi van, and welcome to RE.SE! Although your answer does seem to cover most of the question, I think it could quite benefit additional information and details, if you feel like doing that. Regardless, thanks for sharing your knowledge and I hope we see you more :) – NirIzr Jan 13 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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