2022-05-09 21:21:05 +02:00
|
|
|
#pragma once
|
2022-08-08 17:49:46 +02:00
|
|
|
#include "sqtype.h"
|
|
|
|
|
2022-05-09 21:21:05 +02:00
|
|
|
extern bool g_bSQAuxError;
|
2022-05-20 01:16:30 +02:00
|
|
|
extern bool g_bSQAuxBadLogic;
|
2022-08-08 17:49:46 +02:00
|
|
|
extern HSQUIRRELVM g_pErrorVM;
|
2022-05-09 21:21:05 +02:00
|
|
|
|
|
|
|
inline CMemory p_sqstd_aux_printerror;
|
|
|
|
inline auto v_sqstd_aux_printerror = p_sqstd_aux_printerror.RCast<SQInteger(*)(HSQUIRRELVM v)>();
|
|
|
|
|
2022-05-20 01:12:05 +02:00
|
|
|
inline CMemory p_sqstd_aux_badlogic;
|
|
|
|
inline auto v_sqstd_aux_badlogic = p_sqstd_aux_badlogic.RCast<SQInteger(*)(HSQUIRRELVM v, __m128i* a2, __m128i* a3)>();
|
2022-05-09 21:21:05 +02:00
|
|
|
|
|
|
|
void SQAUX_Attach();
|
|
|
|
void SQAUX_Detach();
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VSqStdAux : public IDetour
|
2022-05-09 21:21:05 +02:00
|
|
|
{
|
|
|
|
virtual void GetAdr(void) const
|
|
|
|
{
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| FUN: sqstd_aux_printerror : {:#18x} |\n", p_sqstd_aux_printerror.GetPtr());
|
2022-05-20 01:12:05 +02:00
|
|
|
spdlog::debug("| FUN: sqstd_aux_badlogic : {:#18x} |\n", p_sqstd_aux_badlogic.GetPtr());
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
2022-05-09 21:21:05 +02:00
|
|
|
}
|
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
2022-12-01 22:44:55 +01:00
|
|
|
p_sqstd_aux_printerror = g_GameDll.FindPatternSIMD("40 53 55 56 57 41 54 41 55 41 57 48 81 EC ?? ?? ?? ??");
|
2022-05-09 21:21:05 +02:00
|
|
|
v_sqstd_aux_printerror = p_sqstd_aux_printerror.RCast<SQInteger(*)(HSQUIRRELVM)>(); /*40 53 55 56 57 41 54 41 55 41 57 48 81 EC ?? ?? ?? ??*/
|
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-12-01 22:44:55 +01:00
|
|
|
p_sqstd_aux_printerror = g_GameDll.FindPatternSIMD("40 53 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ?? FF 05 ?? ?? ?? ??");
|
2022-05-09 21:21:05 +02:00
|
|
|
v_sqstd_aux_printerror = p_sqstd_aux_printerror.RCast<SQInteger(*)(HSQUIRRELVM)>(); /*40 53 56 57 41 54 41 55 41 56 41 57 48 81 EC ?? ?? ?? ?? FF 05 ?? ?? ?? ??*/
|
|
|
|
#endif
|
2022-12-01 22:44:55 +01:00
|
|
|
p_sqstd_aux_badlogic = g_GameDll.FindPatternSIMD("48 8B C4 55 48 8B EC 48 83 EC 70 41 0F 10 ??");
|
2022-05-20 01:12:05 +02:00
|
|
|
v_sqstd_aux_badlogic = p_sqstd_aux_badlogic.RCast<SQInteger(*)(HSQUIRRELVM, __m128i*, __m128i*)>(); /*48 8B C4 55 48 8B EC 48 83 EC 70 41 0F 10 00*/
|
2022-05-09 21:21:05 +02:00
|
|
|
}
|
|
|
|
virtual void GetVar(void) const { }
|
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
virtual void Detach(void) const { }
|
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VSqStdAux);
|