What changes when you obfuscate a DLL with Confuser Studio?

See how the same discount formula and message appear in dotPeek before and after obfuscation.

Before and after obfuscation in dotPeek

The sample file, Demo.PriceApp.dll, contains a method that calculates an order total. In the two screenshots, look for the formula and the discount message in the same methods.

Original pricing DLL in dotPeek with readable formulas and strings
Original DLL. The calculations and discount message are visible. Open the image at full size.
Studio protected pricing DLL in dotPeek with VM and protected string calls
Studio-protected DLL. The calculation becomes a ProtectedVirtualMachine.InvokeWide call; the message is read through a ProtectedStrings.Read call.
View the C# sample
C#namespace ShopDemo { internal static class PriceCalculator { internal static int CalculateTotal(int unitPrice, int quantity, bool isMember) { int subtotal = unitPrice * quantity; int discount = isMember ? subtotal / 5 : subtotal / 20; int shipping = subtotal >= 50000 ? 0 : 3000; return subtotal - discount + shipping; } internal static string DescribeDiscount(bool isMember) { string discountMessage = isMember ? "Member discount: 20%" : "Standard discount: 5%"; return discountMessage; } } }

Image source: Confuser Studio

Next step

Use Confuser Studio virtualization for critical calculations

In the published example, dotPeek displays a VM call where the discount formula used to be. Try virtualization on one important method in your own application. Compare its output for the same inputs and measure the cost of repeated calls before extending protection to other methods.

Explore Confuser Studio

Suggested checks

  1. Start with an unprotected Release DLL or EXE.
  2. Save the selected options in your Studio project.
  3. Inspect core methods and strings in dotPeek.
  4. Test behavior, speed and diagnostics in the target environment.