bool CreateHooks(const char *libName) { RDCEraseEl(GL); if(!m_EnabledHooks) return false; bool success = SetupHooks(); if(!success) return false; m_HasHooks = true; return true; }
bool CreateHooks(const char *libName) { if(!m_EnabledHooks) return false; if(libName) LinuxHookLibrary("libGL.so", &libHooked); bool success = SetupHooks(GL); if(!success) return false; m_HasHooks = true; return true; }
bool VRAPIHook::CreateHooks(const char *libName) { if(!m_EnabledHooks) return false; if(libName) { PosixHookFunction("vrapi_CreateTextureSwapChain2", (void *)&vrapi_CreateTextureSwapChain2); PosixHookFunction("vrapi_CreateTextureSwapChain", (void *)&vrapi_CreateTextureSwapChain); PosixHookFunction("vrapi_SubmitFrame", (void *)&vrapi_SubmitFrame); PosixHookLibrary(libName, &libHooked); return true; } bool success = SetupHooks(); if(!success) return false; m_HasHooks = true; return true; }
void SetupExportedFunctions() { if(RenderDoc::Inst().IsReplayApp()) SetupHooks(); }
void HookThread::Execute(void * data) { apmOptions = LoadAPMAlertOptions(); RazerMonitorThread * rmt = new RazerMonitorThread(); HotkeyThread * hkt = new HotkeyThread(); rmt->Start(NULL); hkt->Start(NULL); bool wasIngame = false; while(!isTerminated()) { if(!hooksSetup) { SetupHooks(); if(!hooksSetup) Sleep(5000); } else { if(isIngame && !wasIngame) { logInfo("Game detected. Beginning initialization."); isObs = true; if(apmOptions != NULL) FreeAPMAlertOptions(apmOptions); apmOptions = LoadAPMAlertOptions(); if(pApmFont != NULL) pApmFont->Release(); if(pClockFont != NULL) pClockFont->Release(); if(pLine != NULL) pLine->Release(); pApmFont = NULL; pClockFont = NULL; pLine = NULL; initializeAPMCalculator(); minPassed = false; WriteHooks(); wasIngame = isIngame; } else if(wasIngame && !isIngame) { logInfo("Game end detected."); ClearHooks(); wasIngame = isIngame; } if(isIngame) { doAlert(); } } Sleep(100); } logInfo("APMAlert2 beginning termination."); rmt->setTerminated(true); hkt->setTerminated(true); ClearHooks(); logInfo("Freeing resources."); if(pApmFont != NULL) { pApmFont->Release(); pApmFont = NULL; } if(pClockFont != NULL) { pClockFont->Release(); pClockFont = NULL; } if(pLine != NULL) { pLine->Release(); pLine = NULL; } if(apmOptions != NULL) FreeAPMAlertOptions(apmOptions); logInfo("Termination complete."); freeLogger(); }