Skip to content

Commit

Permalink
Comment out handler in MainHook.
Browse files Browse the repository at this point in the history
For the IsDebuggerPresent.  Might be useful sometime, but doesn't presently work.  Worth trying, depending on game, so left in as commented out.
  • Loading branch information
bo3b committed Jan 2, 2015
1 parent 6090b8d commit 5c4afca
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions DirectX11/MainHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ static HMODULE WINAPI Hooked_LoadLibraryExW(_In_ LPCWSTR lpLibFileName, _Reserve

// Function to be called whenever real IsDebuggerPresent is called, so that we can force it to false.

static BOOL WINAPI Hooked_IsDebuggerPresent()
{
return sIsDebuggerPresent_Hook.fnIsDebuggerPresent();
}
//static BOOL WINAPI Hooked_IsDebuggerPresent()
//{
// return sIsDebuggerPresent_Hook.fnIsDebuggerPresent();
//}

static bool InstallHooks()
{
HINSTANCE hKernel32;
LPVOID fnOrigLoadLibrary, fnOrigIsDebuggerPresent;
LPVOID fnOrigLoadLibrary;
//LPVOID fnOrigIsDebuggerPresent;
DWORD dwOsErr;

if (bLog) NktHookLibHelpers::DebugPrint("Attempting to hook LoadLibraryExW using Deviare in-proc.\n");
Expand Down Expand Up @@ -118,15 +119,15 @@ static bool InstallHooks()


// Next hook IsDebuggerPresent to force it false. Same Kernel32.dll
fnOrigIsDebuggerPresent = NktHookLibHelpers::GetProcedureAddress(hKernel32, "IsDebuggerPresent");
if (fnOrigIsDebuggerPresent == NULL)
{
if (bLog) NktHookLibHelpers::DebugPrint("Failed to get address of IsDebuggerPresent for hook.\n");
return false;
}

dwOsErr = cHookMgr.Hook(&(sIsDebuggerPresent_Hook.nHookId), (LPVOID*)&(sIsDebuggerPresent_Hook.fnIsDebuggerPresent),
fnOrigIsDebuggerPresent, Hooked_IsDebuggerPresent);
//fnOrigIsDebuggerPresent = NktHookLibHelpers::GetProcedureAddress(hKernel32, "IsDebuggerPresent");
//if (fnOrigIsDebuggerPresent == NULL)
//{
// if (bLog) NktHookLibHelpers::DebugPrint("Failed to get address of IsDebuggerPresent for hook.\n");
// return false;
//}

//dwOsErr = cHookMgr.Hook(&(sIsDebuggerPresent_Hook.nHookId), (LPVOID*)&(sIsDebuggerPresent_Hook.fnIsDebuggerPresent),
// fnOrigIsDebuggerPresent, Hooked_IsDebuggerPresent);

if (bLog) NktHookLibHelpers::DebugPrint("InstallHooks for IsDebuggerPresent using Deviare in-proc: %x\n", dwOsErr);

Expand Down

0 comments on commit 5c4afca

Please sign in to comment.