From 22068a81d8dbb6e4cc5d64153de72e933b3e82a1 Mon Sep 17 00:00:00 2001 From: Boomslangnz Date: Sun, 12 Mar 2023 09:20:48 +1300 Subject: [PATCH] GRID fix --- DllMain.cpp | 2 +- Game Files/GRID.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/DllMain.cpp b/DllMain.cpp index fe97134..202a584 100644 --- a/DllMain.cpp +++ b/DllMain.cpp @@ -2283,7 +2283,7 @@ DWORD WINAPI FFBLoop(LPVOID lpParam) { hlp.log("In FFBLoop"); - if (configGameId != 22 && configGameId != 29 && configGameId != 34) //For games which need code to run quicker etc. Some games will crash if no sleep added + if (configGameId != 22 && configGameId != 29 && configGameId != 34 && configGameId != 10) //For games which need code to run quicker etc. Some games will crash if no sleep added Sleep(2500); Initialize(0); diff --git a/Game Files/GRID.cpp b/Game Files/GRID.cpp index 43e2e5c..0b947e8 100644 --- a/Game Files/GRID.cpp +++ b/Game Files/GRID.cpp @@ -70,14 +70,12 @@ void GRID::FFBLoop(EffectConstants* constants, Helpers* helpers, EffectTriggers* { init = true; - HMODULE hMod = GetModuleHandleA("inpout32.dll"); - if (hMod) - { - MH_Initialize(); - MH_CreateHook((void*)0xB9CDE0, EnableFFBHook, (void**)&EnableFFBOri); - MH_CreateHookApi(L"inpout32.dll", "Out32", Out32Hook, (void**)&Out32Ori); - MH_EnableHook(MH_ALL_HOOKS); - } + DWORD ImageBase = (DWORD)GetModuleHandleA(0); + + MH_Initialize(); + MH_CreateHook((void*)(ImageBase + 0x79CDE0), EnableFFBHook, (void**)&EnableFFBOri); + MH_CreateHookApi(L"inpout32.dll", "Out32", Out32Hook, (void**)&Out32Ori); + MH_EnableHook(MH_ALL_HOOKS); } myTriggers = triggers;