From a92bbbe9c3cf6442df457cf4be9fea0e14478bb7 Mon Sep 17 00:00:00 2001 From: de4dot Date: Tue, 17 Jan 2012 05:44:22 +0100 Subject: [PATCH] Warn if method isn't found since some obfuscators are buggy. --- de4dot.code/renamer/asmmodules/TypeDef.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/de4dot.code/renamer/asmmodules/TypeDef.cs b/de4dot.code/renamer/asmmodules/TypeDef.cs index 41327675..9857f1d1 100644 --- a/de4dot.code/renamer/asmmodules/TypeDef.cs +++ b/de4dot.code/renamer/asmmodules/TypeDef.cs @@ -607,18 +607,16 @@ namespace de4dot.code.renamer.asmmodules { continue; if (!resolvedAllInterfaces() || !resolvedBaseClasses()) continue; - string errMsg = string.Format( - "Could not find interface method {0} ({1:X8}). Type: {2} ({3:X8})", - Utils.removeNewlines(pair.Key.MethodDefinition), - pair.Key.MethodDefinition.MetadataToken.ToInt32(), - Utils.removeNewlines(TypeDefinition), - TypeDefinition.MetadataToken.ToInt32()); // Ignore if COM class if (!TypeDefinition.IsImport && !hasAttribute("System.Runtime.InteropServices.ComImportAttribute") && - !hasAttribute("System.Runtime.InteropServices.TypeLibTypeAttribute")) - throw new ApplicationException(errMsg); - Log.w("{0}", errMsg); + !hasAttribute("System.Runtime.InteropServices.TypeLibTypeAttribute")) { + Log.w("Could not find interface method {0} ({1:X8}). Type: {2} ({3:X8})", + Utils.removeNewlines(pair.Key.MethodDefinition), + pair.Key.MethodDefinition.MetadataToken.ToInt32(), + Utils.removeNewlines(TypeDefinition), + TypeDefinition.MetadataToken.ToInt32()); + } } }