Смотри, по идее эти функции на Си и на Си++ выполняют один и тот же функционал: находят Rpcсервер в процессе, но почему то функция на си не может его найти, объясни как работает поиск и скажи почему в одном месте работает а в другом нет: на Си: BOOL WINAPI GetRpcServerAddressInProcess(DWORD Pid, RpcCoreInternalCtxt_T* pRpcCoreInternalCtxt)
{
	VOID PTR_T PTR_T					pCandidate;
	VOID PTR_T							pRpcServer;
	RPC_SERVER_T						RpcServer;
	ModuleSectionInfo_T					ModuleSectionInfo;
	HANDLE								hProcess = NULL;
	GetRpcServerAddressCallbackCtxt_T	GetRpcServerAddressCallbackCtxt;
	DWORD								cbSize;
	HMODULE* pHmodule = NULL;
	CHAR								ModuleFileName[MAX_PATH];
	BOOL								bResult = FALSE;

	//hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Pid);
	hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, Pid);
	if (hProcess == NULL) goto End;

	if (!EnumProcessModulesEx(hProcess, NULL, 0, &cbSize, LIST_MODULES_ALL)) goto End;
	pHmodule = (HMODULE*)malloc(cbSize);
	if (pHmodule == NULL) goto End;
	if (!EnumProcessModulesEx(hProcess, pHmodule, cbSize, &cbSize, LIST_MODULES_ALL)) goto End;

	for (ULONG i = 0; i < cbSize / sizeof(*pHmodule); i++)
	{
		ModuleFileName[0] = 0;
		GetModuleFileNameExA(hProcess, pHmodule[i], ModuleFileName, sizeof(ModuleFileName));
		if (strstr(ModuleFileName, "RPCRT4.dll") == NULL) goto NextModule;

		if (!GetModuleDataSection(hProcess, pHmodule[i], &ModuleSectionInfo)) goto End;
#pragma warning(push)
#pragma warning(disable:4305)
		pCandidate = (VOID PTR_T PTR_T)ModuleSectionInfo.pBase;
#pragma warning(pop)
		GetRpcServerAddressCallbackCtxt.bFound = FALSE;
		//РАЗМЕР РАВЕН 0!!!!
		for (i = 0; i < ModuleSectionInfo.Size; i += sizeof(VOID PTR_T))
		{
			if (!ReadProcessMemory(hProcess, pCandidate, &pRpcServer, sizeof(VOID PTR_T), NULL))	goto NextCandidate;
			if (!ReadProcessMemory(hProcess, pRpcServer, &RpcServer, sizeof(RpcServer), NULL))		goto NextCandidate;
			GetRpcServerAddressCallbackCtxt.pRpcServer = (PRPC_SERVER_T)pRpcServer;
			if (!EnumSimpleDict(hProcess, &RpcServer.InterfaceDict, &GetRpcServerAddressCallback, &GetRpcServerAddressCallbackCtxt)) goto End;
			if (GetRpcServerAddressCallbackCtxt.bFound == TRUE)
			{
				_cprintf("gRpcServer localized at address %p in process %u\n", pCandidate, Pid);
				pRpcCoreInternalCtxt->pGlobalRpcServer = pCandidate;
				bResult = TRUE;
				break;
			}
		NextCandidate:
			pCandidate++;
		}
		CloseHandle(hProcess);
		hProcess = NULL;
		goto End;
	NextModule:;
	}
End:
	if (hProcess != NULL) CloseHandle(hProcess);
	if (pHmodule != NULL) free(pHmodule);
	return (bResult);
}
На С++: 
	IMAGE_SECTION_HEADER* dataSection = NULL;
	map<string, char*>* m;
	char* base;
	void** ifaces;
	RPC_INTERFACE_T iface;
	_RPC_SERVER_T* rpcServer;

	// Get loaded DLL's from the process
	m = this->p->GetLoadedModules();

	// Find rpcrt4.dll within the returned list
	if (m->count("RPCRT4.dll") == 0) {
		return NULL;
	}
	base = m->at("RPCRT4.dll");

	// Find .data section for RPCRT4.dll
	dataSection = this->p->FindSection((char*)base, ".data");
	if (dataSection == NULL) {
		return NULL;
	}

	// Align to virtual address
	base += dataSection->VirtualAddress;

	rpcServer = (RPC_SERVER_T*)malloc(sizeof(RPC_SERVER_T));
	if (rpcServer == NULL) {
		return NULL;
	}

	// Iterate through .data section to find RPC_SERVER
	for (int i = 0; i < dataSection->Misc.VirtualSize; i += 8) {

		ULONGLONG pointer;

		// Read a potential pointer to RPC_SERVER
		pointer = this->p->ReadQword((char*)base + i);

		// Attempt to read a potential RPC_SERVER object
		if (this->p->ReadMemory((void*)pointer, (unsigned char*)rpcServer, sizeof(RPC_SERVER_T)) != sizeof(RPC_SERVER_T)) {
			continue;
		}

		// Sanity check the interface dictionary
		if (rpcServer->InterfaceDict.NumberOfEntries <= MAX_SIMPLE_DICT_ENTRIES) {

			// Attempt to read interfaces
			ifaces = (void**)malloc(rpcServer->InterfaceDict.NumberOfEntries * sizeof(void*));
			if (ifaces == NULL) {
				return NULL;
			}

			if (this->p->ReadMemory((void*)rpcServer->InterfaceDict.pArray, (unsigned char*)ifaces, rpcServer->InterfaceDict.NumberOfEntries * sizeof(void*)) == rpcServer->InterfaceDict.NumberOfEntries * sizeof(void*)) {

				// Pass to validation function for further checks
				if (validate(this->p, reinterpret_cast<RPC_INTERFACE_T **>(ifaces), rpcServer->InterfaceDict.NumberOfEntries)) {

					// If validation passes, we have a RPC_SERVER instance which we can return
					free(ifaces);
					return rpcServer;
				}
			}
			free(ifaces);
		}
	}