code: Minor changes

> related to previous commit
This commit is contained in:
[ ]
2025-11-19 20:36:10 +09:00
parent e15c689061
commit 3f7dcd72bb
3 changed files with 5 additions and 7 deletions
+1 -1
View File
@@ -10,6 +10,7 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
namespace hooks::devel::thumbnail namespace hooks::devel::thumbnail
{ {
typedef int (*BmswSymlink_t)(const char *srcwpath, const char *dstwpath, int canonic); 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.."); log_warning("hooks::devel::thumbnail", "Forcing thumbnail patch..");
hooks::wmisc::apply_performance_hacks(avs::game::DLL_INSTANCE, "LDJ", "20250825"); hooks::wmisc::apply_performance_hacks(avs::game::DLL_INSTANCE, "LDJ", "20250825");
} }
} }
namespace hooks::devel::avs_fs namespace hooks::devel::avs_fs
+3 -6
View File
@@ -19,21 +19,20 @@ bool on_thum_exists_(void *titleUTF_getter, int32_t id, char flag)
} }
else 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; it = thumids.insert({id, ThumExists(titleUTF_getter, id, flag)}).first;
} }
return it->second; return it->second;
} }
void run(HINSTANCE hmodule) void run(HINSTANCE hmodule)
{ {
// Reverse lookup function head (PUSH RDI) for ThumExists() specific signature, quietly fail if invalid // Reverse lookup function head (PUSH RDI) for ThumExists() specific signature, quietly fail if invalid
intptr_t beg, match, TX_ThumExists; intptr_t beg, match, TX_ThumExists;
TX_ThumExists = beg = match = find_pattern_from(hmodule, "83f801750c4084ff750732c0", "XXXXXXXXXXXX", 0, 0, 0); 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<intptr_t>(hmodule)); match = find_pattern_from(hmodule, "4057", "XX", 0, 0, beg - reinterpret_cast<intptr_t>(hmodule));
} }
TX_ThumExists = match; TX_ThumExists = match;
@@ -67,6 +66,4 @@ void apply_performance_hacks(HINSTANCE hmodule, const char *model, const char *e
} }
} }
} }
+1
View File
@@ -1,6 +1,7 @@
#pragma once #pragma once
#include <windows.h> #include <windows.h>
namespace hooks::wmisc namespace hooks::wmisc
{ {
void apply_performance_hacks(HINSTANCE hmodule, const char *model, const char *ext); void apply_performance_hacks(HINSTANCE hmodule, const char *model, const char *ext);