VMProtect supports the following values for ObfuscationAttribute.Feature:
- renaming — allows excluding a class/method from renaming. Possible values of ObfuscationAttribute.Exclude: true/false
- virtualization, virtualizationlockbykey, ultra, ultralockbykey, mutation — allows specifying the compilation type for a specific method or methods of a class. Possible values of ObfuscationAttribute.ApplyToMembers: true/false.
- strings — allows obfuscating strings for a specific method or methods of a class. Possible values of ObfuscationAttribute.ApplyToMembers: true/false.
For each class, method, or property, it is possible to specify multiple attributes at once:
[Obfuscation(Feature = "strings", Exclude = false)]
class Class
{
[Obfuscation(Feature = "renaming", Exclude = true)]
[Obfuscation(Feature = "virtualization", Exclude = false)]
public Foo()
{
...
Examples
The following example adds Class.Foo to the “Functions For Protection” section with the “Virtualization” compilation type:
class Class
{
[Obfuscation(Feature = "virtualization")]
public Foo()
{
...
The following example excludes Class.Foo from renaming:
class Class
{
[Obfuscation(Feature = "renaming", Exclude = true)]
public Foo()
{
...
The following example excludes all methods of Class from renaming:
[Obfuscation(Feature = "renaming", Exclude = true, ApplyToMembers = true)]
class Class
{
public Foo()
{
...