Clear invalid method bodies
This commit is contained in:
parent
b8726efd50
commit
b1f5fe92be
|
@ -558,9 +558,15 @@ namespace de4dot.code {
|
|||
throw;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.w("Could not deobfuscate method {0:X8}. Hello, E.T.: {1}", // E.T. = exception type
|
||||
if (!canLoadMethodBody(method)) {
|
||||
Log.v("Invalid method body. {0:X8}", method.MetadataToken.ToInt32());
|
||||
method.Body = new MethodBody(method);
|
||||
}
|
||||
else {
|
||||
Log.w("Could not deobfuscate method {0:X8}. Hello, E.T.: {1}", // E.T. = exception type
|
||||
method.MetadataToken.ToInt32(),
|
||||
ex.GetType());
|
||||
}
|
||||
}
|
||||
finally {
|
||||
Log.indentLevel = oldIndentLevel;
|
||||
|
@ -571,6 +577,16 @@ namespace de4dot.code {
|
|||
}
|
||||
}
|
||||
|
||||
static bool canLoadMethodBody(MethodDefinition method) {
|
||||
try {
|
||||
var body = method.Body;
|
||||
return true;
|
||||
}
|
||||
catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void deobfuscate(MethodDefinition method, BlocksCflowDeobfuscator cflowDeobfuscator, MethodPrinter methodPrinter) {
|
||||
if (!hasNonEmptyBody(method))
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue
Block a user