PreEmptive Protection - Dotfuscator
Community Edition User Guide

Properties

The Properties screen is used to configure project-wide options. You can access this screen in Dotfuscator Community Edition's navigation tree by selecting (Project Name) > Properties. The options are divided among six tabbed views, though the features of three tabs are exclusive to Dotfuscator Professional Edition.

Project Properties Tab

Project Properties can be thought of as simple string substitution macros that may be used wherever a filename or path is required. The Project Properties screen is where you can view, delete, and manually add user-defined name/value pairs as Project Properties and to view External Properties. External properties are those either defined by Dotfuscator (e.g. configdir, appdatadir) or those passed on the command line via the /p switch. Project Properties are especially useful in creating obfuscation build templates to support multiple project configurations. Properties are referenced with the following syntax:

Property Reference Syntax

${property_name}

Property references are case sensitive, therefore ${MyProjectDir} references a different property than does ${myprojectdir}. Property references are interpreted literally and may not be nested. Currently, property references may only be used as values in the dir or name attributes of the <file> element, such as in the path that defines an Input.

Dotfuscator uses the following algorithm to find a value associated with the property:

  • Check the external property list for a value.
  • If not found, check for an environment variable with the same name as the property.
  • If not found, check for a project property.
  • If still not found, use the empty string as the value.

External Properties

The External Properties section is a read-only table listing external properties that Dotfuscator defines. For each row, the Property column contains the name of the property, and the Value column contains the value of that property. Dotfuscator defines the following three Properties and Values:

  • applicationdir reflects Dotfuscator's installation directory, where the Dotfuscator application files are located.
  • appdatadir reflects Dotfuscator's local data directory.
  • configdir reflects the directory in which the current project's file resides.

Project Properties

The Project Properties section allows for the definition and assignment of arbitrary additional properties that will be used during the build process. These properties will be evaluated in the same manner as the external properties. In the above example, projectdir is the Property and myproject is the Value of the Property.

Assembly Load Paths Tab

When Dotfuscator builds a project, it needs to load assemblies referenced by the input assemblies in order to discover information about referenced types. Dotfuscator typically uses similar rules to other .NET tools when discovering these assemblies.

However, in Dotfuscator Professional Edition, you can also specify custom locations to look for referenced assemblies. This means it's possible to build a Dotfuscator project that references third-party assemblies, without having to include those assemblies in the project.

This feature is not available in Dotfuscator Community Edition, so this tab instead notes that the feature is exclusive to Professional Edition.

Feature Map Strings Tab

As part of Declarative Obfuscation, Dotfuscator recognizes various strings that can be used in the Feature property of the ObfuscationAttribute:

  • "renaming" indicates to Dotfuscator that the attribute specifies instructions for the renaming feature of Dotfuscator.
    • "all" and "default" are aliases of "renaming".

You can add additional strings for Dotfuscator to recognize in the Feature Map Strings tab.

To add a string, double-click the open cell in the Map string column and enter the string. Then, select the features that this string will correspond to.

For instance, in the Dotfuscator project of the above screenshot, the string "testmode" will indicate to Dotfuscator that an attribute specifies instructions for its renaming feature. The two pieces of code below are equivalent:

Use of "renaming" feature string:

[System.Reflection.Obfuscation(Exclude=true, Feature="renaming")]
public void CalledFromReflection(int someValue) {

Use of "testmode" map string:

[System.Reflection.Obfuscation(Exclude=true, Feature="testmode")]
public void CalledFromReflection(int someValue) {

In Dotfuscator Community Edition, renaming is the only available feature. Dotfuscator Professional Edition supports additional obfuscation features, and thus supports additional meanings for a Map String.

Build Settings

This is where you set general settings for the Dotfuscator project, including the output directory and the verbosity of the Build Output panel.

Directories

In the Directories section, you may configure two directory values either by manually typing a path, or by browsing with the "..." buttons.

  • Temporary directory: Optional. Specifies a directory for temporary files to be placed when Dotfuscator builds the project. If unspecified, a temporary directory provided by the OS is used.

  • Destination directory: Required. Specifies the directory to which Dotfuscator will write modified assemblies and packages. If the directory does not exist, Dotfuscator will create it. Defaults to ${configdir}\Dotfuscated; that is, a subdirectory of the directory in which the Dotfuscator project file is defined, named Dotfuscated.

Build Configuration

In the Build configuration section, you may configure options related to the Dotfuscator build in general.

  • Investigate only: If enabled, no assemblies or packages will be written out. This allows you do a "dry run" of the Dotfuscator project, as well as create map files or reports without needing to generate modified assemblies.

  • Emit debugging symbols: If enabled, debug information (e.g., .pdb files) from the input assemblies and packages will be included in the output.

    • Cannot be enabled in Community Edition.
  • Build output verbosity: Choose how much information is displayed in the Build Output pane:

    • "Quiet": Less build information is displayed than normal.

    • "Default": Normal build information is displayed.

    • "Verbose": Additional build information is displayed, including the output of calls to SDK tools. Useful if you are attempting to fine-tune your results.

Global Obfuscation Settings

In the Global obfuscation settings section, you may configure options related to obfuscation.

  • Inherit obfuscation attributes: If enabled, any use of an Obfuscation Attribute on a type will also apply to its derived types, and any use of Obfuscation Attribute on a method will also apply to methods that override it.

  • Smart obfuscation: If enabled, Smart Obfuscation will be used.

  • Smart obfuscation reporting: Choose how much information from Smart Obfuscation is reported:

    • "All": Both warnings and information will be displayed.

    • "Warnings only": Warnings will be displayed.

    • "None": No messages from Smart Obfuscation will be displayed.

Build Events

In Dotfuscator Professional Edition, a Dotfuscator project can be configured to run arbitrary Windows commands before and after Dotfuscator's processing. This is helpful when integrating Dotfuscator into a build pipeline.

This feature is not available in Dotfuscator Community Edition, so this tab instead notes that the feature is exclusive to Professional Edition.

Signing

When Dotfuscator processes a strong-named input assembly, or one that is digitally signed via Authenticode, the signature information is not included in the output assembly. Dotfuscator Professional Edition offers the ability to automatically re-sign these types of assemblies after processing.

This feature is not available in Dotfuscator Community Edition, so this tab instead notes that the feature is exclusive to Professional Edition.

Note: All versions of Dotfuscator support re-signing of certain input packages, such as .appx files. To configure this, use the package properties dialog on the appropriate input on the Input screen.



Dotfuscator Version 5.27.0.4713. Copyright © 2017 PreEmptive Solutions, LLC