From edfbae0d53516e8a75acfcb59fd2aea3dda17ba0 Mon Sep 17 00:00:00 2001 From: Piepieonline Date: Sun, 26 Jan 2025 22:36:42 +1100 Subject: [PATCH] Added ZArray_PushBack hook, exposed FlushLoggers to mods --- ZHMModSDK/Include/Hooks.h | 2 ++ ZHMModSDK/Include/Logging.h | 1 + ZHMModSDK/Src/Hooks.cpp | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/ZHMModSDK/Include/Hooks.h b/ZHMModSDK/Include/Hooks.h index 0e3d1bff7..74c3289ad 100644 --- a/ZHMModSDK/Include/Hooks.h +++ b/ZHMModSDK/Include/Hooks.h @@ -184,4 +184,6 @@ class ZHMSDK_API Hooks { const std::function& onOk, const std::function& onError, ZAsyncContext* ctx, const SHttpRequestBehavior& behavior )>* ZUserChannelContractsProxyBase_GetForPlay2; + + static Hook* ZArray_PushBack; }; diff --git a/ZHMModSDK/Include/Logging.h b/ZHMModSDK/Include/Logging.h index 455bd79b2..9d9c185ec 100644 --- a/ZHMModSDK/Include/Logging.h +++ b/ZHMModSDK/Include/Logging.h @@ -14,6 +14,7 @@ struct LoggerList { }; ZHMSDK_API LoggerList GetLoggers(); +ZHMSDK_API void FlushLoggers(); namespace Logger { template diff --git a/ZHMModSDK/Src/Hooks.cpp b/ZHMModSDK/Src/Hooks.cpp index 2e9196af9..438b1575d 100644 --- a/ZHMModSDK/Src/Hooks.cpp +++ b/ZHMModSDK/Src/Hooks.cpp @@ -379,3 +379,10 @@ PATTERN_HOOK( const std::function& onOk, const std::function& onError, ZAsyncContext* ctx, const SHttpRequestBehavior& behavior) ); + +PATTERN_HOOK( + "\x40\x53\x57\x48\x83\xEC\x38\x48\x8B\xD9\x48\x89\x6C\x24\x58\x48\x89\x74\x24\x60\x48\x8B\xEA\x48\x8B\x71\x10\x48\x8B\xCE\x48\xC1\xE9\x3E\x80\xE1\x01\x74\x10\x48\x8B\xC6\x40\x0F\xB6\xFE\x48\xC1\xE8\x08\x0F\xB6\xD0\xEB\x24\x48\x8B\x7B\x08\x48\x8B\xD6\x48\x2B\x3B\x48\xB8\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x3F\x48\x23\xD0\x48\xC1\xFF\x03\x48\x2B\x13\x8B\xFF\x48\xC1\xFA\x03\x8B\xC2\x48\x3B\xF8", + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + ZArray_PushBack, + void* (void* th, void* newData) +); \ No newline at end of file