From b95c99a9c085c807f4dcd211b570f8b390d61948 Mon Sep 17 00:00:00 2001 From: praydog Date: Thu, 12 Oct 2023 08:39:44 -0700 Subject: [PATCH] SDK: Minor fixes to improper reference scanning --- shared/sdk/CVar.cpp | 2 +- shared/sdk/UEngine.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/sdk/CVar.cpp b/shared/sdk/CVar.cpp index 392903c4..a564e829 100644 --- a/shared/sdk/CVar.cpp +++ b/shared/sdk/CVar.cpp @@ -587,7 +587,7 @@ std::optional vr::get_slate_draw_to_vr_render_target_usage_location() for (auto ref = utility::scan_displacement_reference(module, cvar_addr); ref; - ref = utility::scan_displacement_reference(*ref + 1, (module_end - (*ref + 1)), cvar_addr)) + ref = utility::scan_displacement_reference(*ref + 4, (module_end - (*ref + 4)), cvar_addr)) { SPDLOG_INFO("Checking if Slate.DrawToVRRenderTarget is used at {:x}", *ref); diff --git a/shared/sdk/UEngine.cpp b/shared/sdk/UEngine.cpp index 22d62285..d3172612 100644 --- a/shared/sdk/UEngine.cpp +++ b/shared/sdk/UEngine.cpp @@ -133,7 +133,7 @@ std::optional UEngine::get_emulatestereo_string_ref_address() { for (auto str = utility::scan_string(mod, L"emulatestereo"); str; str = utility::scan_string(*str + 1, (end - (*str + 1)) - 0x1000, L"emulatestereo")) { SPDLOG_INFO("On string at {:x}", (uintptr_t)*str); - for (auto ref = utility::scan_displacement_reference(mod, *str); ref; ref = utility::scan_displacement_reference(*ref + 1, (end - (*ref + 1)) - 0x1000, *str)) { + for (auto ref = utility::scan_displacement_reference(mod, *str); ref; ref = utility::scan_displacement_reference(*ref + 4, (end - (*ref + 4)) - 0x1000, *str)) { SPDLOG_INFO("On reference at {:x}", (uintptr_t)*ref); // InitializeHMDDevice has always been guaranteed to be a virtual function