Search…
⌃K

Attribute-Based Obfuscation

Motivation

Sometimes you might feel the urge to apply specific protections to special parts of your code, attribute based obfuscation (also known as declarative obfuscation) allows you to choose which features to apply on a given type or method.
For example, your application might be formed by two main components, one linked with the authentication and copy protection of your software, and another one which is the core of your application itself. In those scenarios, it makes perfect sense to use a lightweight obfuscation in the whole assembly and more aggressive protection on the anti-piracy part.
Simultaneously, you might find yourself looking to add exceptions or special rules to certain methods or types, all that and more is possible with our SDK.

Obfuscation SDK

Legacy tools tended to rely on the Obfuscation Attribute shipped within .NET itself. This attribute works well until more complex scenarios and sub-settings of obfuscation technologies appear. For this reason, ever since our first public release, we recommend using our SDK instead of the classical Obfuscation Attribute.
Our SDK allows you to place rules in the most human-friendly manner, we achieve this by making a separated attribute for each one of our protections.

🧠
Enabling a Protection using the SDK

📥
Methods

Suppose that there is a method that you want to protect more than others. You can achieve this by using the proper protection attributes.
C#
VB.NET
[Virtualization()]
public static void MyImportantMethod()
{
// Your code goes in here
}
<Virtualization()>
Public Shared Sub MyImportantMethod()
// Your code goes in here
End Sub
Simultaneously, you can stack multiple protections on the same method.
C#
VB.NET
[ControlFlow()]
[Virtualization()]
public static void MyImportantMethod()
{
// Your code goes in here
}
<ControlFlow()>
<Virtualization()>
Public Shared Sub MyImportantMethod()
// Your code goes in here
End Sub
The order in which you place the attributes does not affect the obfuscation result.

📤
Types

Suppose there is a class that you want to protect more than others. You can do this by using the proper protection attributes.
C#
VB.NET
[Virtualization()]
public class MyClass {
// Class code
}
<Virtualization()>
Public Shared Sub MyImportantMethod()
// Your code goes in here
End Sub
Simultaneously, you can stack multiple protections on the class.
C#
[ControlFlow()]
[Virtualization()]
public class MyClass {
// Class code
}