Babel Obfuscator Plugins
Babel Obfuscator provides support for custom plug-ins that enable users to extend the functionality of the obfuscator beyond what is provided out of the box. With a custom plugin, you can:
- You can create your string and value encryption algorithms
- Rename Symbols like types, methods, properties, events and fields
- Merge custom code into your assembly
- Define obfuscation rules by querying the assembly metadata
- Change assembly code
- And much more…
Custom plugins can be developed using the .NET framework and integrated into Babel using the plugin management interface.
Code Samples
Several Babel plugins are available on GitHub, and their source code is included. Users interested in implementing a custom plugin can refer to these sample plugins as a starting point. To download the solution containing all the plugin projects, users can use the git command:
git clone https://github.com/babelfornet/BabelPlugins.gitThis allows users to explore the code and modify the plugins to fit their specific needs.
Using Plugin at Command Line
Babel can accept a list of plugin files at the command line. To specify one or more plugin files at the babel.exe command line, you can use the --plugin switch followed by the full path to the plugin file:
babel MyApp.exe --plugin CustomPlugin1.dll --plugin CustomPlugin2.dllIt is possible to pass arguments to plugins using the command line switch --argument
babel MyTarget.exe --plugin CustomPlugin1.dll --plugin CustomPlugin2.dll
--argument arg1=value1 --argument arg2=value2The arguments are defined as key-value pairs. Multiple --argument switches can be used to specify several arguments.
Using Plugin in MSBuild Babel Task
If you are using the MSBuild Babel task, you can specify a list of plugins by adding the Plugins attribute to the Babel task as follow:
<ItemGroup>
<BabelPlugin Include="DesEncrypt.dll"/>
<BabelPlugin Include="LicenseInjector.dll"/>
</ItemGroup>
<Babel
Plugins="@(BabelPlugin)"
PluginsArguments="arg1=value1;arg2=value2" />The PluginsArguments property of the Babel task allows you to specify plugin arguments for all plugins. The list of plugin arguments is represented by a sequence of key-value pairs separated by a semicolon.
Using Plugins From Babel Desktop
To use a plugin for a target assembly in Babel Desktop:
- Select the target assembly on the project canvas.
- In the Files & dependencies group of the properties panel, add the plugin DLL to
Plugins. The command palette entry Engine plugins: Configure DLL paths jumps to the same option. - Run Engine plugins: Discover argument names from the command palette to list the arguments the plugin accepts, then enter their values in
PluginsArguments.
Plugins run inside the obfuscation engine with your account permissions, so only load plugin DLLs you trust.