From 79bcc7d6e133ac5ba87ebecfb375b6a39ca7c7ca Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Tue, 28 Aug 2018 15:18:05 -0400 Subject: [PATCH] remove overly defensive programming (that doesnt even work) --- include/defs.h | 1 - vnrhook/pipe.cc | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/defs.h b/include/defs.h index 40e3491..b3df3a7 100644 --- a/include/defs.h +++ b/include/defs.h @@ -17,6 +17,5 @@ // Mutex #define ITH_HOOKMAN_MUTEX_ L"VNR_HOOKMAN_" // ITH_HOOKMAN_%d -#define ITH_GRANTPIPE_MUTEX L"VNR_GRANT_PIPE" // ITH_GRANT_PIPE // EOF diff --git a/vnrhook/pipe.cc b/vnrhook/pipe.cc index 462f97f..1f177fc 100644 --- a/vnrhook/pipe.cc +++ b/vnrhook/pipe.cc @@ -28,8 +28,7 @@ void CreatePipe() { DWORD count = 0; BYTE buffer[PIPE_BUFFER_SIZE] = {}; - HANDLE hostPipe = ::hookPipe = INVALID_HANDLE_VALUE, - pipeAcquisitionMutex = CreateMutexW(nullptr, TRUE, ITH_GRANTPIPE_MUTEX); + HANDLE hostPipe = ::hookPipe = INVALID_HANDLE_VALUE; while (::hookPipe == INVALID_HANDLE_VALUE || hostPipe == INVALID_HANDLE_VALUE) { @@ -49,9 +48,6 @@ void CreatePipe() *(DWORD*)buffer = GetCurrentProcessId(); WriteFile(::hookPipe, buffer, sizeof(DWORD), &count, nullptr); - ReleaseMutex(pipeAcquisitionMutex); - CloseHandle(pipeAcquisitionMutex); - ConsoleOutput("NextHooker: pipe connected"); #ifdef _WIN64 ConsoleOutput("Hooks don't work on x64, only read codes work. Engine disabled.");