2022-11-27 15:02:22 +01:00
|
|
|
#pragma once
|
2022-11-27 20:44:17 +00:00
|
|
|
#include "miles_types.h"
|
2022-11-27 15:02:22 +01:00
|
|
|
|
|
|
|
/* ==== WASAPI THREAD SERVICE =========================================================================================================================================== */
|
|
|
|
inline CMemory p_AIL_LogFunc;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline void(*v_AIL_LogFunc)(int64_t nLogLevel, const char* pszMessage);
|
2022-11-27 15:02:22 +01:00
|
|
|
|
2022-11-27 16:19:29 +00:00
|
|
|
inline CMemory p_Miles_Initialize;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline bool(*v_Miles_Initialize)();
|
2022-11-27 16:19:29 +00:00
|
|
|
|
2022-11-27 20:44:17 +00:00
|
|
|
inline CMemory p_MilesQueueEventRun;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline void(*v_MilesQueueEventRun)(Miles::Queue*, const char*);
|
2022-11-27 20:44:37 +00:00
|
|
|
|
|
|
|
inline CMemory p_MilesBankPatch;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline void(*v_MilesBankPatch)(Miles::Bank*, char*, char*);
|
2022-11-27 20:44:37 +00:00
|
|
|
|
2022-11-27 15:02:22 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
class MilesCore : public IDetour
|
|
|
|
{
|
|
|
|
virtual void GetAdr(void) const
|
|
|
|
{
|
2023-01-25 02:26:52 +01:00
|
|
|
LogFunAdr("AIL_LogFunc", p_AIL_LogFunc.GetPtr());
|
|
|
|
LogFunAdr("Miles_Initialize", p_Miles_Initialize.GetPtr());
|
2022-11-27 15:02:22 +01:00
|
|
|
}
|
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
2022-12-01 22:44:55 +01:00
|
|
|
p_AIL_LogFunc = g_GameDll.FindPatternSIMD("40 53 48 83 EC 20 48 8B DA 48 8D 15 ?? ?? ?? ??");
|
2022-11-27 15:02:22 +01:00
|
|
|
v_AIL_LogFunc = p_AIL_LogFunc.RCast<void(*)(int64_t, const char*)>();
|
2022-11-27 16:19:29 +00:00
|
|
|
|
2023-03-01 00:09:38 +01:00
|
|
|
#if !defined (GAMEDLL_S0) && !defined (GAMEDLL_S1) && !defined (GAMEDLL_S2)
|
|
|
|
p_Miles_Initialize = g_GameDll.FindPatternSIMD("40 53 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ?? 80 3D ?? ?? ?? ?? ??");
|
|
|
|
#else
|
|
|
|
p_Miles_Initialize = g_GameDll.FindPatternSIMD("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 80 3D ?? ?? ?? ?? ??");
|
|
|
|
#endif // !(GAMEDLL_S0) || !(GAMEDLL_S1) || !(GAMEDLL_S2)
|
2022-11-27 16:19:29 +00:00
|
|
|
v_Miles_Initialize = p_Miles_Initialize.RCast<bool(*)()>();
|
2022-11-27 20:44:17 +00:00
|
|
|
|
2023-06-25 10:29:42 +02:00
|
|
|
p_MilesQueueEventRun = g_RadAudioSystemDll.GetExportedSymbol("MilesQueueEventRun");
|
2022-11-27 20:44:17 +00:00
|
|
|
v_MilesQueueEventRun = p_MilesQueueEventRun.RCast<void(*)(Miles::Queue*, const char*)>();
|
2022-11-27 20:44:37 +00:00
|
|
|
|
2023-06-25 10:29:42 +02:00
|
|
|
p_MilesBankPatch = g_RadAudioSystemDll.GetExportedSymbol("MilesBankPatch");
|
2022-11-27 20:44:37 +00:00
|
|
|
v_MilesBankPatch = p_MilesBankPatch.RCast<void(*)(Miles::Bank*, char*, char*)>();
|
|
|
|
|
2022-11-27 15:02:22 +01:00
|
|
|
}
|
|
|
|
virtual void GetVar(void) const { }
|
|
|
|
virtual void GetCon(void) const { }
|
2023-01-25 02:26:52 +01:00
|
|
|
virtual void Attach(void) const;
|
|
|
|
virtual void Detach(void) const;
|
2022-11-27 15:02:22 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|