Remove automated error reporting code from SA 4.x assemblies

This commit is contained in:
de4dot 2011-10-12 22:50:19 +02:00
parent 9ed55629e6
commit b3463a3859

View File

@ -96,7 +96,7 @@ namespace de4dot.deobfuscators.SmartAssembly {
bool isAutomatedErrorReportingMethodHelper(MethodDefinition method) { bool isAutomatedErrorReportingMethodHelper(MethodDefinition method) {
if (!method.HasBody || !method.IsStatic || method.Name == ".ctor") if (!method.HasBody || !method.IsStatic || method.Name == ".ctor")
return false; return false;
if (DotNetUtils.hasReturnValue(method)) if (DotNetUtils.hasReturnValue(method) && method.MethodReturnType.ReturnType.FullName != "System.Exception")
return false; return false;
if (method.Parameters.Count == 0) if (method.Parameters.Count == 0)
return false; return false;
@ -112,9 +112,8 @@ namespace de4dot.deobfuscators.SmartAssembly {
bool isAutomatedErrorReportingMethod(MethodDefinition method) { bool isAutomatedErrorReportingMethod(MethodDefinition method) {
if (!method.HasBody || !method.IsStatic || method.Name == ".ctor") if (!method.HasBody || !method.IsStatic || method.Name == ".ctor")
return false; return false;
if (!DotNetUtils.isMethod(method, "System.Void", "(System.Exception,System.Object[])")) return DotNetUtils.isMethod(method, "System.Void", "(System.Exception,System.Object[])") ||
return false; DotNetUtils.isMethod(method, "System.Exception", "(System.Exception,System.Object[])");
return true;
} }
void initUnhandledExceptionFilterMethods() { void initUnhandledExceptionFilterMethods() {