From da1d649ef471967fca6704cc60c58f6a559421f9 Mon Sep 17 00:00:00 2001 From: de4dot Date: Sat, 25 Feb 2012 06:33:38 +0100 Subject: [PATCH] Make sure no generic methods are inlined --- blocks/cflow/MethodCallInliner.cs | 2 ++ de4dot.code/deobfuscators/DeepSea/MethodCallInliner.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/blocks/cflow/MethodCallInliner.cs b/blocks/cflow/MethodCallInliner.cs index 023c06d0..5b27c5ee 100644 --- a/blocks/cflow/MethodCallInliner.cs +++ b/blocks/cflow/MethodCallInliner.cs @@ -41,6 +41,8 @@ namespace de4dot.blocks.cflow { } protected virtual bool canInline(MethodDefinition method) { + if (method.GenericParameters.Count > 0) + return false; if (MemberReferenceHelper.compareMethodReferenceAndDeclaringType(method, blocks.Method)) return false; if (!MemberReferenceHelper.compareTypes(method.DeclaringType, blocks.Method.DeclaringType)) diff --git a/de4dot.code/deobfuscators/DeepSea/MethodCallInliner.cs b/de4dot.code/deobfuscators/DeepSea/MethodCallInliner.cs index e10bfc3d..2590f2f9 100644 --- a/de4dot.code/deobfuscators/DeepSea/MethodCallInliner.cs +++ b/de4dot.code/deobfuscators/DeepSea/MethodCallInliner.cs @@ -166,6 +166,8 @@ checkInline: public static bool canInline(MethodDefinition method) { if (method == null || method.Body == null) return false; + if (method.GenericParameters.Count > 0) + return false; if (method.Body.ExceptionHandlers.Count > 0) return false; var parameters = method.Parameters;