Skip to content

Commit

Permalink
SDK: Fix AddObject 0xFFFFFFFF IMM scan being too short
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 21, 2023
1 parent a9f6ec9 commit 3e930f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shared/sdk/UObjectBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,17 +341,19 @@ void UObjectBase::update_offsets_post_uobjectarray() {
});

if (num_instructions_until_ret < 15) {
SPDLOG_INFO("Skipping reference at 0x{:X} because it terminates too early", ref);
continue;
}

if (utility::find_string_reference_in_path(ref + 4, "UObject(FVTableHelper& Helper)", false) ||
utility::find_string_reference_in_path(ref + 4, L"UObject(FVTableHelper& Helper)", false))
{
SPDLOG_INFO("Skipping reference at 0x{:X} because it references UObject(FVTableHelper& Helper)", ref);
continue;
}

// Make sure there's a mov [reg+something], 0xFFFFFFFF somewhere really close by in the path
utility::exhaustive_decode((uint8_t*)ref + 4, 10, [&](utility::ExhaustionContext& ctx) -> utility::ExhaustionResult {
utility::exhaustive_decode((uint8_t*)ref + 4, 15, [&](utility::ExhaustionContext& ctx) -> utility::ExhaustionResult {
if (std::string_view{ctx.instrux.Mnemonic}.starts_with("CALL")) {
return utility::ExhaustionResult::STEP_OVER;
}
Expand Down

0 comments on commit 3e930f5

Please sign in to comment.