diff --git a/r5dev/core/init.cpp b/r5dev/core/init.cpp index 17b0a17e..d087c270 100644 --- a/r5dev/core/init.cpp +++ b/r5dev/core/init.cpp @@ -127,14 +127,9 @@ void Systems_Init() QuerySystemInfo(); CFastTimer initTimer; - initTimer.Start(); - for (IDetour* pDetour : vDetour) - { - pDetour->GetCon(); - pDetour->GetFun(); - pDetour->GetVar(); - } + initTimer.Start(); + DetourInit(); initTimer.End(); spdlog::info("+-------------------------------------------------------------+\n"); @@ -427,10 +422,19 @@ void QuerySystemInfo() } } -void PrintHAddress() // Test the sigscan results +void DetourInit() // Run the sigscan +{ + for (const IDetour* pDetour : vDetour) + { + pDetour->GetCon(); // Constants. + pDetour->GetFun(); // Functions. + pDetour->GetVar(); // Variables. + } +} +void DetourAddress() // Test the sigscan results { spdlog::debug("+----------------------------------------------------------------+\n"); - for (IDetour* pDetour : vDetour) + for (const IDetour* pDetour : vDetour) { pDetour->GetAdr(); } diff --git a/r5dev/core/init.h b/r5dev/core/init.h index 573404e8..54e41969 100644 --- a/r5dev/core/init.h +++ b/r5dev/core/init.h @@ -14,4 +14,6 @@ void Systems_Shutdown(); void WS_Init(); void WS_Shutdown(); void QuerySystemInfo(); -void PrintHAddress(); + +void DetourInit(); +void DetourAddress(); diff --git a/r5dev/windows/console.cpp b/r5dev/windows/console.cpp index 8e2e3bcb..21f02b47 100644 --- a/r5dev/windows/console.cpp +++ b/r5dev/windows/console.cpp @@ -131,9 +131,9 @@ DWORD __stdcall ProcessConsoleWorker(LPVOID) std::getline(std::cin, sCommand); //-- Debug toggles - if (sCommand == "pattern test") { PrintHAddress(); continue; } + if (sCommand == "sig_getadr") { DetourAddress(); continue; } - // Execute the command in the r5 SQVM + // Execute the command. Cbuf_AddText(Cbuf_GetCurrentPlayer(), sCommand.c_str(), cmd_source_t::kCommandSrcCode); Cbuf_Execute();