From 5cc7976434249478584c97912842543bd37ef8e2 Mon Sep 17 00:00:00 2001 From: praydog Date: Thu, 30 Nov 2023 12:45:54 -0800 Subject: [PATCH] SDK: Fix GMalloc scan in UnrealEditor --- shared/sdk/FMalloc.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/shared/sdk/FMalloc.cpp b/shared/sdk/FMalloc.cpp index 7785168f..be69d504 100644 --- a/shared/sdk/FMalloc.cpp +++ b/shared/sdk/FMalloc.cpp @@ -38,6 +38,17 @@ FMalloc* FMalloc::get() { } } + // ok at this point we're just using whatever function we can find... + // because GMalloc is basically referenced everywhere we can use most functions + // even if that function is just the CVar registration function for MaxObjectsNotConsideredByGC + if (!object_base_init_fn) { + object_base_init_fn = utility::find_function_from_string_ref(core_uobject, L"gc.MaxObjectsNotConsideredByGC"); + + if (!object_base_init_fn) { + object_base_init_fn = utility::find_function_from_string_ref(core_uobject, L"MaxObjectsNotConsideredByGC"); + } + } + if (!object_base_init_fn) { SPDLOG_ERROR("[FMalloc::get] Failed to find object base init function"); return nullptr;