2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
|
|
|
#include "tier0/basetypes.h"
|
|
|
|
#include "tier0/IConVar.h"
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
/* ==== CCVAR =========================================================================================================================================================== */
|
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
2022-01-10 01:20:44 +01:00
|
|
|
ADDRESS p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x57\x41\x56\x48\x83\xEC\x38\x4C\x8B\x35", "xxxxxxxxxxx");
|
|
|
|
void* (*CCVar_Disconnect)() = (void* (*)())p_CCVar_Disconnect.GetPtr(); /*40 57 41 56 48 83 EC 38 4C 8B 35 ? ? ? ?*/
|
2021-12-25 22:36:38 +01:00
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-01-10 01:20:44 +01:00
|
|
|
ADDRESS p_CCVar_Disconnect = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x48\x83\xEC\x28\x48\x8B\x0D\x00\x00\x00\x00\x48\x85\xC9\x74\x26\x80\x3D\x00\x00\x00\x00\x00\x74\x1D\x48\x8B\x01\x8B\x15\x00\x00\x00\x00\xFF\x50\x58\xC7\x05\x00\x00\x00\x00\x00\x00\x00\x00\xC6\x05\x00\x00\x00\x00\x00\x48\xC7\x05\x00\x00\x00", "xxxxxxx????xxxxxxx?????xxxxxxx????xxxxx????????xx");
|
|
|
|
void* (*CCVar_Disconnect)() = (void* (*)())p_CCVar_Disconnect.GetPtr(); /*48 83 EC 28 48 8B 0D ? ? ? ? 48 85 C9 74 26 80 3D ? ? ? ? ? 74 1D 48 8B 01 8B 15 ? ? ? ? FF 50 58 C7 05 ? ? ? ? ? ? ? ? C6 05 ? ? ? ? ? 48 C7 05 ? ? ? ? ? ? ? ?*/
|
2021-12-25 22:36:38 +01:00
|
|
|
#endif
|
2022-01-10 01:20:44 +01:00
|
|
|
ADDRESS p_CCVar_GetCommandLineValue = g_mGameDll.FindPatternSIMD((std::uint8_t*)"\x40\x55\x48\x83\xEC\x20\x48\x8D\x6C\x24\x00\x48\x89\x5D\x10\x49\xC7\xC0\x00\x00\x00\x00", "xxxxxxxxxx?xxxxxxx????");
|
|
|
|
const char* (*CCVar_GetCommandLineValue)(void* thisptr, const char* pVariableName) = (const char* (*)(void*, const char*))p_CCVar_GetCommandLineValue.GetPtr(); /*40 55 48 83 EC 20 48 8D 6C 24 ? 48 89 5D 10 49 C7 C0 ? ? ? ?*/
|
2021-12-25 22:36:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// ENGINE |
|
|
|
|
extern ConVar* cm_debug_cmdquery;
|
|
|
|
extern ConVar* cm_return_false_cmdquery_all;
|
2021-12-27 14:17:34 +01:00
|
|
|
extern ConVar* cm_return_false_cmdquery_cheats;
|
2022-01-05 22:56:49 +01:00
|
|
|
extern ConVar* r_debug_overlay_nodecay;
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// SERVER |
|
|
|
|
extern ConVar* sv_showconnecting;
|
2021-12-28 02:23:13 +01:00
|
|
|
extern ConVar* sv_pylonvisibility;
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// CLIENT |
|
|
|
|
extern ConVar* cl_drawconsoleoverlay;
|
|
|
|
extern ConVar* cl_consoleoverlay_lines;
|
|
|
|
extern ConVar* cl_consoleoverlay_offset_x;
|
|
|
|
extern ConVar* cl_consoleoverlay_offset_y;
|
2022-01-08 02:05:33 +01:00
|
|
|
|
|
|
|
extern ConVar* cl_showsimstats;
|
|
|
|
extern ConVar* cl_simstats_offset_x;
|
|
|
|
extern ConVar* cl_simstats_offset_y;
|
|
|
|
|
|
|
|
extern ConVar* cl_showgpustats;;
|
|
|
|
extern ConVar* cl_gpustats_offset_x;
|
|
|
|
extern ConVar* cl_gpustats_offset_y;
|
2021-12-25 22:36:38 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// FILESYSTEM |
|
|
|
|
extern ConVar* fs_warning_level_native;
|
|
|
|
extern ConVar* fs_packedstore_entryblock_stats;
|
|
|
|
//-------------------------------------------------------------------------
|
2022-01-05 22:56:49 +01:00
|
|
|
// MATERIALSYSTEM |
|
2021-12-25 22:36:38 +01:00
|
|
|
extern ConVar* mat_showdxoutput;
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// SQUIRREL |
|
|
|
|
extern ConVar* sq_showrsonloading;
|
|
|
|
extern ConVar* sq_showscriptloading;
|
|
|
|
extern ConVar* sq_showvmoutput;
|
|
|
|
extern ConVar* sq_showvmwarning;
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// NETCHANNEL |
|
|
|
|
extern ConVar* net_userandomkey;
|
|
|
|
extern ConVar* r5net_matchmaking_hostname;
|
|
|
|
extern ConVar* r5net_show_debug;
|
|
|
|
|
2022-01-09 16:14:17 +01:00
|
|
|
extern ConVar* test_color_test;
|
|
|
|
|
|
|
|
|
|
|
|
class CCVarIteratorInternal // Fully reversed table, just look at the virtual function table and rename the function.
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void SetFirst(void) = 0; //0
|
|
|
|
virtual void Next(void) = 0; //1
|
|
|
|
virtual bool IsValid(void) = 0; //2
|
|
|
|
virtual ConCommandBase* Get(void) = 0; //3
|
|
|
|
};
|
|
|
|
|
|
|
|
class CCVar
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ConCommandBase* FindCommandBase(const char* pszCommandName); // @0x1405983A0 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
|
|
|
ConVar* FindVar(const char* pszVarName); // @0x1405983B0 in R5pc_r5launch_N1094_CL456479_2019_10_30_05_20_PM
|
|
|
|
ConCommand* FindCommand(const char* pszCommandName);
|
|
|
|
CCVarIteratorInternal* FactoryInternalIterator();
|
|
|
|
std::unordered_map<std::string, ConCommandBase*> DumpToMap();
|
|
|
|
};
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
extern CCVar* g_pCvar;
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
class HCvar : public IDetour
|
|
|
|
{
|
|
|
|
virtual void debugp()
|
|
|
|
{
|
2022-01-10 01:20:44 +01:00
|
|
|
std::cout << "| FUN: CCVar::Disconnect : 0x" << std::hex << std::uppercase << p_CCVar_Disconnect.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
|
|
std::cout << "| FUN: CCVar::GetCommandLineValue : 0x" << std::hex << std::uppercase << p_CCVar_GetCommandLineValue.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
|
|
std::cout << "| VAR: g_pCvar : 0x" << std::hex << std::uppercase << g_pCvar << std::setw(0) << " |" << std::endl;
|
2021-12-25 22:36:38 +01:00
|
|
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
REGISTER(HCvar);
|