yck1509 / ConfuserEx

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

error KeyNotFoundException #42

Closed ambyte closed 10 years ago

ambyte commented 10 years ago

I got an error when launched protect. Log below.

[INFO] ConfuserEx v0.2.2 Copyright (C) Ki 2014 [INFO] Running on Microsoft Windows NT 6.1.7601 Service Pack 1, .NET Framework v4.0.30319.18408, 64 bits [DEBUG] Discovering plugins... [INFO] Discovered 10 protections, 1 packers. [DEBUG] Resolving component dependency... [INFO] Loading input modules... [INFO] Loading 'EveryLang.exe'... [INFO] Initializing... [DEBUG] Building pipeline... [INFO] Resolving dependencies... [DEBUG] Checking Strong Name... [DEBUG] Creating global .cctors... [DEBUG] Watermarking... [DEBUG] Executing 'Name analysis' phase... [DEBUG] Building VTables & identifier list... [ERROR] Unknown error occured. Exception: System.Collections.Generic.KeyNotFoundException: Данный ключ отсутствует в словаре. в System.Collections.Generic.Dictionary2.get_Item(TKey key) в Confuser.Renamer.VTable.Override(Dictionary2 slotDict, VTableSignature sig, VTableSlot slot, MethodDef target) в e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:строка 125 в Confuser.Renamer.VTable.ConstructVTable(TypeDef typeDef, VTableStorage storage) в e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:строка 198 в Confuser.Renamer.VTableStorage.GetOrConstruct(TypeDef type) в e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:строка 238 в Confuser.Renamer.VTableStorage.GetVTable(ITypeDefOrRef type) в e:\Source\Public\Confuser2\Confuser.Renamer\VTable.cs:строка 246 в Confuser.Renamer.AnalyzePhase.Execute(ConfuserContext context, ProtectionParameters parameters) в e:\Source\Public\Confuser2\Confuser.Renamer\AnalyzePhase.cs:строка 44 в Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action1 func, Func1 targets, ConfuserContext context) в e:\Source\Public\Confuser2\Confuser.Core\ProtectionPipeline.cs:строка 132 в Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) в e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:строка 191 в Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) в e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:строка 158 Failed at 14:03, 0:00 elapsed.

yck1509 commented 10 years ago

It seems it break an assertion, would it be possible to have some sample files to reproduce this issue?

ambyte commented 10 years ago

I got this error when tried protect this executable file http://everylang.org/dist/EveryLang.zip

ambyte commented 10 years ago

For MahApps.Metro.dll https://github.com/MahApps/MahApps.Metro/archive/0.13.1.zip I get this error. [INFO] ConfuserEx v0.2.2 Copyright (C) Ki 2014 [INFO] Running on Microsoft Windows NT 6.1.7601 Service Pack 1, .NET Framework v4.0.30319.18408, 64 bits [DEBUG] Discovering plugins... [INFO] Discovered 10 protections, 1 packers. [DEBUG] Resolving component dependency... [INFO] Loading input modules... [INFO] Loading 'MahApps.Metro.dll'... [INFO] Initializing... [DEBUG] Building pipeline... [INFO] Resolving dependencies... [DEBUG] Checking Strong Name... [DEBUG] Creating global .cctors... [DEBUG] Watermarking... [DEBUG] Executing 'Name analysis' phase... [DEBUG] Building VTables & identifier list... [DEBUG] Analyzing... [ERROR] Unknown error occured. Exception: System.NotImplementedException: Метод или операция не реализована. в Confuser.Renamer.BAML.BAMLAnalyzer.ProcessConverter(PropertyWithConverterRecord rec, TypeDef type) в e:\Source\Public\Confuser2\Confuser.Renamer\BAML\BAMLAnalyzer.cs:строка 407 в Confuser.Renamer.BAML.BAMLAnalyzer.ProcessElementBody(BamlElement root, BamlElement elem) в e:\Source\Public\Confuser2\Confuser.Renamer\BAML\BAMLAnalyzer.cs:строка 319 в Confuser.Renamer.BAML.BAMLAnalyzer.Analyze(ModuleDefMD module, String bamlName, Byte[] data) в e:\Source\Public\Confuser2\Confuser.Renamer\BAML\BAMLAnalyzer.cs:строка 75 в Confuser.Renamer.Analyzers.WPFAnalyzer.AnalyzeResources(ConfuserContext context, INameService service, ModuleDefMD module) в e:\Source\Public\Confuser2\Confuser.Renamer\Analyzers\WPFAnalyzer.cs:строка 231 в Confuser.Renamer.AnalyzePhase.Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, IDnlibDef def, Boolean runAnalyzer) в e:\Source\Public\Confuser2\Confuser.Renamer\AnalyzePhase.cs:строка 74 в Confuser.Renamer.AnalyzePhase.Execute(ConfuserContext context, ProtectionParameters parameters) в e:\Source\Public\Confuser2\Confuser.Renamer\AnalyzePhase.cs:строка 52 в Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action1 func, Func1 targets, ConfuserContext context) в e:\Source\Public\Confuser2\Confuser.Core\ProtectionPipeline.cs:строка 132 в Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) в e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:строка 191 в Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) в e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:строка 158 Failed at 8:55, 0:00 elapsed.

ambyte commented 10 years ago

And for Hardcodet.Wpf.TaskbarNotification.dll http://www.hardcodet.net/uploads/projects/notifyicon/wpf-notifyicon.zip get this.

[INFO] ConfuserEx v0.2.2 Copyright (C) Ki 2014 [INFO] Running on Microsoft Windows NT 6.1.7601 Service Pack 1, .NET Framework v4.0.30319.18408, 64 bits [DEBUG] Discovering plugins... [INFO] Discovered 10 protections, 1 packers. [DEBUG] Resolving component dependency... [INFO] Loading input modules... [INFO] Loading 'Hardcodet.Wpf.TaskbarNotification.dll'... [INFO] Initializing... [DEBUG] Building pipeline... [INFO] Resolving dependencies... [DEBUG] Checking Strong Name... [DEBUG] Creating global .cctors... [DEBUG] Watermarking... [DEBUG] Executing 'Name analysis' phase... [DEBUG] Building VTables & identifier list... [DEBUG] Analyzing... [WARN] Failed to find the CLR event of routed event 'PopupOpened' in type 'Hardcodet.Wpf.TaskbarNotification.TaskbarIcon'. [ERROR] Unknown error occured. Exception: System.NullReferenceException: Ссылка на объект не указывает на экземпляр объекта. в Confuser.Renamer.Analyzers.WPFAnalyzer.AnalyzeMethod(ConfuserContext context, INameService service, MethodDef method) в e:\Source\Public\Confuser2\Confuser.Renamer\Analyzers\WPFAnalyzer.cs:строка 187 в Confuser.Renamer.Analyzers.WPFAnalyzer.Analyze(ConfuserContext context, INameService service, IDnlibDef def) в e:\Source\Public\Confuser2\Confuser.Renamer\Analyzers\WPFAnalyzer.cs:строка 27 в Confuser.Renamer.AnalyzePhase.Analyze(NameService service, ConfuserContext context, ProtectionParameters parameters, IDnlibDef def, Boolean runAnalyzer) в e:\Source\Public\Confuser2\Confuser.Renamer\AnalyzePhase.cs:строка 75 в Confuser.Renamer.AnalyzePhase.Execute(ConfuserContext context, ProtectionParameters parameters) в e:\Source\Public\Confuser2\Confuser.Renamer\AnalyzePhase.cs:строка 52 в Confuser.Core.ProtectionPipeline.ExecuteStage(PipelineStage stage, Action1 func, Func1 targets, ConfuserContext context) в e:\Source\Public\Confuser2\Confuser.Core\ProtectionPipeline.cs:строка 132 в Confuser.Core.ConfuserEngine.RunPipeline(ProtectionPipeline pipeline, ConfuserContext context) в e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:строка 189 в Confuser.Core.ConfuserEngine.RunInternal(ConfuserParameters parameters, CancellationToken token) в e:\Source\Public\Confuser2\Confuser.Core\ConfuserEngine.cs:строка 156 Failed at 8:58, 0:00 elapsed.

yck1509 commented 10 years ago

The executable has missing dlls so I can't test them. The two additional issue has been partially fixed by 0c6dd5ca21feb4f37e5966c34abd97be28436959.

ambyte commented 10 years ago

I merged all dlls into executable like in this topic http://blogs.interknowlogy.com/2011/07/13/merging-a-wpf-application-into-a-single-exe/ For test with dlls I created archive http://everylang.org/dist/test/EveryLang.zip

yck1509 commented 10 years ago

Tested the exe with the latest source and it seems protected successfully. Close as fixed.