diff --git a/r5dev/tier1/cmd.cpp b/r5dev/tier1/cmd.cpp index f301387c..c8e004b0 100644 --- a/r5dev/tier1/cmd.cpp +++ b/r5dev/tier1/cmd.cpp @@ -386,6 +386,9 @@ void ConCommand::Init(void) // NETCHANNEL | ConCommand::Create("net_setkey", "Sets user specified base64 net key.", nullptr, FCVAR_RELEASE, NET_SetKey_f, nullptr); ConCommand::Create("net_generatekey", "Generates and sets a random base64 net key.", nullptr, FCVAR_RELEASE, NET_GenerateKey_f, nullptr); + //------------------------------------------------------------------------- + // TIER0 | + ConCommand::Create("sig_getadr", "Logs the sigscan results to the console.", nullptr, FCVAR_DEVELOPMENTONLY | FCVAR_HIDDEN, SIG_GetAdr_f, nullptr); } //----------------------------------------------------------------------------- diff --git a/r5dev/vstdlib/callback.cpp b/r5dev/vstdlib/callback.cpp index 16f329b6..890202b7 100644 --- a/r5dev/vstdlib/callback.cpp +++ b/r5dev/vstdlib/callback.cpp @@ -5,6 +5,7 @@ //=============================================================================// #include "core/stdafx.h" +#include "core/init.h" #include "windows/id3dx.h" #include "tier0/fasttimer.h" #include "tier1/cvar.h" @@ -737,6 +738,20 @@ void NET_UseRandomKeyChanged_f(IConVar* pConVar, const char* pOldString, float f NET_SetKey(DEFAULT_NET_ENCRYPTION_KEY); } } + +/* +===================== +SIG_GetAdr_f + + Logs the sigscan + results to the console. +===================== +*/ +void SIG_GetAdr_f(const CCommand& args) +{ + DetourAddress(); +} + /* ===================== CON_Help_f diff --git a/r5dev/vstdlib/callback.h b/r5dev/vstdlib/callback.h index 4dce27b7..1acb5dc4 100644 --- a/r5dev/vstdlib/callback.h +++ b/r5dev/vstdlib/callback.h @@ -40,6 +40,7 @@ void VPK_Unmount_f(const CCommand& args); void NET_SetKey_f(const CCommand& args); void NET_GenerateKey_f(const CCommand& args); void NET_UseRandomKeyChanged_f(IConVar* pConVar, const char* pOldString, float flOldValue); +void SIG_GetAdr_f(const CCommand& args); void CON_Help_f(const CCommand& args); #ifndef DEDICATED void CON_LogHistory_f(const CCommand& args); diff --git a/r5dev/windows/console.cpp b/r5dev/windows/console.cpp index e21173aa..48185a9f 100644 --- a/r5dev/windows/console.cpp +++ b/r5dev/windows/console.cpp @@ -110,6 +110,7 @@ void Console_Init() MessageBoxA(NULL, "Failed to set console mode 'VirtualTerminalLevel'.\n" "Please omit the '-ansiclr' parameter and restart \nthe game if output logging appears distorted.", "SDK Warning", MB_ICONEXCLAMATION | MB_OK); } + SetConsoleBackgroundColor(0x00000000); AnsiColors_Init(); } @@ -122,7 +123,6 @@ void Console_Init() DWORD __stdcall ProcessConsoleWorker(LPVOID) { - // Loop forever while (true) { static std::string sCommand = ""; @@ -131,17 +131,12 @@ DWORD __stdcall ProcessConsoleWorker(LPVOID) //-- Get the user input on the debug console std::getline(std::cin, sCommand); - //-- Debug toggles - if (sCommand == "sig_getadr") { DetourAddress(); continue; } - // Execute the command. Cbuf_AddText(Cbuf_GetCurrentPlayer(), sCommand.c_str(), cmd_source_t::kCommandSrcCode); - //g_TaskScheduler->Dispatch(Cbuf_Execute, 0); - sCommand.clear(); + if (!sCommand.empty()) + sCommand.clear(); - /////////////////////////////////////////////////////////////////////// - // Sleep and loop Sleep(50); } return NULL;