Skip to content

Commit

Permalink
maybe this will fix it this time
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed May 31, 2023
1 parent 2b58449 commit 657eb74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shared/sdk/ConsoleManager.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <spdlog/spdlog.h>
#include <utility/Scan.hpp>
#include <utility/Module.hpp>

#include "EngineModule.hpp"

Expand All @@ -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) {
Expand All @@ -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<size_t>{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");
Expand Down

0 comments on commit 657eb74

Please sign in to comment.