Trying obfuscating Dot Net Core applications

Viewed 8853

I am trying to obfuscate a Dot Net Core application but I am having no success. I am using ConfuserEx, managed to get it to work with a Net Framework, but no luck when trying it out with a Net Core Console Application or Net Core DLL.

I get the error:

Object reference not set to an instance of an object.

Did anyone managed to obfuscate a Net Core application? If not is there any other tool that can do it?

2 Answers

You can try Obfuscar. Its free and open source.

Binaries can be loaded at https://www.nuget.org/packages/Obfuscar/

Project sample:

<Obfuscator>
  <Var name="InPath" value=".\" />
  <Var name="OutPath" value=".\output" />

  <Var name="HideStrings" value="true" />
  <Var name="UseKoreanNames" value="true" />
  <Var name="ReuseNames" value="true" />
  <Var name="RenameFields" value="true" />
  <Var name="RenameProperties" value="true" />
  <Var name="RenameEvents" value="true" />
  <Var name="OptimizeMethods" value="true" />
  <Var name="SuppressIldasm" value="true" />
  <Var name="KeepPublicApi" value="false" />
  <Var name="HidePrivateApi" value="true" />  

  <Module file="$(InPath)\YourApplication.dll" />
</Obfuscator>

Running obfuscation:

  Obfuscar.Console.exe your_project.xml

I saw this error when I tried to obfuscate EXE file. DLLs do not yield this error.

But I need to add that at the moment ConfuserEx does not really support .NET Core assemblies, because it does not handle metapackages; all dependent assemblies must be explicitly specified in the main DLL, which makes it quite a hassle.

Related