From 0b7083edadefaaeba53da3eff005767bfe0d2341 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Sun, 4 Feb 2024 01:21:18 +1100 Subject: [PATCH] new hook for UpdateDraw2D (should be compatible with DivaGL) --- source-code/source/plugins/TLAC/Constants.h | 2 +- source-code/source/plugins/TLAC/dllmain.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source-code/source/plugins/TLAC/Constants.h b/source-code/source/plugins/TLAC/Constants.h index d4b2d14..4d32b70 100644 --- a/source-code/source/plugins/TLAC/Constants.h +++ b/source-code/source/plugins/TLAC/Constants.h @@ -8,7 +8,7 @@ constexpr uint8_t JNE_OPCODE = 0x85; //constexpr uint64_t ENGINE_UPDATE_HOOK_TARGET_ADDRESS = 0x000000014018CC40; constexpr uint64_t ENGINE_UPDATE_INPUT_ADDRESS = 0x000000014018CBB0; -constexpr uint64_t ENGINE_DRAW_2D_ADDRESS = 0x0000000140501F70; +constexpr uint64_t ENGINE_STAGE_DISP_SHADOW_ADDRESS = 0x0000000140649840; constexpr uint64_t ENGINE_FINISH_DRAW_ADDRESS = 0x0000000140192730; constexpr uint64_t CURRENT_GAME_STATE_ADDRESS = 0x0000000140EDA810; diff --git a/source-code/source/plugins/TLAC/dllmain.cpp b/source-code/source/plugins/TLAC/dllmain.cpp index c9aece5..90b1c36 100644 --- a/source-code/source/plugins/TLAC/dllmain.cpp +++ b/source-code/source/plugins/TLAC/dllmain.cpp @@ -22,7 +22,7 @@ #pragma comment(lib, "detours.lib") void(__cdecl* divaEngineUpdate)() = (void(__cdecl*)())0x14018CC40; -void(__cdecl* divaEngineDraw2D)(void* addr) = (void(__cdecl*)(void* addr))ENGINE_DRAW_2D_ADDRESS; +void(__cdecl* divaEngineStageDispShadow)() = (void(__cdecl*)())ENGINE_STAGE_DISP_SHADOW_ADDRESS; LRESULT CALLBACK MessageWindowProcessCallback(HWND, UINT, WPARAM, LPARAM); DWORD WINAPI WindowMessageDispatcher(LPVOID); @@ -396,10 +396,10 @@ void hookedEngineUpdate() //divaEngineUpdate(); } -void hookedEngineDraw2D(void* addr) +void hookedEngineStageDispShadow() { + divaEngineStageDispShadow(); TLAC::UpdateDraw2D(); - divaEngineDraw2D(addr); } BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) @@ -425,7 +425,7 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReser DetourTransactionBegin(); DetourUpdateThread(GetCurrentThread()); - DetourAttach(&(PVOID&)divaEngineDraw2D, hookedEngineDraw2D); + DetourAttach(&(PVOID&)divaEngineStageDispShadow, hookedEngineStageDispShadow); DetourTransactionCommit(); //TLAC::InitializeExtraSettings();