From 657eb741612a62704ad56fe14f5f8794c6392f05 Mon Sep 17 00:00:00 2001 From: praydog Date: Tue, 30 May 2023 21:42:16 -0700 Subject: [PATCH] maybe this will fix it this time --- shared/sdk/ConsoleManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shared/sdk/ConsoleManager.cpp b/shared/sdk/ConsoleManager.cpp index d9c4f427..6b95ec38 100644 --- a/shared/sdk/ConsoleManager.cpp +++ b/shared/sdk/ConsoleManager.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "EngineModule.hpp" @@ -10,7 +11,7 @@ FConsoleManager* FConsoleManager::get() { static auto result = []() -> FConsoleManager** { SPDLOG_INFO("Finding IConsoleManager..."); - auto core_module = sdk::get_ue_module(L"Core"); + const auto core_module = sdk::get_ue_module(L"Core"); const auto r_dumping_movie_string = utility::scan_string(core_module, L"r.DumpingMovie"); if (!r_dumping_movie_string) { @@ -37,7 +38,8 @@ FConsoleManager* FConsoleManager::get() { // Check how many references there are to this function, if it's greater than say... 20, this is // IConsoleManager::SetupSingleton // If not, we can just disassemble the function looking for references to global variables - const auto function_references = utility::scan_displacement_references(core_module, *containing_function, std::optional{20}); + const auto module_size = utility::get_module_size(core_module); + const auto function_references = utility::scan_displacement_references((uintptr_t)core_module, *module_size - 0x1000, *containing_function, 20); if (function_references.empty()) { SPDLOG_ERROR("Failed to find any references to containing function");