Skip to main content

Configuring Eazfuscator.NET with a Standalone Configuration File

Article ID: KB100043Published: September 11, 2023

Synopsis

There are situations when you need to obfuscate a pre-built .NET assembly or use a specific obfuscation configuration that is not a part of the compiled assembly. Eazfuscator.NET supports a standalone configuration file option that may be helpful in both scenarios. The configuration is performed in a familiar declarative fashion using System.Reflection.ObfuscateAssemblyAttribute and System.Reflection.ObfuscationAttribute custom attributes.

--configuration-file command-line option of Eazfuscator.NET allows you to specify a path to the standalone obfuscation configuration file.

Instructions

Please follow the instructions below to tune the settings of your .NET project so that Eazfuscator.NET is configured with --configuration-file command-line option. Instructions depend on a way Eazfuscator.NET is integrated with the project:

  1. Locate the shell script that invokes eazfuscator.net command:

    eazfuscator.net …
  2. Add --configuration-file command-line option as shown below:

    eazfuscator.net … --configuration-file <file-path>

Example

The contents of the configuration file is a typical C# or VB.NET source code. It can be something like this:

using System.Reflection;

[assembly: Obfuscation(Feature = "encrypt symbol names with password TEST", Exclude = false)]
[assembly: Obfuscation(Feature = "embed Contoso.Engine.dll", Exclude = false)]

// ...

In this way, the configuration file defines directives to use for an assembly obfuscation.

While a configuration file can only contain global obfuscation directives, you can also use them to apply obfuscation features to concrete types or their members. Please refer to the documentation on conditional obfuscation.

Applicability

This article applies to:

  • Eazfuscator.NET 4.2 or higher. Earlier versions do not support --configuration-file command-line option