Fix problem when HasPInvokeInfo == true but PInvokeInfo == null
This commit is contained in:
parent
f524989a1e
commit
c66c062753
|
@ -225,7 +225,7 @@ namespace de4dot.blocks {
|
|||
public static bool isPinvokeMethod(MethodDefinition method, string dll, string funcName) {
|
||||
if (method == null)
|
||||
return false;
|
||||
if (!method.HasPInvokeInfo || method.PInvokeInfo.EntryPoint != funcName)
|
||||
if (method.PInvokeInfo == null || method.PInvokeInfo.EntryPoint != funcName)
|
||||
return false;
|
||||
return getDllName(dll).Equals(getDllName(method.PInvokeInfo.Module.Name), StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
|
|
@ -1336,7 +1336,7 @@ namespace de4dot.renamer {
|
|||
INameCreator nameCreator = null;
|
||||
string newName = null;
|
||||
|
||||
if (methodDef.MethodDefinition.HasPInvokeInfo)
|
||||
if (methodDef.MethodDefinition.PInvokeInfo != null)
|
||||
newName = getPinvokeName(methodDef);
|
||||
else if (methodDef.MethodDefinition.IsStatic)
|
||||
nameCreator = variableNameState.staticMethodNameCreator;
|
||||
|
|
Loading…
Reference in New Issue
Block a user