Assembly Embedding
Babel Obfuscator provides a feature to embed multiple assemblies into the main application, which can reduce the overall size of the deployed assembly. When embedding assemblies with Babel Obfuscator, the embedded assemblies are first encrypted and compressed before being stored as managed resources within the main application assembly.
It is important to note that embedded assemblies are not obfuscated. Therefore, it's recommended only to embed assemblies that do not contain proprietary code or components that are not meant to be protected.
Embedding From Command Line
To embed assemblies from the command line using the Babel tool, you can use the --embed
option followed by the assembly file path to embed. You can enter the command multiple times to embed several assemblies.
This command will embed Library1.dll
and Library2.dll
into MyApp.exe
. The embedded assemblies will be stored as managed resources within the main assembly.
You can also use an XML rules file to specify additional settings, such as compression or encryption. For example, create a file named embed.xml
with the following contents:
Then run the following command to embed the assemblies based on the rules file:
Embedding From MSBuild Babel Task
To embed assemblies using the MSBuild Babel task, you need to add a new ItemGroup
element in your project file. Inside the ItemGroup
, you can define multiple EmbedAssembly
items, each one specifying a path to an assembly file to embed. For example:
You can reference the EmbedAssembly
in the Babel task using the EmbedAssemlies
attribute:
You can optionally specify a rule file to customize the compression and encryption settings for each embedded assembly. By default, embedded assemblies are compressed and encrypted using Babel's default settings, but a rule file can be used to customize these settings if necessary.
Embedding From Babel UI
To embed assemblies using Babel UI, you can follow these steps:
Open the Babel Obfuscator user interface and create a new project or open an existing one.
Click
+
icon located to the left of the row corresponding to the primary assembly. This will reveal the Input Grid, where you can add the list of assemblies to be embedded.In the Input Grid File column, Click
...
to browse and select the assemblies you want to embed. Alternatively, you can drag and drop the list of assemblies in the Input Grid.Ensure the Action is set to Embed for every assembly added.
You can configure the embedding options, such as encryption and compression, by creating rules in the Rules panel.
Last updated