Use callsMethod()

This commit is contained in:
de4dot 2012-03-21 03:49:28 +01:00
parent 7f1bad748e
commit 8ca040f0da
3 changed files with 2 additions and 15 deletions

View File

@ -116,7 +116,7 @@ namespace de4dot.code.deobfuscators.DeepSea {
}
protected override bool checkResolverInitMethodInternal(MethodDefinition resolverInitMethod) {
return checkIfCalled(resolverInitMethod, "System.Void System.AppDomain::add_AssemblyResolve(System.ResolveEventHandler)");
return DotNetUtils.callsMethod(resolverInitMethod, "System.Void System.AppDomain::add_AssemblyResolve(System.ResolveEventHandler)");
}
protected override bool checkHandlerMethodDesktopInternal(MethodDefinition handler) {

View File

@ -111,19 +111,6 @@ namespace de4dot.code.deobfuscators.DeepSea {
protected abstract bool checkResolverInitMethodInternal(MethodDefinition resolverInitMethod);
protected static bool checkIfCalled(MethodDefinition method, string fullName) {
foreach (var instr in method.Body.Instructions) {
if (instr.OpCode.Code != Code.Call && instr.OpCode.Code != Code.Callvirt)
continue;
if (instr.Operand.ToString() != fullName)
continue;
return true;
}
return false;
}
IEnumerable<MethodDefinition> getLdftnMethods(MethodDefinition method) {
var list = new List<MethodDefinition>();
foreach (var instr in method.Body.Instructions) {

View File

@ -42,7 +42,7 @@ namespace de4dot.code.deobfuscators.DeepSea {
}
protected override bool checkResolverInitMethodInternal(MethodDefinition resolverInitMethod) {
return checkIfCalled(resolverInitMethod, "System.Void System.AppDomain::add_ResourceResolve(System.ResolveEventHandler)");
return DotNetUtils.callsMethod(resolverInitMethod, "System.Void System.AppDomain::add_ResourceResolve(System.ResolveEventHandler)");
}
protected override bool checkHandlerMethodDesktopInternal(MethodDefinition handler) {