.NET protection basics

Why obfuscate
.NET code?

An order total can reveal how an app sets its prices. See what obfuscation changes in the compiled code and which names the app still needs.

Why protect a release assembly?

A typical .NET assembly contains intermediate language (IL) and metadata used to run the application. Studio transforms selected methods and strings at this stage. The application still applies the same discount, while the pricing formula in the shipped assembly appears as a VM call.

Which DLLs and EXEs should you protect?

Protect the managed EXE when it contains your application logic. If that EXE calls a library, check the DLL too. An order screen might live in the EXE while the rules that set the price live in a separate DLL.

In modern .NET builds, the EXE may only launch the application, with the actual code in a DLL of the same name. Identify the managed assemblies you wrote in the publish folder. After protection, run the application with the same file layout.

Protection methods

Choose protection to fit the code

Combine techniques for the code you actually need to protect, then inspect the finished release.

NAMES

Renaming

Replace meaningful type and member names. Exclude names required by reflection or serialization.

CONTROL FLOW

Control-flow changes

Make branches harder to follow. Verify speed and compatibility after applying them.

STRINGS

String protection

Protect string literals and let the application read their values at runtime.

VIRTUALIZATION

Method virtualization

Turn selected methods into separate instructions and runtime calls. Focus on important methods and measure performance.

INTEGRITY

Tamper detection

Detect changes to the file or analysis environment. Check for conflicts with legitimate diagnostics.

BUILD

Release verification

Decompile and test the exact file you will ship. Record settings so the result can be reproduced.

Debugger detection at runtime

In Confuser Studio, you can configure your protected application to exit automatically when it detects a running debugger.

Choose a method to inspect

Add a Release DLL or EXE to Confuser Studio and choose a method that implements a business rule. Open the original and protected assemblies in dotPeek, compare the calculation and its strings, then run the same operation in the application.

Open the official DLL and EXE guide