From 3f7dcd72bb362eaf1f3f31d77a6d63c986b1de0f Mon Sep 17 00:00:00 2001 From: "[ ]" <[ ]> Date: Wed, 19 Nov 2025 20:36:10 +0900 Subject: [PATCH] code: Minor changes > related to previous commit --- hooks/develhook.cpp | 2 +- hooks/wmischook.cpp | 9 +++------ hooks/wmischook.h | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/hooks/develhook.cpp b/hooks/develhook.cpp index 776de86..16ffd99 100644 --- a/hooks/develhook.cpp +++ b/hooks/develhook.cpp @@ -10,6 +10,7 @@ #include #include + namespace hooks::devel::thumbnail { typedef int (*BmswSymlink_t)(const char *srcwpath, const char *dstwpath, int canonic); @@ -26,7 +27,6 @@ void run() log_warning("hooks::devel::thumbnail", "Forcing thumbnail patch.."); hooks::wmisc::apply_performance_hacks(avs::game::DLL_INSTANCE, "LDJ", "20250825"); } - } namespace hooks::devel::avs_fs diff --git a/hooks/wmischook.cpp b/hooks/wmischook.cpp index c48bf19..14a3173 100644 --- a/hooks/wmischook.cpp +++ b/hooks/wmischook.cpp @@ -19,21 +19,20 @@ bool on_thum_exists_(void *titleUTF_getter, int32_t id, char flag) } else { - log_misc("hooks::wmisc::thumbnail", "Caching state for [{}]", id); + // log_misc("hooks::wmisc::thumbnail", "Caching state for [{}]", id); it = thumids.insert({id, ThumExists(titleUTF_getter, id, flag)}).first; } return it->second; } - void run(HINSTANCE hmodule) { // Reverse lookup function head (PUSH RDI) for ThumExists() specific signature, quietly fail if invalid intptr_t beg, match, TX_ThumExists; TX_ThumExists = beg = match = find_pattern_from(hmodule, "83f801750c4084ff750732c0", "XXXXXXXXXXXX", 0, 0, 0); - while (beg > sizeof(intptr_t) && match >= TX_ThumExists) + while (beg > sizeof(void *) && match >= TX_ThumExists) { - beg--; + beg -= sizeof(void *); match = find_pattern_from(hmodule, "4057", "XX", 0, 0, beg - reinterpret_cast(hmodule)); } TX_ThumExists = match; @@ -67,6 +66,4 @@ void apply_performance_hacks(HINSTANCE hmodule, const char *model, const char *e } } - - } diff --git a/hooks/wmischook.h b/hooks/wmischook.h index 8bbf987..a63ddff 100644 --- a/hooks/wmischook.h +++ b/hooks/wmischook.h @@ -1,6 +1,7 @@ #pragma once #include + namespace hooks::wmisc { void apply_performance_hacks(HINSTANCE hmodule, const char *model, const char *ext);