2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
|
|
|
#include "core/stdafx.h"
|
|
|
|
#include "inputsystem/ButtonCode.h"
|
|
|
|
|
|
|
|
class CInputSystem
|
|
|
|
{
|
|
|
|
public:
|
2022-04-09 06:05:47 +02:00
|
|
|
void EnableInput(bool bEnabled); // @0x14039F100 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
|
|
|
void EnableMessagePump(bool bEnabled); // @0x14039F110 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
|
|
|
bool IsButtonDown(ButtonCode_t Button); // @0x1403A0140 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
char pad_0000[16]; //0x0000
|
|
|
|
public:
|
|
|
|
bool m_bEnabled; //0x0010 IsInputEnabled variable.
|
|
|
|
bool m_bPumpEnabled; //0x0011 EnabledMessagePump variable.
|
|
|
|
};
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
extern CInputSystem* g_pInputSystem
|
|
|
|
;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VInputSystem : public IDetour
|
2021-12-25 22:36:38 +01:00
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2021-12-25 22:36:38 +01:00
|
|
|
{
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| VAR: g_pInputSystem : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pInputSystem));
|
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
2021-12-25 22:36:38 +01:00
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetFun(void) const { }
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
2022-08-09 03:02:00 +02:00
|
|
|
g_pInputSystem = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>(
|
2022-04-18 03:35:08 +02:00
|
|
|
"\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x8D\x05\x00\x00\x00\x00\x48\x89\x05\x00\x00\x00\x00\x48\x85\xC9\x74\x11"),
|
|
|
|
"xxxxxxx????xxx????xxx????xxxxx").FindPatternSelf("48 89 05", CMemory::Direction::DOWN, 40).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CInputSystem*>();
|
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
virtual void Detach(void) const { }
|
2021-12-25 22:36:38 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VInputSystem);
|