Only set ILOnly if there are no native methods
This commit is contained in:
parent
6d43a7d6ee
commit
226d18dff7
|
@ -307,9 +307,12 @@ namespace de4dot.code.deobfuscators.Agile_NET {
|
|||
addResources("Obfuscator protection files");
|
||||
}
|
||||
|
||||
module.IsILOnly = true;
|
||||
|
||||
base.deobfuscateEnd();
|
||||
|
||||
// Call hasNativeMethods() after all types/methods/etc have been removed since
|
||||
// some of the removed methods could be native methods
|
||||
if (!module.IsILOnly && !hasNativeMethods())
|
||||
module.IsILOnly = true;
|
||||
}
|
||||
|
||||
public override IEnumerable<int> getStringDecrypterMethods() {
|
||||
|
|
|
@ -763,6 +763,22 @@ namespace de4dot.code.deobfuscators {
|
|||
return false;
|
||||
}
|
||||
|
||||
protected bool hasNativeMethods() {
|
||||
if (module.VTableFixups != null)
|
||||
return true;
|
||||
foreach (var type in module.GetTypes()) {
|
||||
foreach (var method in type.Methods) {
|
||||
var mb = method.MethodBody;
|
||||
if (mb == null)
|
||||
continue;
|
||||
if (mb is CilBody)
|
||||
continue;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static int toInt32(bool b) {
|
||||
return b ? 1 : 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user