From ceca34e12c65e9fbf17c03eaa5ef0585c34bde22 Mon Sep 17 00:00:00 2001 From: de4dot Date: Wed, 21 Dec 2011 16:55:42 +0100 Subject: [PATCH] Check for native code assemblies a little later --- de4dot.cui/FilesDeobfuscator.cs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/de4dot.cui/FilesDeobfuscator.cs b/de4dot.cui/FilesDeobfuscator.cs index a3a74116..a811fb44 100644 --- a/de4dot.cui/FilesDeobfuscator.cs +++ b/de4dot.cui/FilesDeobfuscator.cs @@ -128,7 +128,18 @@ namespace de4dot.cui { KeepObfuscatorTypes = options.KeepObfuscatorTypes, CreateDestinationDir = !onlyScan, }); - return loader.load(); + + bool ignoreNativeCodeFiles = !onlyScan; + foreach (var file in loader.load()) { + if (ignoreNativeCodeFiles) { + if ((file.ModuleDefinition.Attributes & ModuleAttributes.ILOnly) == 0) { + Log.w("Ignoring assembly with native code {0}", file.Filename); + removeModule(file.ModuleDefinition); + continue; + } + } + yield return file; + } } class DotNetFileLoader { @@ -198,12 +209,6 @@ namespace de4dot.cui { return false; } - if ((file.ModuleDefinition.Attributes & ModuleAttributes.ILOnly) == 0) { - Log.w("Ignoring assembly with native code {0}", file.Filename); - removeModule(file.ModuleDefinition); - return false; - } - var deob = file.Deobfuscator; if (skipUnknownObfuscator && deob.Type == "un") { Log.v("Skipping unknown obfuscator: {0}", file.Filename);