Skip to content

Commit

Permalink
SDK: Harden AddObject scan against debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Oct 22, 2023
1 parent 05bae4d commit 1c1294b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions shared/sdk/UObjectBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,26 @@ void UObjectBase::update_offsets_post_uobjectarray() {
return utility::ExhaustionResult::STEP_OVER;
}

if (utility::find_string_reference_in_path(*fn, "Assertion failed: %s", false) || utility::find_string_reference_in_path(*fn, L"Assertion failed: %s", false)) {
SPDLOG_INFO("[UObjectBase] Skipping callsite because it references Assertion Failed");
return utility::ExhaustionResult::STEP_OVER;
}

if (utility::find_string_reference_in_path(*fn, "CRASHED", false) || utility::find_string_reference_in_path(*fn, L"CRASHED", false)) {
SPDLOG_INFO("[UObjectBase] Skipping callsite because it references CRASHED");
return utility::ExhaustionResult::STEP_OVER;
}

if (utility::find_pointer_in_path(*fn, &DebugBreak, false)) {
SPDLOG_INFO("[UObjectBase] Skipping callsite because it calls DebugBreak");
return utility::ExhaustionResult::STEP_OVER;
}

if (utility::find_pointer_in_path(*fn, &MessageBoxW, false)) {
SPDLOG_INFO("[UObjectBase] Skipping callsite because it calls MessageBoxW");
return utility::ExhaustionResult::STEP_OVER;
}

// This is usually the right one, but based on compiler optimizations
// it may not be.
if (auto resolved = utility::find_pointer_in_path(*fn, &EnterCriticalSection, true); resolved.has_value()) {
Expand Down

0 comments on commit 1c1294b

Please sign in to comment.