Search code examples
c#.net-core.net-assemblyobfuscationnet-reactor

How to obfuscate a .NET Core 3 assembly with .NET Reactor, containing multiple satellite assemblies?


I have a .NET Core 3.0.100 assembly obfuscated with .NET Reactor v.6.0.0.0.

Said main assembly depends on additional assemblies which have been packed and obfuscated together with it, by using Reactor commands:
-satelite_assemblies [path/s]
-merge 1

Using dotPeek and decompiling the assembly I can see that all the correct .dll's are included in the main assembly and obfuscated together with it - so far so good.

When only built (and not obfuscated) the main .dll also has a [name].deps.json file going together with it, that tells it what and where to find the additional assemblies (standard .NET Core procedure).

In the obfuscated assembly (containing all the rest) that file is no longer valid (nor able to be included) since the "location" of the assemblies is now changed, so when running the obfuscated .dll we get an error in the console that a dependant .dll cannot be found.

How can we obfuscate and merge multiple .dll's with .NET Reactor and still have the main assembly know where to find them?

  • Does it require manual changes to the [name].deps.json and if so, what kind?
  • Is there a way to automatically specify this with .NET Reactor or include it in some way (-satellite_assemblies accepts only .dll and .exe files)?
  • Is it only possible to obfuscate them without merging them when relying on a [name].deps.json file?

Solution

  • You can update to the new version 6.2 (15.01.2020). This version can merge/embed .NET Core assemblies and automatically update [name].deps.json files. Now you can also bundle your .NET Core files into a single EXE file.