From 325219104aa01474ea0a176579865903a4971e2d Mon Sep 17 00:00:00 2001 From: Guus Waals <_@guusw.nl> Date: Fri, 30 May 2025 15:05:37 +0800 Subject: [PATCH] Remove dll link stub --- game_re/r3/binders/dbg_mem.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/game_re/r3/binders/dbg_mem.cxx b/game_re/r3/binders/dbg_mem.cxx index 6a25a81d..7c47c4c3 100644 --- a/game_re/r3/binders/dbg_mem.cxx +++ b/game_re/r3/binders/dbg_mem.cxx @@ -2,20 +2,16 @@ #include #include #include +#include #define GH_BASE_ADDR 0x00400000 static uintptr_t g_gh_translationOffset{}; -extern "C" { -cdecl void CDAPFN0506_CDAPFN0506_X_IPT_fn_vResetInputEntry(); -} - struct R3Bin { R3Bin() { loadOriginal(); } void loadOriginal() { - void* ptr = (void*)&CDAPFN0506_CDAPFN0506_X_IPT_fn_vResetInputEntry; SPDLOG_DEBUG("Loading original binary"); auto &config = getDefaultConfig(); @@ -34,16 +30,16 @@ struct R3Bin { } inline void relocate(HMODULE module, void* from, void* to, void* check) { - auto relocated_addr = uintptr_t(from) + translationOffset; - auto relocated_to = uintptr_t(to) + translationOffset; + void* relocated_addr = (void*)(uintptr_t(from) + translationOffset); + void* relocated_to = (void*)(uintptr_t(to) + translationOffset); void *checkRead{}; - size_t numRead{}; + SIZE_T numRead{}; ReadProcessMemory(GetCurrentProcess(), relocated_addr, &checkRead, sizeof(checkRead), &numRead); WriteProcessMemory(GetCurrentProcess(), relocated_addr, relocated_to, sizeof(relocated_to), NULL); } void relocateModule(HMODULE module) { - #define REL(from, to, original) relocate(module, (void*)(from), (void*)(to), (void*)(original)) + #define REL(from, to, original) relocate(module, (void*)(from), (void*)(to), (void*)(original)); #include "relocations.def" }