Check op for null and update detection code
This commit is contained in:
parent
6f4447aa98
commit
7bdea53134
|
@ -51,9 +51,13 @@ namespace de4dot.deobfuscators.dotNET_Reactor {
|
||||||
|
|
||||||
MethodDefinition fieldMethod = null, typeMethod = null;
|
MethodDefinition fieldMethod = null, typeMethod = null;
|
||||||
foreach (var method in type.Methods) {
|
foreach (var method in type.Methods) {
|
||||||
if (DotNetUtils.isMethod(method, "System.RuntimeTypeHandle", "(System.Int32)"))
|
if (method.Parameters.Count != 1)
|
||||||
|
continue;
|
||||||
|
if (method.Parameters[0].ParameterType.FullName != "System.Int32")
|
||||||
|
continue;
|
||||||
|
if (method.MethodReturnType.ReturnType.FullName == "System.RuntimeTypeHandle")
|
||||||
typeMethod = method;
|
typeMethod = method;
|
||||||
else if (DotNetUtils.isMethod(method, "System.RuntimeFieldHandle", "(System.Int32)"))
|
else if (method.MethodReturnType.ReturnType.FullName == "System.RuntimeFieldHandle")
|
||||||
fieldMethod = method;
|
fieldMethod = method;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +85,8 @@ namespace de4dot.deobfuscators.dotNET_Reactor {
|
||||||
if (call.OpCode.Code != Code.Call)
|
if (call.OpCode.Code != Code.Call)
|
||||||
continue;
|
continue;
|
||||||
var method = call.Operand as MethodReference;
|
var method = call.Operand as MethodReference;
|
||||||
|
if (method == null)
|
||||||
|
continue;
|
||||||
if (!MemberReferenceHelper.compareTypes(type, method.DeclaringType))
|
if (!MemberReferenceHelper.compareTypes(type, method.DeclaringType))
|
||||||
continue;
|
continue;
|
||||||
var methodDef = DotNetUtils.getMethod(module, method);
|
var methodDef = DotNetUtils.getMethod(module, method);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user