2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
2022-01-16 00:35:39 +01:00
|
|
|
#include "squirrel/sqapi.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_Script_Remote_BeginRegisteringFunctions = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x83\x3D\x00\x00\x00\x00\x00\x74\x10"), "xxxxxx?????xx");
|
|
|
|
inline void* Script_Remote_BeginRegisteringFunctions = (void*)p_Script_Remote_BeginRegisteringFunctions.GetPtr(); /*48 83 EC 28 83 3D ?? ?? ?? ?? ?? 74 10*/
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_RestoreRemoteChecksumsFromSaveGame = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x4C\x24\x00\x41\x54\x48\x83\xEC\x40"), "xxxx?xxxxxx");
|
|
|
|
inline void* (*RestoreRemoteChecksumsFromSaveGame)(void* a1, void* a2) = (void* (*)(void*, void*))p_RestoreRemoteChecksumsFromSaveGame.GetPtr(); /*48 89 4C 24 ? 41 54 48 83 EC 40*/
|
2022-01-20 16:04:10 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
/* CHANGE THESE WHEN SWITCHING TO PYLONV2 TO UNSIGNED AGAIN!*/
|
|
|
|
#ifndef CLIENT_DLL
|
|
|
|
inline int32_t* g_nServerRemoteChecksum = reinterpret_cast<int32_t*>(p_RestoreRemoteChecksumsFromSaveGame.Offset(0x1C0).FindPatternSelf("48 8D 15", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).GetPtr());
|
|
|
|
#endif // !CLIENT_DLL
|
|
|
|
#ifndef DEDICATED
|
|
|
|
inline int32_t* g_nClientRemoteChecksum = reinterpret_cast<int32_t*>(p_Script_Remote_BeginRegisteringFunctions.Offset(0x0).FindPatternSelf("89 05", ADDRESS::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x2, 0x6).GetPtr());
|
|
|
|
#endif // !DEDICATED
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-01-16 00:35:39 +01:00
|
|
|
namespace VSquirrel
|
|
|
|
{
|
|
|
|
namespace SHARED
|
|
|
|
{
|
2022-03-30 22:54:33 +02:00
|
|
|
SQRESULT SDKNativeTest(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetSDKVersion(HSQUIRRELVM v);
|
2022-01-16 00:35:39 +01:00
|
|
|
}
|
2022-04-02 13:03:11 +02:00
|
|
|
#ifndef CLIENT_DLL
|
2022-01-16 00:35:39 +01:00
|
|
|
namespace SERVER
|
|
|
|
{
|
2022-04-02 13:03:11 +02:00
|
|
|
SQRESULT GetNumHumanPlayers(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetNumFakeClients(HSQUIRRELVM v);
|
2022-01-16 00:35:39 +01:00
|
|
|
}
|
2022-04-02 13:03:11 +02:00
|
|
|
#endif // !CLIENT_DLL
|
2022-01-16 00:35:39 +01:00
|
|
|
#ifndef DEDICATED
|
|
|
|
namespace CLIENT
|
|
|
|
{
|
|
|
|
}
|
|
|
|
namespace UI
|
|
|
|
{
|
2022-03-30 22:54:33 +02:00
|
|
|
SQRESULT GetServerName(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetServerPlaylist(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetServerMap(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetServerCount(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetPromoData(HSQUIRRELVM v);
|
|
|
|
SQRESULT SetEncKeyAndConnect(HSQUIRRELVM v);
|
|
|
|
SQRESULT CreateServerFromMenu(HSQUIRRELVM v);
|
|
|
|
SQRESULT JoinPrivateServerFromMenu(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetPrivateServerMessage(HSQUIRRELVM v);
|
|
|
|
SQRESULT ConnectToIPFromMenu(HSQUIRRELVM v);
|
|
|
|
SQRESULT GetAvailableMaps(HSQUIRRELVM v);
|
2022-01-16 00:35:39 +01:00
|
|
|
}
|
|
|
|
#endif // !DEDICATED
|
|
|
|
}
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
class HSqInit : public IDetour
|
|
|
|
{
|
|
|
|
virtual void debugp()
|
|
|
|
{
|
|
|
|
std::cout << "| FUN: Remote_BeginRegisteringFunctions : 0x" << std::hex << std::uppercase << p_Script_Remote_BeginRegisteringFunctions.GetPtr() << std::setw(npad) << " |" << std::endl;
|
2022-01-20 16:04:10 +01:00
|
|
|
std::cout << "| FUN: RestoreRemoteChecksumsFromSaveGame : 0x" << std::hex << std::uppercase << p_RestoreRemoteChecksumsFromSaveGame.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
|
|
std::cout << "| VAR: g_nServerRemoteChecksum : 0x" << std::hex << std::uppercase << g_nServerRemoteChecksum << std::setw(0) << " |" << std::endl;
|
|
|
|
std::cout << "| VAR: g_nClientRemoteChecksum : 0x" << std::hex << std::uppercase << g_nClientRemoteChecksum << std::setw(0) << " |" << std::endl;
|
2021-12-25 22:36:38 +01:00
|
|
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
REGISTER(HSqInit);
|