Dotfuscator User's Guide
Dotfuscating the Remoting Output

The remoting sample contains a sample Dotfuscator configuration file that demonstrates using multiple input assemblies and using exclusion rules to exclude the type information for the object invoked through remoting. The multiple input assemblies are indicated in the configuration file with multiple <file> entries in the <input> assemblies list as shown:

Using Multiple Input Assemblies and Exclusion Rules
Copy Code
   <file dir="${projectdir}" name="ITrigFunctions.dll"/>
   <file dir="${projectdir}" name="TrigServer.exe"/>
   <file dir="${projectdir}" name="TrigClient.exe"/>

The other interesting aspect of the configuration file is the renaming exclusion list:

Renaming Exclusion List
Copy Code
   <type name="Samples.Trig" excludetype="true"/>

The <renaming> tag indicates that the exclusion rules contained within pertain specifically to identifier renaming, as opposed to other Dotfuscator features which can also be selectively turned on or off.

The <excludelist> tag defines a list of items that must be excluded from the renaming process. The <type name="Samples.Trig"> tag instructs Dotfuscator to exclude the class name "Samples.Trig" from the renaming process. Note that this only refers to the class name itself. All methods of the “Trig” class are still eligible for renaming. This is acceptable since we are Dotfuscating both the client and the server in this case. If we were creating an interface that was going to be called by clients we did not obfuscate, we would also want to prevent renaming of the interface methods as well. Since we included all assemblies in the same project, Dotfuscator will be able to rename method call references to the appropriate renamed server method call.

Executing the make.bat file will run Dotfuscator with this configuration file. The outputs of this process are TrigServer.exe, TrigClient.exe and ITrigFunctions.dll assemblies in the "output" subdirectory. This location can be controlled by modifying the following section in the configuration file:

Copy Code
  <file dir="${projectdir}\output" />
Note: the 1:1 relationship between input and output assemblies cannot be changed.

Running the new assemblies verifies that Dotfuscator correctly excluded the required items from the renaming process. It is also important to note that since we allowed the renaming of interface methods, it is not possible to have an obfuscated client call a non-obfuscated server or vice-versa.



© 2017 PreEmptive Solutions, LLC. All Rights Reserved.