Use callsMethod()
This commit is contained in:
parent
7f1bad748e
commit
8ca040f0da
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user