Supplementing or Overriding a Configuration File from the Command Line
Dotfuscator has the unique ability to accept a complete or partial configuration file, yet allow you to supplement or override its options from the command line. This allows you to quickly adjust and tweak settings using a standard configuration file as a template.
Command Line Option | Configuration File Option | Notes |
---|---|---|
/in <file>[,<file>] | "input" section | adds |
/out: <directory> | "output" section | overrides |
/honor:[on|off*] | “inputassembly” section | overrides |
/strip:[on|off*] | “inputassembly” section | overrides |
/disable | Sets "disable" option in "renaming", "controlflow", "stringencrypt", and "removal" sections | overrides |
/rename:[on:off] | Sets (or unsets) "disable" option in "renaming" section. | overrides |
/mapout:<file> | "mapoutput" section | overrides |
/clobbermap:[on|off] | "overwrite" attribute in "mapoutput" section | overrides |
/keep:[namespace|hierarchy|none] | Sets (or unsets) renaming options: "keepnamespace", "keephierarchy" | overrides |
Examples:
The following examples use this configuration file that enables renaming with an output mapping file. It is referenced as "myconfig.xml" in the examples.
<?xml version="1.0"?> <!DOCTYPE dotfuscator SYSTEM "https://www.preemptive.com/dotfuscator/dtd/dotfuscator_v2.1.dtd"> <dotfuscator version="2.1"> <renaming> <mapping> <mapoutput overwrite="true"> <file dir="${configdir}\reports" name="MyMap.xml"/> </mapoutput> </mapping> </renaming> </dotfuscator>
FakePre-54b0d0a0b17848f4ac80f9070bf41baf-138019093f3e4d75803df092be88a2ac
This command specifies my.dll as an input assembly in library mode (because of the DLL extension), and applies the renaming options in the configuration file. In this case, control flow, string encryption, and pruning are disabled because they are implicitly disabled in the configuration file.
The output DLL will go in a directory called ".\Dotfuscated", since an output is not specified in the configuration file or on the command line.
dotfuscator -in:my.dll -keep:namespace myconfig.xml
This command also specifies my.dll as an input assembly. In addition, it tells the renamer to keep namespaces.
© 2002-2007 PreEmptive Solutions. All rights reserved.