From 5e3b4a14143d3cddfa0c2af65041c750c6ffec30 Mon Sep 17 00:00:00 2001 From: de4dot Date: Sat, 14 Jan 2012 12:19:17 +0100 Subject: [PATCH] Add some checks --- de4dot.code/deobfuscators/ValueInlinerBase.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/de4dot.code/deobfuscators/ValueInlinerBase.cs b/de4dot.code/deobfuscators/ValueInlinerBase.cs index d9f31d34..e9494c5d 100644 --- a/de4dot.code/deobfuscators/ValueInlinerBase.cs +++ b/de4dot.code/deobfuscators/ValueInlinerBase.cs @@ -17,6 +17,7 @@ along with de4dot. If not, see . */ +using System; using System.Collections.Generic; using Mono.Cecil; using Mono.Cecil.Cil; @@ -43,6 +44,10 @@ namespace de4dot.code.deobfuscators { } public void add(MethodDefinition method, Func handler) { + if (method == null) + return; + if (decrypterMethods.find(method) != null) + throw new ApplicationException(string.Format("Handler for method {0:X8} has already been added", method.MetadataToken.ToInt32())); if (method != null) decrypterMethods.add(method, handler); }