From be01bfb0b2958b2968acaaf2d71c785471e5a9d3 Mon Sep 17 00:00:00 2001 From: praydog Date: Wed, 25 Oct 2023 22:23:23 -0700 Subject: [PATCH] SDK: Fix case where AddObject scan could fail --- shared/sdk/UObjectBase.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared/sdk/UObjectBase.cpp b/shared/sdk/UObjectBase.cpp index 2a66af3c..06ffdc9b 100644 --- a/shared/sdk/UObjectBase.cpp +++ b/shared/sdk/UObjectBase.cpp @@ -393,6 +393,12 @@ void UObjectBase::update_offsets_post_uobjectarray() { return utility::ExhaustionResult::BREAK; } + if (!backup_functions.empty() && std::string_view{ctx.instrux.Mnemonic}.starts_with("JMP")) { + SPDLOG_INFO("[UObjectBase] Encountered jmp, using backup function {:x}", backup_functions[0]); + s_add_object = backup_functions[0]; + return utility::ExhaustionResult::BREAK; + } + // Examine each call. Check to see if anywhere in its path it calls EnterCriticalSection. This is the right one. if (std::string_view{ctx.instrux.Mnemonic}.starts_with("CALL")) { auto fn = utility::resolve_displacement(ctx.addr);