- Please consult the Guide on Protection with Stunnix Obfuscator without using Project Manager for information on changes that may be needed to adapt your projects for protection.
- Start Project Manager
- Click Project, New.
- Enter the project input directory - a root directory where all files and subdirectories of the project will reside.
- Enter output directory and the state files directory; it's recommended to use relative paths in order to not edit the project options once you will need to move your project to different directories for whatever reason.
- Specify project files type. This will help with automatic detection of options your project should be protected with.
- Go to Project, Files to ensure the file types are detected correctly.
- Use only if you are protecting Perl code (using Perl-Obfus): Go to Symbols, Get list of symbols from external modules, copy the list you'll be protecting, and paste it into "Symbols, User-Specified exceptions".
- Use only if you are protecting C/C++ code (using CXX-Obfus): Go to Symbols, Select which common header files to load, to see whether the proper category has been assigned to the header files found in your project. This is important since the categories corresponding to exceptions are activated automatically for all source files in your project.
- If you are protecting everything but Perl code (i.e. not using Perl-Obfus, but are using CXX-Obfus or JS-Obfus): You can put all 3rd-party libraries you use in your code (or header files defining their APIs, in case of C/C++) to the same directory. Simply go to Tools, Extract symbols from directory with source files, enter the name of that directory, select symbol types you wish to gather, and get the list of symbols defined in that directory. Cut them, then paste to "Symbols, User-Specified exceptions".
- Go to Build, Rebuild all. Your project will be built with debug settings. All symbols that are subject to protection will be renamed by adding the same prefix to each of them (in order to allow for trivial error detection).
- Go to Symbols, View Symbol mapping and check that no symbols you didn't want to be mangled are listed there. If they are, go to Symbols, User-Specified Exceptions and enter the symbols that should not be changed by listing them one per line.
- Clear state files after modifying the set of exceptions; otherwise "Symbols and View Symbol Mapping" will not be updated.
- Test that your protected project works as the original one; if it doesn't, list more necessary symbols as exceptions in "Symbols", User-Specified Exceptions".
- Repeat the previous 4 steps until successful.
- Go to Settings, "Select preset for code mangling.." and select a production profile you wish to apply to your project and click Save.
- Go to "Build ⇒ Clear output & State files" to clear all symbol mapping accumulated. This will also force the rebuilding of all files with new options. Then go to "Build ⇒ Rebuild changed" to rebuild everything.
- Your product will then be ready for shipping.
- It's possible to edit a set of exceptions using your favourite editor. Go to the corresponding page in the Symbols menu and read the name of the file to edit at the bottom of the project.
- Building project using command line
It's possible to generate a commandline script (or .bat file for Windows)
that will perform all operations available
via the Build menu by going to "Project ⇒ Export as buildscript" or "Project ⇒ Export as .bat file".
You will have to regenerate the script every time you change the options of some modes or add or remove some files from
your project (no update of the script is necessary if you just edit set of exceptions).
The documentation on using generated buildscripts is available here - it lists all command line flags it supports.
- If you need running obfuscator directly from command line
- go to "Tools ⇒ Configure command line tools.." to install aliases to command line backends to a directory listed in your PATH environment variable. This way you won't have to type full path to command line tools. Use "Tools ⇒ Command line builder" to generate command lines.