yck1509 / ConfuserEx

An open-source, free protector for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
3.56k stars 1.61k forks source link

Add support for IL Merge #219

Open JPVenson opened 9 years ago

JPVenson commented 9 years ago

Could you please add support for the IL Merge tool? Because its not possible to Confuse a Merged Asseambly that will produce an not found ex

yck1509 commented 9 years ago

Hi, To use ILMerge, you could merge the files before processing in ConfuserEx. It might not be able to modify the output of ConfuserEx using ILMerge as it try to preserve integrity of the protected output.

JPVenson commented 9 years ago

Hey,

Unfortunately this is not possible, if i try to use ConfuserEx with an ILMerged assambly, the program throws a Reference not found ex.

yck1509 commented 9 years ago

Hi, If that is the case then it'll be a bug of ConfuserEx. Do you mind posting the error log / stack trace?

bsee08 commented 9 years ago

This appears to still be an issue. I have an exe and a dll. Without using ILMerge ConfuserEx works great. Trying to use ConfuserEx after merging the dll with the exe doesn't work. Stacktrace below.

Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Confuser.Core.ConfuserEngine.PrintEnvironmentInfo(ConfuserContext context) in c:\projects\confuserex\Confuser.Core\ConfuserEngine.cs:line 512
at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in c:\projects\confuserex\Confuser.Core\ConfuserEngine.cs:line 179 at Confuser.Core.ConfuserEngine.<>cDisplayClass3.b2() in c:\projects\confuserex\Confuser.Core\ConfuserEngine.cs:line 68 at System.Threading.Tasks.Task.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Confuser.CLI.Program.RunProject(ConfuserParameters parameters) in c:\projects\confuserex\Confuser.CLI\Program.cs:line 132 at Confuser.CLI.Program.Main(String[] args) in c:\projects\confuserex\Confuser.CLI\Program.cs:line 112

yck1509 commented 9 years ago

Hi, Please post the full output log of the ConfuserEx. Also, would it be possible for me to obtain a sample project that would reproduce the issue?

bsee08 commented 9 years ago

Never mind. The issue is something on my end. When I made a simplified sample project it worked exactly as it should. I ran ConfuserEx, then ILMerge and produced a single obfuscated exe.

picrap commented 9 years ago

Have you tried Costura (it is available as a NuGet package)? It is a good alternative to ILMerge.