re-named console variables.

This commit is contained in:
IcePixelx 2021-07-18 17:38:59 +02:00
parent 126a6ea38e
commit b98f1c94a3
3 changed files with 12 additions and 12 deletions

View File

@ -10,13 +10,13 @@ namespace
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* ==== CONSOLE ========================================================================================================================================================= */
DWORD64 p_CommandExecute = /*0x140202090*/ reinterpret_cast<DWORD64>(PatternScan("r5apex.exe", "48 89 5C 24 ? 57 48 83 EC 20 48 8D 0D ? ? ? ? 41 8B D8"));
void (*CommandExecute)(void* self, const char* cmd) = (void (*)(void*, const char*))p_CommandExecute;
void (*org_CommandExecute)(void* self, const char* cmd) = (void (*)(void*, const char*))p_CommandExecute;
DWORD64 p_ConVar_IsFlagSet = /*0x14046FE90*/ reinterpret_cast<DWORD64>(PatternScan("r5apex.exe", "48 8B 41 48 85 50 38"));
bool (*ConVar_IsFlagSet)(int** cvar, int flag) = (bool (*)(int**, int))p_ConVar_IsFlagSet;
bool (*org_ConVar_IsFlagSet)(int** cvar, int flag) = (bool (*)(int**, int))p_ConVar_IsFlagSet;
DWORD64 p_ConCommand_IsFlagSet = /*0x14046F490*/ reinterpret_cast<DWORD64>(PatternScan("r5apex.exe", "85 51 38 0F 95 C0 C3"));
bool (*ConCommand_IsFlagSet)(int* cmd, int flag) = (bool (*)(int*, int))p_ConCommand_IsFlagSet;
bool (*org_ConCommand_IsFlagSet)(int* cmd, int flag) = (bool (*)(int*, int))p_ConCommand_IsFlagSet;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* ==== SQUIRREL ======================================================================================================================================================== */

View File

@ -136,12 +136,12 @@ DWORD __stdcall ProcessConsoleWorker(LPVOID)
if (sCommand == "console test") { g_bDebugConsole = !g_bDebugConsole; continue; }
///////////////////////////////////////////////////////////////////////
// Exec toggles
if (sCommand == "1") { ToggleDevCommands(); CommandExecute(NULL, "exec autoexec_dev"); }
if (sCommand == "1") { ToggleDevCommands(); org_CommandExecute(NULL, "exec autoexec_dev"); }
if (sCommand == "2") { g_bDebugLoading = !g_bDebugLoading; continue; }
///////////////////////////////////////////////////////////////////////
// Execute the command in the r5 SQVM
CommandExecute(NULL, sCommand.c_str());
org_CommandExecute(NULL, sCommand.c_str());
sCommand.clear();
///////////////////////////////////////////////////////////////////////
@ -165,8 +165,8 @@ void RemoveCMHooks()
///////////////////////////////////////////////////////////////////////////
// Unhook Console functions
DetourDetach((LPVOID*)&ConVar_IsFlagSet, &HConVar_IsFlagSet);
DetourDetach((LPVOID*)&ConCommand_IsFlagSet, &HConCommand_IsFlagSet);
DetourDetach((LPVOID*)&org_ConVar_IsFlagSet, &HConVar_IsFlagSet);
DetourDetach((LPVOID*)&org_ConCommand_IsFlagSet, &HConCommand_IsFlagSet);
///////////////////////////////////////////////////////////////////////////
// Commit the transaction
@ -186,8 +186,8 @@ void ToggleDevCommands()
if (!g_dev)
{
DetourAttach((LPVOID*)&ConVar_IsFlagSet, &HConVar_IsFlagSet);
DetourAttach((LPVOID*)&ConCommand_IsFlagSet, &HConCommand_IsFlagSet);
DetourAttach((LPVOID*)&org_ConVar_IsFlagSet, &HConVar_IsFlagSet);
DetourAttach((LPVOID*)&org_ConCommand_IsFlagSet, &HConCommand_IsFlagSet);
printf("\n");
printf("+--------------------------------------------------------+\n");
printf("|>>>>>>>>>>>>>| DEVONLY COMMANDS ACTIVATED |<<<<<<<<<<<<<|\n");
@ -197,8 +197,8 @@ void ToggleDevCommands()
}
else
{
DetourDetach((LPVOID*)&ConVar_IsFlagSet, &HConVar_IsFlagSet);
DetourDetach((LPVOID*)&ConCommand_IsFlagSet, &HConCommand_IsFlagSet);
DetourDetach((LPVOID*)&org_ConVar_IsFlagSet, &HConVar_IsFlagSet);
DetourDetach((LPVOID*)&org_ConCommand_IsFlagSet, &HConCommand_IsFlagSet);
printf("\n");
printf("+--------------------------------------------------------+\n");
printf("|>>>>>>>>>>>>| DEVONLY COMMANDS DEACTIVATED |<<<<<<<<<<<<|\n");

View File

@ -279,7 +279,7 @@ void CGameConsole::ProcessCommand(const char* command_line)
void CGameConsole::ExecCommand(const char* command_line)
{
CommandExecute(NULL, command_line);
org_CommandExecute(NULL, command_line);
}
///////////////////////////////////////////////////////////////////////////