mkaring / ConfuserEx

An open-source, free protector for .NET applications
https://mkaring.github.io/ConfuserEx/
MIT License
2.32k stars 355 forks source link

Rename Protection with Dependencies/Costura #234

Open AkanshDivker opened 3 years ago

AkanshDivker commented 3 years ago

I've got a project in which I would prefer using Costura. When confusing my main assembly, either with or without Costura, it fails to load the dependencies of my project. If it's not possible I can live without Costura, but I'm not sure why even just confusing my main assembly causes it to be unable to load its dependencies (same folder).

Output from confused assembly

EDIT:

After some more investigation it seems that I'm getting errors when I try to enable rename protection. Since this is one of the main irreversible protections, I'd appreciate some help figuring out why it's throwing errors on runtime.

Output from confused assembly

KvanTTT commented 3 years ago

What version of ConfuserEx are you using? Have you tried the latest build from CI? https://ci.appveyor.com/project/mkaring/confuserex/branch/master/artifacts

AkanshDivker commented 3 years ago

What version of ConfuserEx are you using? Have you tried the latest build from CI? https://ci.appveyor.com/project/mkaring/confuserex/branch/master/artifacts

I was using 1.4.1 but I just tried from CI and I'm getting the same error.

mkaring commented 3 years ago

Issues with the name protection usually come up in case you are using Reflection or another library that relies on reflection heavily (e.g. WPF). I am guessing that could be a problem you are encountering here.

But without more information that is very difficult to say.

wmjordan commented 3 years ago

If you are confusing your assembly, consider using il-repack or ilmerge to merge your dependencies into the main assembly, which may provide better protection than Costura which leaves a lot stuff un-renamed in your main assembly.

TheGameVlog commented 3 years ago

I've got a project in which I would prefer using Costura. When confusing my main assembly, either with or without Costura, it fails to load the dependencies of my project. If it's not possible I can live without Costura, but I'm not sure why even just confusing my main assembly causes it to be unable to load its dependencies (same folder).

Output from confused assembly

EDIT:

After some more investigation it seems that I'm getting errors when I try to enable rename protection. Since this is one of the main irreversible protections, I'd appreciate some help figuring out why it's throwing errors on runtime.

Output from confused assembly

Im not sure if this will help, but it has definitely confused the assembly for me while using Costura follow these steps

Even if this doesn't help the OP , maybe it helps someone else looking for a similar solution

Step 1 : Disable costura by removing the line from fodyweavers.xml Step 2 : Compile the project and copy all the dependency DLL's and keep them in a seperate folder. Step 3 : Enable costura again by adding the Step 1 line back again. Step 4 : Copy all dependency dll's back the the EXE folder. Step 5 : Try obfuscating with Beds GUI again. Enjoy Protection!!