Renaming

Dd551425.collapse(en-us,VS.110).gif Dd551425.expand(en-us,VS.110).gif Dd551425.copycode(en-us,VS.110).gif Dd551425.copycodeHighlight(en-us,VS.110).gif Dd551425.drpdown(en-us,VS.110).gif Dd551425.drpdown_orange(en-us,VS.110).gif
PreEmptive Dotfuscator and Analytics Community Edition 5.5
Renaming
www.preemptive.com

Glossary Item Box

The Renaming editor displays four configuration tabs: the Getting Started tab, which describes various application protection features and explains how to configure renaming settings and exclusions; the Exclusions tab, which is used to graphically set custom exclusion rules; the Options tab, which is used to configure other options related to renaming; and the Built-in Rules tab, which displays pre-configured renaming exclusion rules that apply to specific application types or technologies.

Renaming Exclusions

Dd551425.renaming_exclusions(en-us,VS.110).png

The Renaming Exclusions tab lets you determine which parts of your program are to be excluded from the renaming process.  You may exclude specific items from renaming by browsing the navigation tree and checking those items.

The Rename Exclusions Tab gives you complete granular control over all parts of your program that you may wish to exclude from the renaming process.

You may exclude specific items from renaming by browsing the tree view of your application and checking the items you want to exclude. In addition, you may visually create your own custom rules for selecting multiple items for exclusion.

Custom rules can be defined to exclude larger selections of items without requiring you to individually select them for exclusion in the treeview.  Rules can be defined to exclude namespaces, classes, methods, properties, events, and fields based on their name.  Additionally, a Regular Expression can be used to provide a way to specify a pattern with any items that match that pattern from being excluded from obfuscation.

To help you fine-tune your exclusion rules, you can preview their cumulative effects at any time by clicking the Preview button. The application tree view shades all items selected for exclusion.

To preview a specific rule, right click on the rule whose effects you wish to see, select Preview, and Dotfuscator highlights items that will be excluded due to that rule.

Excluding a namespace will exclude all types and their members in the specified namespace.  To exclude a namespace select the Add Namespace button and enter the name of the namespace you wish to exclude in the Name field.  If you wish to use a regular expression to match multiple namespaces ensure that the Regular Expression box is checked and that the Name field contains the regular expression you wish to match against.

Types can be excluded by either matching only on their names or by optionally including a set of attribute specifiers that will further restrict the types excluded from renaming.  Nested classes can be excluded by using a backslash "\" as a delimiter between the outer and inner class.  By checking the Regular Expression box the value in the Name field will be matched as a regular expression rather than a literal string when determining which items to exclude from obfuscation.  Type exclusion can follow inheritance rules. If the Apply to Derived Types option is selected then the exclusion rule will additionally be applied to the matched types and any types that inherit from them. 

A number of other exclusion options are available and are defined as child rules to a containing type rule.  To create a child rule right click on the type rule you wish to enhance and select the particular child rule implementation you wish to add.

Rules to exclude methods, fields, properties, and events are set by creating a type rule for the type(s) that contain those items and adding a child rule for the appropriate item.  As with namespaces and types, the exclusion of other items can be based on their literal name or a regular expression. 

Types, methods, fields, and properties can be selected for exclusion by annotating them with custom attributes, then creating a type exclusion rule containing a CustomAttribute child rule.  Matching on the name of the CustomAttribute is used to determine if an item should be excluded and regular expression matching logic will be implemented if the Regular Expression option is selected.  Exclusion by custom attribute can also be propagated down the inheritance hierarchy by using the Allow Inheritance option which additionally excludes any subtypes or overriding methods and properties with the specified attribute.

Supertypes can also be excluded from obfuscation by adding a supertype child rule to a type rule definition.  An item is excluded from obfuscation if it inherits from one or more supertypes that match the supertype exclusion condition.

In order to specify that an exclusion rule apply only to a method, field, property, event, supertype, or custom attribute and to include the containing type in obfuscation, select the Exclude Type option when defining the type rule.  This option leaves the type included for renaming purposes and only evaluates the child rules.

Renaming Built-in Rules

Dd551425.renaming_builtinrules(en-us,VS.110).png

The Renaming Built-in Rules tab displays pre-configured renaming exclusion rules that apply to specific application types or technologies.  Each rule has a description that displays on the screen when the rule is selected.  You can apply a built-in rule to your project by checking it. 

Renaming Options

The Renaming Options tab is used to set renaming options and to identify map file output options.  The Renaming Options section contains configuration settings that control how renaming is performed.

Dd551425.renaming_options(en-us,VS.110).png

  • Enable renaming - Select this to enable renaming. You may also right click on Renaming in the navigation tree and check Enable to enable renaming. Likewise, if renaming is enabled, you may disable it by right clicking on Renaming in the navigation tree and unchecking Enable.  If this option is unchecked, Dotfuscator will not perform renaming when your project is built.
  • Ensure compatibility with XML serializer - Select this to configure renaming in such a way as to allow XML serialization.
  • Introduce explicit method overrides when renaming - Select this to allow overriding methods to have different names from those of the methods they override. 

You may also select the appropriate Namespace handling options:

  • Flatten and rename removes the namespaces.
  • Rename only renames the namespaces, but keeps the hierarchy.
  • Preserve keeps the namespaces exactly as they are in the input assembly.

The Output map section is where the destination of the output map file is set.  You also have the option of overwriting the output file each time you build the application without generating a backup of any existing map files.

 

 

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft