PYO - Obfuscator for Python (RENAMED FROM PYO)
Pyo will obfuscate your extensive, real world, multi module Python source code for free! And YOU choose per project what to obfuscate and what not, by editting the config file:
You can recursively exclude all identifiers from certain modules from obfuscation.
You can exclude human readable configuration files containing Python code.
You can use getattr, setattr, exec and eval by excluding the identifiers they use.
You can even obfuscate module file names.
You can run your obfuscated code from any platform.
Download and unzip Pyo into an arbitrary directory of your computer.
You only need the files pyo.py and py_config.txt. They are in the pyo subdirectory of your unzipped Pyo version.
Put pyo.py or a script to launch it in the path of your OS, or simply copy pyo.py to the topdirectory of your project.
For safety, backup your sourcecode and valuable data to an off-line medium.
Put a copy of pyo_config.txt in the top directory of your project.
Adapt it to your needs according to the remarks in pyo_config.txt.
This file only contains plain Python and is exec’ed, so you can do anything clever in it.
Open a command window, go to the top directory of your project and run pyo.py from there.
If the topdirectory of your project is e.g. ../work/project1 then the obfuscation result wil be in ../work/project1_pyo.
Further adapt pyo_config.txt until you’re satisfied with the result.
Type ‘pyo ?’ or ‘python pyo.py ?’ (without the quotes) on the command line to display a help text and the licence.
Obfuscate your Python code only when stricktly needed. Freedom is one of the main benefits of the Python community. In line with this the source of Pyo is not obfuscated.
Example of obfuscated code:
import threading as x_pyo991_x import Tkinter as x_pyo231_x import os from x_pyo912_x import * from x_pyo843_x import * class x_pyo884_x (x_pyo319_x, x_pyo271_x): def __init__ (self): x_pyo319_x.__init__ (self) x_pyo271_x.__init__ (self) self.x_pyo907_x = False self.x_pyo317_x = False self.x_pyo360_x () self.x_pyo889_x = x_pyo231_x.Frame (self.x_pyo981_x) self.x_pyo973_x = x_pyo231_x.Frame (self.x_pyo981_x) self.x_pyo971_x = x_pyo231_x.Frame (self.x_pyo981_x)
A comment after a string literal should be preceded by whitespace.
A ‘ or “ inside a string literal should be escaped with \ rather then doubled.
A # in a string literal can only be used at the start, so use ‘p’’#’’r’ rather than ‘p#r’.
That’s it, enjoy!
Jacques de Hooge
This license governs use of the accompanying software (“Software”), and your use of the Software constitutes acceptance of this license.
You may use the Software for any commercial or noncommercial purpose, including distributing derivative works.
In return, it is required that you agree:
Not to remove any copyright or other notices from the Software.
That if you distribute the Software in source code form you do so only under this license (i.e. you must include a complete copy of this license with your distribution in a plain text file named QQuickLicence.txt), and if you distribute the Software solely in object form you only do so under a license that complies with this license.
That the Software comes “as is”, with no warranties. None whatsoever. This means no express, implied or statutory warranty, including without limitation, warranties of merchantability or fitness for a particular purpose or any warranty of title or non-infringement. Also, you must pass this disclaimer on whenever you distribute the Software or derivative works.
That neither Geatec Engineering nor any contributor to the Software will be liable for any of those types of damages known as indirect, special, consequential, or incidental related to the Software or this license, to the maximum extent the law permits, no matter what legal theory it’s based on. Also, you must pass this limitation of liability on whenever you distribute the Software or derivative works.
That you will not use or cause usage of the Software in safety-critical situations under any circumstances.
That if you sue anyone over patents that you think may apply to the Software for a person’s use of the Software, your license to the Software ends automatically.
That your rights under this License end automatically if you breach it in any way.
That all rights not expressly granted to you in this license are reserved.