Skip to Content
New release 11.5 available 🎉
ObfuscatorMSBuild TaskBabel Task Reference

Babel Task Reference

The Babel task has various attributes that allow you to configure the obfuscation process. These attributes control the command-line options available to the babel tool.

Miscellaneous

Task AttributeTypeDescription
LicenseStringFull path to the license file or list of license file search directories
DbgHelpDllDirStringSet the path to the dbghelp.dll
DetectIfObfuscatedStringThe action to take if the target assembly is already obfuscated
EnableObfuscationAgentBooleanWhether to enable the obfuscation Agent
NoConfigBooleanWhether to ignore configuration file
NoWarningsStringList of warning message codes to ignore
QuickRulesStringQuick rule definitions (see Command Line Reference)
RandomSeedStringInitialize the random number generator used during obfuscation
SatelliteAssembliesStringList of satellite assembly files
SearchSatelliteAssembliesBooleanWhether to enable the search of satellite assemblies
SearchDirectoriesStringList of assembly search directories
ShowLogoBooleanOutputs Babel copyright information
ShowStatisticsBoolean
Key=Value
Whether to show obfuscation statistics. (see Command Line Reference)
TargetAssemblyNameStringSet target assembly name origin. Can be nochange, inputfilename, outputfilename, name=assemblyname
ToolExeStringExecutable name that can be babel.exe or babel.dll
ToolPathStringDirectory to babel tool
TraceStringBy passing a regular expression, it is possible to trace the symbols to spot the reason why they are not obfuscated. It can be used to debug obfuscation rules
UseKey=ValueSet usage options as key-value pairs. (see Command Line Reference)
VerboseLevelIntSet the log verbosity level
WarningsAsErrorsStringAny messages that would ordinarily be reported as warnings are instead reported as errors by stopping the obfuscation process
WarningsAsInfosStringMessages that would typically be reported as warnings will be displayed as informational messages, reducing their severity while still providing useful feedback
XmlRulesStringContains the XML Rules definition elements (see XML Rules)

Input Files

Task AttributeTypeDescription
DependenciesManifestStringThe path to target assembly .deps.json file
InputFileStringThe path of the source target assembly
KeyFileStringPath of the strong-name key file
KeyContainerStringKey container name (Windows only)
KeyPwdStringStrong name certificate password
MapInFilesStringList of obfuscation rules files to process
RulesFilesStringList of XML map files to process

Output Files

Task AttributeTypeDescription
GenerateLogFileBooleanWhether to generate an obfuscation log. The default log file name will be
<target assembly>.log
GenerateMapOutFileBooleanWhether to generate an obfuscation map file. The default map file name will be <target assembly>.xml.map
LogFileStringObfuscation log file path
MapOutFileStringObfuscation map file path
OutputFileStringObfuscated target file path
PdbFileStringDebug symbols file path
PdbPwdStringSet debug symbol file password

Plugins

Task AttributeTypeDescription
PluginsStringList of plugin assembly files
PluginsArgumentsKey=ValueSet plugin arguments as key-value pairs

Merge and Embed

Task AttributeTypeDescription
CopyAttributesBoolean StringWhether assembly level attributes of merged assemblies are copied into the target assembly
EmbedAssembliesStringList of assembly files to embed into the primary assembly
InternalizeBooleanWhether merged types have their visibility restricted to the assembly
JsonManifestBooleanWhether to handle merged dependencies in JSON manifest
MergeAssembliesStringList of assembly files to merge into the primary assembly

Renaming

Task AttributeTypeDescription
FlattenNamespacesBoolean
String
Whether to remove namespace information. Set type namespace name.
NameLengthInt
String
Set the minimum obfuscated symbol's name length. Additionally, key-value pairs can be specified to assign the value to a particular symbol kind.
NamePrefixStringSet obfuscated symbol name prefix. It can be $name or any string. Additionally, key-value pairs can be specified to assign the prefix to a particular symbol kind.
ObfuscateTypesBooleanWhether to obfuscate type names
ObfuscateEventsBooleanWhether to obfuscate event names
ObfuscateMethodsBooleanWhether to obfuscate method names
ObfuscateParametersBooleanWhether to obfuscate parameter names
ObfuscatePropertiesBooleanWhether to obfuscate property names
ObfuscateFieldsBooleanWhether to obfuscate field names
ObfuscateXamlBoolean
Key=Value
(Boolean) Whether to obfuscate XAML/BAML code.
OverloadedRenamingBooleanWhether to overload symbol names
UnicodeNormalizationBoolean
String
Whether to generate names using Unicode symbols. If disabled, ASCII characters will be used. Optionally a list of comma-separated characters can be specified.
VirtualFunctionsBoolean
Key=Value
Whether to enable obfuscation of virtuals. (see Command Line Reference)
XmlDocFilesStringList of XML documentation files to be processed

Control Flow Obfuscation

Task AttributeTypeDescription
ControlFlowObfuscationBoolean Key=ValueWhether to enable method control flow obfuscation. (see Command Line Reference)
ControlFlowIterationsIntThe number of iterations used in the control flow obfuscation algorithm
EmitInvalidOpcodesBooleanWhether to emit invalid MSIL op-codes

Encryption and Protection

Task AttributeTypeDescription
DebuggingProtectionBooleanWhether to enable anti-debugging protection
DynamicProxyBoolean Key=ValueWhether to wrap calls to external assemblies in dynamically generated proxies. (see Command Line Reference)
DynamicProxyCallFiltersStringList of regular expressions that determine which method calls should be proxied.
MsilEncryptionBoolean
String
Whether to enable code encryption. Optionally a given regular expression can be specified to encrypt the methods that match their signature
ResourceEncryptionBoolean
Key=Value
Whether to encrypt managed resources.(see Command Line Reference)
StringEncryptionBoolean
String
Whether to enable encryption of user strings. Optionally the encryption string algorithm name can be specified. (see Command Line Reference)
SuppressIldasmBooleanWhether to prevent ILDASM from disassembling the obfuscated target
SuppressReflectionBooleanWhether to prevent tools using reflection API to inspect metadata
TamperingDetectionBooleanWhether to enable anti-tampering protection
ValueEncryptionBoolean Key=ValueWhether to encrypt constant inline values and arrays. (see Command Line Reference)

Optimizations

Task AttributeTypeDescription
CleanAttributesBoolean
String
Whether to clean up unwanted attributes. A list of regular expressions that filters out the full names of unwanted attribute types
ConstRemovalBooleanWhether to enable constant fields removal
DeadCodeEliminationBooleanWhether to remove unused methods from the target assembly
DisgregateRemovalBooleanWhether to enable properties and event metadata removal
EnumRemovalBooleanWhether to enable System.Enum types removal
InlineExpansionBooleanWhether to enable the method's inline expansion
SealClassesBooleanWhether to seal classes whenever possible

Code Generation

Task AttributeTypeDescription
AddReferenceStringList of assembly files to add as a reference in the primary assembly
FrameworkStringSet the target assembly framework name
GenerateDebugBooleanWhether to enable debug symbols generation for the target assembly
InstrumentBoolean
String
Whether to enable code instrumentation. A list of regular expressions that filters out the method's full names that will be instrumented
InstrumentEmptyMethodsBooleanWhether to enable the instrumentation of methods with an empty body
ModuleInitializerBooleanWhether to add module initializer code to the primary assembly
ModuleInitializerTargetStringSet module initializer target method name
ModuleVersionIdStringSet module MVID GUID string

Packages

Task AttributeTypeDescription
AndroidSigningKeyAliasStringAndroid key store alias (APK Package)
AndroidSigningKeyPassStringAndroid key store password (APK Package)
AndroidSigningKeyStoreStringAndroid key store file (APK Package)
AndroidSigningStorePassStringAndroid store password (APK Package)
SkipFilesStringA list of deployed assemblies files that should not be obfuscated
TakeFilesStringA list of deployed assemblies files that should be obfuscated
RemoveFilesStringA list of deployed assemblies that should be removed from the package
XapCompressionLevelIntPackage compression level (XAP Package)
Last updated on