Skip to Content
New release 12 available 🎉

Typical Workflows

Three common ways to set up a project, from a single application to a set of libraries that are shipped together.

Protecting a Single Application

Use this when you ship one assembly, or an application whose libraries you do not want to merge.

Add the application

Drag the .exe or .dll onto the canvas, or click + Add Assembly.

Choose a protection level

Run Obfuscation: Set level… from the command palette and pick Balanced as a starting point. Open the properties panel to review the result, for example to choose another string encryption algorithm.

Keep a map file

Tick Writes its rename map in the Map files group of the properties panel. With the map you can decode the stack traces your customers send you in the Stack Decoder. Keep the map with your build, not with the application.

Run and check

Click Run project. Look at the Problems tab of the Activity panel and at the obfuscation score in the card of the target. Then start the protected application with Run > Run Obfuscated App (Ctrl+F5, Cmd+F5 on macOS) and try it.

If the application uses reflection, serialization or data binding on names, some symbols must keep their names. Exclude them with XML rules in the XML rules tab, or with the Obfuscation attribute in your code.

Merging Libraries into the Main Executable

Use this to ship one file instead of an executable and its private libraries. With Internalize on, the merged types become internal, so their names can be obfuscated as well. See Assembly Merging.

Add every assembly

Add the executable and the libraries you want to merge, all as targets.

Run the merge setup

Run Obfuscation: Setup merge into main assembly from the command palette, or click Setup merge in the grid. The libraries become merge inputs of the executable. An assembly the engine cannot merge stays a separate target.

Check the graph

On the canvas, the libraries are connected to the executable with lines labelled MERGE. In the grid, the executable is the only row and the count reads, for example, 1 target · 4 merged. Open the Inputs tab of its row to see the merged files.

Set the protection and run

Choose a level for the executable and run the project. The output folder holds one assembly.

To store a library inside the executable as a resource instead of merging its code, change its type to Embed in the Inputs tab or in the dependency popover. See Dependencies.

Obfuscating a Set of Libraries with Public Renaming

Use this when you ship several assemblies that call each other, such as a framework and the applications built on it, and you want their public API renamed too. Each assembly must use the new names of the others, so the targets exchange rename maps.

Add the assemblies

Add every library and every application that uses them as a target.

Connect the targets that use each other

For each library, drag from its right anchor to the left anchor of a target that calls it and choose Pass the map file. The library now runs first and writes its map, and the target that uses it reads the map.

Run the public setup

Run Obfuscation: Setup public obfuscation (all assemblies), or click Setup public obfuscation in the grid. Every target gets the obfuscate public rule and writes its rename map. Targets that list another target among their dependencies get the map link automatically.

Check the order

In the grid, add the Flow · Step and Run after columns and turn on Group by flow. Each library comes before the targets that read its map.

Run

Run the project. Keep all the map files of the run: you need them to decode stack traces, and to obfuscate a later build of an application against the same version of a library.

Details of CrossAssembly1App.dll on the Maps tab with the count 1: the entry CrossAssembly1.dll.map.xml marked From CrossAssembly1.dll, with a trash iconDetails of CrossAssembly1App.dll on the Maps tab with the count 1: the entry CrossAssembly1.dll.map.xml marked From CrossAssembly1.dll, with a trash iconDetails of CrossAssembly1App.dll on the Maps tab with the count 1: the entry CrossAssembly1.dll.map.xml marked From CrossAssembly1.dll, with a trash icon

An application reading the map of its library

When a library was obfuscated in an earlier build and is not part of the project, add its map with Add map file… under Other map files in the properties panel of each target that uses it. See Cross Assembly Renaming.

Rename maps and statistics files contain the original names of your code. Keep them with your build records and never ship them with the application.

Building the Project Outside Babel Desktop

A project saved by Babel Desktop is an MSBuild file. Once it runs as you want, build it on a build server with the MSBuild task; flow edges and map links are saved as target dependencies, so MSBuild runs the targets in the same order.

Last updated on