Check for native code assemblies a little later

This commit is contained in:
de4dot 2011-12-21 16:55:42 +01:00
parent 1e7dbfad97
commit ceca34e12c

View File

@ -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);