refactor(message_handler): split offset namespace

This commit is contained in:
Changhua 2025-02-17 01:29:07 +08:00
parent 3658796a00
commit 36f30a9d0a
2 changed files with 8 additions and 5 deletions

View File

@ -38,7 +38,7 @@ extern QWORD g_WeChatWinDllAddr;
namespace message
{
namespace OsMsg = Offsets::Message;
namespace OsLog = Offsets::Message::Log;
QWORD Handler::DispatchMsg(QWORD arg1, QWORD arg2)
{
@ -193,8 +193,8 @@ int Handler::EnableLog()
{
if (isLogging) return 1;
funcWxLog = reinterpret_cast<funcWxLog_t>(g_WeChatWinDllAddr + OsMsg::LOG);
pLogLevel = reinterpret_cast<uint32_t *>(g_WeChatWinDllAddr + OsMsg::LOG_LEVEL);
pLogLevel = reinterpret_cast<uint32_t *>(g_WeChatWinDllAddr + OsLog::LEVEL);
funcWxLog = reinterpret_cast<funcWxLog_t>(g_WeChatWinDllAddr + OsLog::FUNCTION);
if (InitializeHook() != MH_OK) return -1;
if (MH_CreateHook(funcWxLog, &PrintWxLog, reinterpret_cast<LPVOID *>(&realWxLog)) != MH_OK) return -2;

View File

@ -18,8 +18,11 @@ namespace Account
namespace Message
{
constexpr uint64_t LOG = 0x261B890; // 日志函数
constexpr uint64_t LOG_LEVEL = 0x56E4244; // 日志级别
namespace Log
{
constexpr uint64_t FUNCTION = 0x261B890; // 日志函数
constexpr uint64_t LEVEL = 0x56E4244; // 日志级别
}
}
}