Fix invalid handle use in PhpSymbolCallbackFunction
There is no point to provide "fake" handle to system API.
Moreover it could cause crashes if "Strict handle check" mitigation is
enabled.
@@ -379,6 +379,8 @@ BOOL CALLBACK PhpSymbolCallbackFunction(
{
PIMAGEHLP_CBA_READ_MEMORY callbackData = (PIMAGEHLP_CBA_READ_MEMORY)CallbackData;
+ if (symbolProvider->IsRealHandle)
+ {
if (NT_SUCCESS(NtReadVirtualMemory(
ProcessHandle,
(PVOID)callbackData->addr,
@@ -390,6 +392,7 @@ BOOL CALLBACK PhpSymbolCallbackFunction(
return TRUE;
}
}
+ }
return FALSE;
case CBA_DEFERRED_SYMBOL_LOAD_CANCEL:
{
