Add another getMethod() for generics
This commit is contained in:
parent
1867a06e84
commit
1b1cf4ec60
|
@ -458,11 +458,23 @@ namespace de4dot.blocks {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MethodDefinition getMethod(ModuleDefinition module, MethodReference method) {
|
public static MethodDefinition getMethod(ModuleDefinition module, MethodReference method) {
|
||||||
|
if (method == null)
|
||||||
|
return null;
|
||||||
|
return getMethod(module, method, method.DeclaringType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MethodDefinition getMethod2(ModuleDefinition module, MethodReference method) {
|
||||||
|
if (method == null)
|
||||||
|
return null;
|
||||||
|
return getMethod(module, method, method.DeclaringType.GetElementType());
|
||||||
|
}
|
||||||
|
|
||||||
|
static MethodDefinition getMethod(ModuleDefinition module, MethodReference method, TypeReference declaringType) {
|
||||||
if (method == null)
|
if (method == null)
|
||||||
return null;
|
return null;
|
||||||
if (method is MethodDefinition)
|
if (method is MethodDefinition)
|
||||||
return (MethodDefinition)method;
|
return (MethodDefinition)method;
|
||||||
return getMethod(getType(module, method.DeclaringType), method);
|
return getMethod(getType(module, declaringType), method);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MethodDefinition getMethod(TypeDefinition type, string returnType, string parameters) {
|
public static MethodDefinition getMethod(TypeDefinition type, string returnType, string parameters) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user