From f5a32da2116d1e6e5b52426feecd2a3f3765f291 Mon Sep 17 00:00:00 2001 From: silverf0x Date: Sun, 29 Oct 2017 14:40:28 +0000 Subject: [PATCH] Limit the MAX_SIMPLE_DICT_ENTRIES 0x200 to avoid dead lock when searching for the RpcServer (heuristic approach) --- RpcCore/RpcCore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RpcCore/RpcCore.c b/RpcCore/RpcCore.c index 9c093b2..d9165d9 100644 --- a/RpcCore/RpcCore.c +++ b/RpcCore/RpcCore.c @@ -19,7 +19,7 @@ #pragma comment(lib,"Version.lib") #pragma comment(lib,"Userenv.lib") -#define MAX_SIMPLE_DICT_ENTRIES 0x400 +#define MAX_SIMPLE_DICT_ENTRIES 0x200 #define RPC_MAX_ENDPOINT_PROTOCOL_SIZE 0x100 #define RPC_MAX_ENDPOINT_NAME_SIZE 0x100 #define RPC_MAX_DLL_NAME_SIZE 0x100 @@ -191,7 +191,7 @@ BOOL WINAPI GetRpcServerAddressCallback(HANDLE hProcess, UINT Index, VOID PTR_T UNREFERENCED_PARAMETER(Index); if (!ReadProcessMemory(hProcess,pSimpleDictEntry,&RpcInterface,sizeof(RpcInterface),NULL)) goto End; - + if ( (RpcInterface.RpcServerInterface.Length==sizeof(RPC_SERVER_INTERFACE_T)) && (!memcmp(&RpcInterface.RpcServerInterface.TransferSyntax, &DceRpcSyntaxUuid, sizeof(DceRpcSyntaxUuid)))) {