Skip to content

Commit

Permalink
SDK: Fix case where AddObject scan could fail
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 26, 2023
1 parent 46b0861 commit be01bfb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shared/sdk/UObjectBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit be01bfb

Please sign in to comment.