11. Obfuscation

11.1. Automatic code obfuscation

For automatic obfuscation should set up the program to run it from the command line. This will allow you to add obfuscation in the build server script or just run it, for example, via a shortcut on the desktop.

Settings

-OBF=SIMPLE
enables obfuscation and uses a template (SIMPLE) program settings specifying temporary directories, etc.
[Примечание]Примечание

The following examples and the settings are based on the use of this parameter and its value (-OBF=SIMPLE).

-SOURCEWRITE
allows to overwrite changes to the original files.
-OPENREPORT=OBFUSCATOR
runs in the browser, the report of obfuscation.
-GENERATEREPORTHTMLTOFILE=OBFUSCATOR|filename
saves HTML report OBFUSCATOR in the file. Example: -FILEJUNITWRITE=OBFUSCATOR|c:\example\report.html
-SOURCEFILE=filename
specifies the file name for obfuscation. Possible multiple use of the parameter. You can specify the value in quotes to specify the path to the file contains spaces: -SOURCEFILE="filename"
-SOURCEDIR=dirname
specifies the name of the directory with the files for obfuscation. Possible multiple use of the parameter.
-OBFUSCATESTRINGLENGTHLIMIT=value
specifies the maximum number of characters in a text constant.
-USEOBFUSCATESTRINGLEFTRIGHT
allows the use of functions Left() and Right() (VB.NET) or Substring (C#) for obfuscation of text values.
-SUPPORT
contains the maximum logging settings the program works, and prints log to the screen. This will allow, if you contact support, faster to solve relevant issues. Used only if you experience problems or have questions on the specifics of the code obfuscation program.

The parameters for the server version

If you use a server version of the program it is possible to use a number of special options.

-FILEJUNITWRITE=filename
The file to write the XML report in JUnit format. Example: -FILEJUNITWRITE=c:\example\obf.xml
-AUTHOR=the value
The author of the commit report, etc. at the discretion of the user. Example: -AUTHOR=IvanPetrov
-BUILD=value
The build number(BUILD) on the build server. Note: the digital — in 0..999999999. Example: -BUILD=100
-REVISION=value
The revision number of the source code from the version control system. Note: the digital — in 0..999999999, and the default value is 0. Example: -REVISION=100
-VERSION=value
Number of version of the program. Example: -VERSION=1.0.5

Examples

  • Displays a report for obfuscation without changing the source files for the two files:
sourcelocalizer.exe -OBF=SIMPLE -OPENREPORT=OBFUSCATOR -SOURCEFILE=c:\example\module1.vb -SOURCEFILE=c:\example\module2.vb
  • Displays a report for obfuscation without modifying the original files for the files in the directory and two files:
sourcelocalizer.exe -OBF=SIMPLE -OPENREPORT=OBFUSCATOR -SOURCEFILE=c:\example\module1.vb -SOURCEFILE=c:\example\module2.vb -SOURCEDIR=c:\dev\prog
  • Conducts obfuscation (changing the file) three files and the files in the directory without displaying the report (note the quotation marks to specify the file path contains spaces):
sourcelocalizer.exe -OBF=SIMPLE -SOURCEWRITE -SOURCEFILE=c:\example\module1.vb -SOURCEFILE=c:\example\module2.vb -SOURCEFILE="c:\example of my prog\module1.vb" -SOURCEDIR=c:\dev\prog
  • Conducts obfuscation (changing the files) the two files save the HTML report and the JUnit report files:
sourcelocalizer.exe -OBF=SIMPLE -SOURCEWRITE -SOURCEFILE=c:\example\module1.vb -SOURCEFILE=c:\example\module2.vb -GENERATEREPORTHTMLTOFILE=OBFUSCATOR|c:\example\report.html -FILEJUNITWRITE=c:\example\obf.xml

11.2. Possible errors of obfuscation and correction

In the process of obfuscation, the program will search in the code the variables and replacing their names to obfuscated.

The most common standard names (name, value, tag,..) is already in the ignore list by obfuscation.

To hide the matching variables with standard names (name, value, tag,..) should be renamed, for example, myname, name1, etc.

Maybe a coincidence of names with the names of the rare classes, for example, the function getvaluefromfile may coincide with the function of the plug-in class.

To disallow obfuscation such names should use the file userobfuscateignore.lst in which to make a name forbidden to obfuscation variables (each name on a new line).

Site      PDF      Content