From 70c64202b8b2cec71599eb29fd0b0019923d4f1d Mon Sep 17 00:00:00 2001 From: rexx <67599507+r-ex@users.noreply.github.com> Date: Sun, 27 Nov 2022 16:19:29 +0000 Subject: [PATCH] added Miles_Initialize print --- r5dev/milessdk/shared/core.cpp | 11 +++++++++++ r5dev/milessdk/shared/core.h | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/r5dev/milessdk/shared/core.cpp b/r5dev/milessdk/shared/core.cpp index 1ad2c837..feeb60ec 100644 --- a/r5dev/milessdk/shared/core.cpp +++ b/r5dev/milessdk/shared/core.cpp @@ -7,12 +7,23 @@ void AIL_LogFunc(int64_t nLogLevel, const char* pszMessage) v_AIL_LogFunc(nLogLevel, pszMessage); } +bool Miles_Initialize() +{ + bool result = v_Miles_Initialize(); + + DevMsg(eDLL_T::AUDIO, "Miles_Initialize: %s\n", result ? "initialized successfully" : "failed to initialize"); + + return result; +} + void MilesCore_Attach() { DetourAttach(&v_AIL_LogFunc, &AIL_LogFunc); + DetourAttach(&v_Miles_Initialize, &Miles_Initialize); } void MilesCore_Detach() { DetourDetach(&v_AIL_LogFunc, &AIL_LogFunc); + DetourDetach(&v_Miles_Initialize, &Miles_Initialize); } \ No newline at end of file diff --git a/r5dev/milessdk/shared/core.h b/r5dev/milessdk/shared/core.h index ae86832a..033c8ac7 100644 --- a/r5dev/milessdk/shared/core.h +++ b/r5dev/milessdk/shared/core.h @@ -4,6 +4,9 @@ inline CMemory p_AIL_LogFunc; inline auto v_AIL_LogFunc = p_AIL_LogFunc.RCast(); +inline CMemory p_Miles_Initialize; +inline auto v_Miles_Initialize = p_Miles_Initialize.RCast(); + void MilesCore_Attach(); void MilesCore_Detach(); @@ -20,6 +23,10 @@ class MilesCore : public IDetour p_AIL_LogFunc = g_GameDll.FindPatternSIMD(reinterpret_cast("\x40\x53\x48\x83\xEC\x20\x48\x8B\xDA\x48\x8D\x15\x00\x00\x00\x00"), "xxxxxxxxxxxx????"); v_AIL_LogFunc = p_AIL_LogFunc.RCast(); // 0x1409D1420 // 40 53 48 83 EC 20 48 8B DA 48 8D 15 ? ? ? ? // + + p_Miles_Initialize = g_GameDll.FindPatternSIMD(reinterpret_cast("\xE8\x00\x00\x00\x00\xFF\x0D\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00"), "x????xx????xx?????").FollowNearCallSelf();; + v_Miles_Initialize = p_Miles_Initialize.RCast(); + // 0x14095A140 // E8 ? ? ? ? FF 0D ? ? ? ? C6 05 ? ? ? ? ? // } virtual void GetVar(void) const { } virtual void GetCon(void) const { }