简体   繁体   中英

can python source code be extracted from a single file executable

I have a Python software that I created using pyinstaller. I used pyinstaller to create a single 60 MB executable file which contains all my module dependencies.

I have used the pyinstaller code:

pyinstaller --noconfirm --onefile --windowed  file.py

I was going to release a beta version of this software to a lot of people I know. I know people can extract the source code if I create a directory containing scripts but will it still be possible for someone to extract the source code from the executable if it is just a single.exe file?

I have looked into using pyarmor and obfuscating my code before creating an executable but that would require sending a folder of some sort when I want to compile everything into a single exe file.

From the documentation

The bundled app does not include any source code. However, PyInstaller bundles compiled Python scripts (.pyc files). These could in principle be decompiled to reveal the logic of your code.

So one can still reverse engineer the code, but it isn't the source code. If you want to see how the bytecode looks like you may use the dis tool .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM