停止 Python exe 脚本转换回来
Stop Python exe script from converting back
例如,我有一个这样的 Python 文件:
print("Hello World")
现在我正在使用 pyinstaller 将它转换为 .exe 文件。
但是我找到了一个方法把它转换回来:
Use pyinstxtractor.py:
python pyinstxtractor.py yourFileName.exe
This will extract .exe and create a folder named yourFileName.exe_extracted.
Inside the yourFileName.exe_extracted folder, find the file without
any extension.
Edit it with HxD editor and from any pycache file created with the
same version of Python, copy the first row and insert it into your
file.
Save and Rename the file with .pyc extension.
Decompile the compiled bytecode (.pyc) to .py using any online tool,
like https://www.toolnb.com/tools-lang-en/pyc.html
有什么方法可以防止将 .exe 文件转换回他的 .py 文件吗?
谢谢。
您可以使用 PyArmor 等混淆工具,并至少为原始 python 脚本添加一定程度的代码保护。
PyArmor 的官方文档在此处提供了更多相关信息https://pyarmor.readthedocs.io/en/latest/advanced.html#bundle-obfuscated-scripts-to-one-executable-file
例如,我有一个这样的 Python 文件:
print("Hello World")
现在我正在使用 pyinstaller 将它转换为 .exe 文件。
但是我找到了一个方法把它转换回来:
Use pyinstxtractor.py:
python pyinstxtractor.py yourFileName.exe
This will extract .exe and create a folder named yourFileName.exe_extracted.Inside the yourFileName.exe_extracted folder, find the file without any extension.
Edit it with HxD editor and from any pycache file created with the same version of Python, copy the first row and insert it into your file.
Save and Rename the file with .pyc extension.
Decompile the compiled bytecode (.pyc) to .py using any online tool, like https://www.toolnb.com/tools-lang-en/pyc.html
有什么方法可以防止将 .exe 文件转换回他的 .py 文件吗?
谢谢。
您可以使用 PyArmor 等混淆工具,并至少为原始 python 脚本添加一定程度的代码保护。
PyArmor 的官方文档在此处提供了更多相关信息https://pyarmor.readthedocs.io/en/latest/advanced.html#bundle-obfuscated-scripts-to-one-executable-file