diff --git a/de4dot.code/deobfuscators/DeepSea/Deobfuscator.cs b/de4dot.code/deobfuscators/DeepSea/Deobfuscator.cs index fc3ba29a..f1741aa9 100644 --- a/de4dot.code/deobfuscators/DeepSea/Deobfuscator.cs +++ b/de4dot.code/deobfuscators/DeepSea/Deobfuscator.cs @@ -268,7 +268,7 @@ done: void removeInlinedMethods() { if (!options.InlineMethods || !options.RemoveInlinedMethods) return; - removeInlinedMethods(DsInlinedMethodsFinder.find(module)); + removeInlinedMethods(DsInlinedMethodsFinder.find(module, staticStringInliner.Methods)); } public override IEnumerable getStringDecrypterMethods() { diff --git a/de4dot.code/deobfuscators/DeepSea/DsInlinedMethodsFinder.cs b/de4dot.code/deobfuscators/DeepSea/DsInlinedMethodsFinder.cs index b0b28600..57e92ae5 100644 --- a/de4dot.code/deobfuscators/DeepSea/DsInlinedMethodsFinder.cs +++ b/de4dot.code/deobfuscators/DeepSea/DsInlinedMethodsFinder.cs @@ -22,12 +22,16 @@ using Mono.Cecil; namespace de4dot.code.deobfuscators.DeepSea { static class DsInlinedMethodsFinder { - public static List find(ModuleDefinition module) { + public static List find(ModuleDefinition module, IEnumerable notInlinedMethods) { + var notInlinedMethodsDict = new Dictionary(); + foreach (var method in notInlinedMethods) + notInlinedMethodsDict[method] = true; + var inlinedMethods = new List(); foreach (var type in module.GetTypes()) { foreach (var method in type.Methods) { - if (DsMethodCallInliner.canInline(method)) + if (!notInlinedMethodsDict.ContainsKey(method) && DsMethodCallInliner.canInline(method)) inlinedMethods.Add(method); } }