-
-
Notifications
You must be signed in to change notification settings - Fork 368
Name Protection
ID: rename
Preset: Minimum
Availability:
This protection obfuscate the symbols' name so the decompiled source code can neither be compiled nor read.
-
mode
: This parameter define the way ConfuserEx renames symbols. Supported values are:-
empty
: ConfuserEx would rename all symbols to a empty string.
Expect many problems when using this mode. -
unicode
: ConfuserEx would rename symbols to Unicode unreadable characters.
Reflection may not work in this mode. (default) -
ascii
: ConfuserEx would rename symbols to readable ASCII characters.
Reflection may not work in this mode. -
reflection
: ConfuserEx uses symbols that are safe for reflection to rename the symbols. This matches mostly theacscii
mode, with the exception of a few characters that may cause issues for reflection access. -
letters
: ConfuserEx would rename symbols to English letters. -
decodable
: ConfuserEx would rename symbols to decodable string. The obfuscated name mapping would be saved to output folder in the file "symbols.map". -
sequential
: ConfuserEx would rename symbols to sequential string. The obfuscated name mapping would be saved to output folder in the file "symbols.map". -
reversible
: ConfuserEx would encrypt the symbols. The obfuscated names could be decoded by providing the password used in obfuscation. -
retain
: ConfuserEx does not alter the names at all. -
debug
: ConfuserEx would add an underscore before the symbols. Not intended for production use.
-
-
password
: This parameter is a string value, indicates the password ConfuserEx should use to encrypt the symbol names whenmode
is set toreversible
. Only effective on modules. This parameter is not set by default. -
generatePassword
: This parameter is a boolean value, indicating if a randompassword
should be generated. This is only done, in casepassword
is not supplied. The password is written into a file calledpassword
in the output directory. -
renameArgs
: This parameter is a boolean value, indicates whether ConfuserEx should remove the name of methods' parameters.-
true
: Rename the parameters of methods. (default) -
false
: Don't rename the parameters.
-
-
renEnum
: This parameter is a boolean value, indicates whether ConfuserEx should change the name of enum values.-
true
: Rename the members ofenum
s. -
false
: Don't rename the members ofenum
s. (default)
-
-
flatten
: This parameter is a boolean value, indicates whether ConfuserEx should flatten the types by removing the namespaces.-
true
: Remove the namespaces of renamed types. (default) -
false
: Keep the namespaces as they are.
-
-
forceRen
: This parameter is a boolean value, indicates whether ConfuserEx should rename the symbols even if the analyzer shows that it should not be renamed.-
true
: Always rename the type or member. This shouldn't be enabled for every member under any circumstances. Enabling it for single types or members were the analyzer came to the wrong conclusion can improve the obfuscation. -
false
: Rename the member only in case the analyzer deems to safe to rename. (default)
-
-
preserveGenericParams
: This parameter is a boolean value, indicating if the names of generic types and members should follow the naming pattern of the .NET compiler. Generic types and members have a backtick () followed by the number of generic parameters in their name. This name is given during the compilation. If the code contains a type `MyType<T>`, the compiled result will contain the type named `MyType
1`.-
true
: Keep this naming pattern after renaming. Any new name will still contain the suffix for the generic parameters. (default) -
false
: The suffix will be discared. This slightly improves the protection, but it may break access by reflection.
-
-
renPublic
: This parameter is a boolean value, indicates whether ConfuserEx should rename the symbols even if the item is visible outside the assembly.-
true
: Rename members and types visible outside of the assembly. -
false
: Don't rename members and types visible outside of the assembly. (default)
Types that are declared
public
, but are located in executable assemblies, are not considered to be visible outside of the assembly and will be renamed even if this parameter is set tofalse
. -
-
renPdb
: This parameter is a boolean value, indicates whether ConfuserEx should rename the variable names and the file names in PDB. -
true
: Rename the values in the pdb file. -
false
: Don't rename anything in the pdb file. (default)
Enabling this is only useful in case you want to public the debug symbole file, but you don't want anyone to be able to reconstruct part of the code using it. Usually it's a good idea to avoid deploying the pdb file to the users.
-
renXaml
: This parameter is a boolean value, indicates whether ConfuserEx should rename the XAML file name.-
true
: Rename the file names of XAML files. (default) -
false
: Don't rename the XAML files.
Renaming the XAML files assumes that the UI framework used is WPF. @AvaloniaUI is currently not supported.
-
-
shortNames
: This parameter is a boolean value, indicating whether the type and member names are handled by the short or by the full name.-
true
: Limits the capabilities of the renamer, expecially in thedecodable
and thesequential
mode
. With this option set, every member with matching names in the source assembly, will get the same name in the obfuscated assembly. The advantage is that thesymbol.map
file is substantially smaller. -
false
: Every member is handled by the full name, including the type name, the namespace and the signature. This allows to apply new names even to methods that were overloads before inside the same type. This option increases the size of thesymbol.map
file. (default)
-
<protection id="rename">
<argument name="mode" value="unicode" />
<argument name="password" value="This password is secret" />
<argument name="renameArgs" value="true" />
<argument name="renEnum" value="true" />
<argument name="flatten" value="true" />
<argument name="forceRen" value="false" />
<argument name="renPublic" value="false" />
<argument name="renPdb" value="true" />
<argument name="renXaml" value="true" />
</protection>
Types that are marked as serializable are in general not renamed, to ensure that the serialized data can be deserialized across assemblies that are obfuscated differently. In case the serialization is only used for cross-domain communication for example, it may be useful to enforce renaming in this case.
<rule pattern="not is-public() and is-type('serializable')">
<protection id="rename">
<argument name="forceRen" value="true" />
</protection>
</rule>
This is a highly effective and irreversible protection for the assembly.
Tuning this protection to obfuscate as many names as possible should always be
a focus. Using the mode
values unicode
and ascii
creates
names compiler is not able to use. So the directly decompiled code will not
compile properly.
Deobfuscators have no way to restore the original naming and are only able to guess the original names or use a default pattern for restored names.