Confusator - simple source code obfuscator
Confusator implements a simple solution to obfuscate your source code. Since the applications made with JAVA, Flash, Javascript, etc, can be easily decompiled, obfuscation becomes a basic protection method to make your source code unreadable.
Confusator is a command-line console application made with Java. To simplify its usage there are 3 ".bat" files which execute a JAR file. You need to have a Java JRE installed and configured on your computer.
Please read this manual before using the program.
Simple workflow:
1. Extract Zip-archive
2. Run "generate.bat" to create folders and files
3. Copy some source files into "source_folder" under Confusator directory.
4. Run "generate.bat" once again to generate words in the "obfuscate_words.txt"
5. Edit and save "obfuscate_words.txt" to remove words (variables, functions, names of flash objects, etc.) that you would not obfuscate.
6. Run "obfuscate.bat"
7. Check the "output_folder" under Confusator directory for the obfuscated source code.
Command line syntax:
java -jar Confusator.jar action=generate
Available action:
generate
regenerate
obfuscate
Technically Confusator is based on JAVA Regex functions and searches the whole words with or without search patterns.
File config.ini contains runtime parameters of Confusator
Minimal word length to search (default: 2)
minimal_word_length=2
List of words to be obfuscated. This file will be generated with action commands "generate" and "regenerate". If you have changed the search parameters, action "generate" will add new founded words.
Action "regenerate" will replace the list with the new words.
obfuscate_words=D:\Confusator\obfuscate_words.txt
While obfuscating, Confusator will create random strings for your obfuscate words list, however you can define all or some of them directly in the "obfuscate_words" file using comma delimitation format
Example: _myVariableName,toto
This will be kept untouched until you use "regenerate" action.
All comments will be removed from your source code
strip_comments=true
All white spaces will be removed from your source code. However, this will work along with stripping of comments only.
strip_white_space=true
List of your words that have to rest unchanged.
user_reserved_words= D:\Confusator\user_reserved_words.txt
List of reserved words (Confusator comes with Flash AS reserved words list)
reserved_words= D:\Confusator\reserved_words.txt
Path to the output folder
output_folder= D:\Confusator\output_folder
Path to the source folder
source_folder=D:\Projects\MyProject01\src\com
Source and output folders have to be different!
Output folder could not be a part of the source folder!
File extensions that have to be used while search (default: as|asc)
file_extensions=as|asc
Search patterns (put comment # to skip pattern). If you decide to prefix the names of private variables or functions by "_" (_myVariable), Confusator will lookup for the prefixed words only.
end_pattern=_
start_pattern=_
Regex pattern to be used while search. This example will search for all words beginning with "va" and ending by "_p" (value_p, val_p)
search_pattern=\b(va)\w+(_p)\b
Action command "obfuscate" will try to process all files in source folder. Check output folder for the results.
From author: In a normal workflow with AS3 I prefix all private variables in classes with "_", all local variables and private functions with suffix "_". This approach will export only the predefined words. To refactor the existing source code you can use some special plugins for your development tools or even use Confusator with "obfuscate_words" file containing replacement chains for refactoring:
myVariableName,myVariableName_
myFunctionName,myFunctionName_
Also, you can export all words and edit the "obfuscate_words" file.

