Use ImplMap.IsPinvokeMethod()

This commit is contained in:
de4dot 2014-04-01 22:01:22 +02:00
parent 92cb021712
commit c77fdad74e

View File

@ -174,9 +174,9 @@ namespace de4dot.blocks {
public static bool IsPinvokeMethod(MethodDef method, string dll, string funcName) {
if (method == null)
return false;
if (method.ImplMap == null || method.ImplMap.Name.String != funcName)
if (method.ImplMap == null)
return false;
return GetDllName(dll).Equals(GetDllName(method.ImplMap.Module.Name.String), StringComparison.OrdinalIgnoreCase);
return method.ImplMap.IsPinvokeMethod(dll, funcName);
}
public static MethodDef GetMethod(ModuleDefMD module, IMethod method) {