yck1509 / ConfuserEx

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

NET Core 4.5 DLLs (Windows 8 Store) support? #65

Closed augiem closed 10 years ago

augiem commented 10 years ago

I was hoping to obfuscate a DLL which is targeting the NETCore 4.5 for Win 8 store.

I followed the guidelines here for WP8 (https://github.com/yck1509/ConfuserEx/wiki/Working-with-WP8), but used the probe path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5", the result is failures on every mscorlib referenced class.

This example shows it's choking on System.GenericList. Copying mscorlib.dll into the build path doesn't help either.

[ERROR] Failed to resolve a type, check if all dependencies are of correct version. Exception: dnlib.DotNet.TypeResolveException: Could not resolve type: System.Collections.Generic.List1/Enumerator at dnlib.DotNet.TypeRef.ResolveThrow() in d:\ConfuserEx-master\dnlib\src\DotNet\TypeRef.cs:line 331 at Confuser.Renamer.Analyzers.InterReferenceAnalyzer.Analyze(ConfuserContext context, INameService service, IDnlibDef def) in d:\ConfuserEx-master\Confuser.Renamer\Analyzers\InterReferenceAnalyzer.cs:line 25 at Confuser.Renamer.AnalyzePhase.Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, IDnlibDef def, Boolean runAnalyzer) in d:\ConfuserEx-master\Confuser.Renamer\AnalyzePhase.cs:line 77 at Confuser.Renamer.AnalyzePhase.Execute(ConfuserContext context, ProtectionParameters parameters) in d:\ConfuserEx-master\Confuser.Renamer\AnalyzePhase.cs:line 54 at Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action1 func, Func1 targets, ConfuserContext context) in d:\ConfuserEx-master\Confuser.Core\ProtectionPipeline.cs:line 141 at Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) in d:\ConfuserEx-master\Confuser.Core\ConfuserEngine.cs:line 208 at Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) in d:\ConfuserEx-master\Confuser.Core\ConfuserEngine.cs:line 162 [ERROR] ---BEGIN DEBUG INFO--- [ERROR] Installed Framework Versions: [ERROR] v2.0.50727 2.0.50727.4927 [ERROR] v3.0 3.0.30729.4926 [ERROR] v3.5 3.5.30729.4926 [ERROR] v4 [ERROR] Client 4.5.51641 [ERROR] Full 4.5.51641 [ERROR] v4.0 [ERROR] Client 4.0.0.0 [ERROR] v4.5 378675 [ERROR] `

augiem commented 10 years ago

Managed to get past the IEnumerable problem by changing some code to remove all foreach calls on Generic.List, but then got another error that DebuggableAttribute could not be resolved. It seems DebuggableAttribute is added by default in Win 8 store libs and I can't find a way to remove it.

Edit: There are a bunch of errors with XmlReader, Generic.Dictionary, ValueCollection, and many other system classes. By hacking in code to skip these classes you can get it to obfuscate, but its a lot of them to be skipping...

yck1509 commented 10 years ago

Since I can't have .NET 4.5 installed here (I'm currently on XP), could you please send me a copy of mscorlib.dll in the probe path to me to have a look?

augiem commented 10 years ago

I sent you an email with the reference assemblies and a sample DLL that shows the errors. Thanks for taking a look! Edit: Sent 2 emails.