diff --git a/spy/load_calls.cpp b/spy/load_calls.cpp index c0ebe7d..8218767 100644 --- a/spy/load_calls.cpp +++ b/spy/load_calls.cpp @@ -6,7 +6,7 @@ #define SUPPORT_VERSION L"3.9.2.23" WxCalls_t wxCalls = { 0x2FFD638, // Login Status - { 0x2FFD4E8, 0x23660F4, 0x2366128, 0x2386F7C }, // User Info: wxid, nickname, mobile, home + { 0x2FFD4E8, 0x2FFD590, 0x2FFD500, 0x30238CC }, // User Info: wxid, nickname, mobile, home { 0x768140, 0xCE6C80, 0x756960 }, // Send Message /* Receive Message: Hook, call, type, self, id, msgXml, roomId, wxId, content, thumb, extra */ diff --git a/spy/user_info.cpp b/spy/user_info.cpp index 166c743..a7e6760 100644 --- a/spy/user_info.cpp +++ b/spy/user_info.cpp @@ -6,14 +6,23 @@ extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; -string GetHomePath() { return GET_STRING(g_WeChatWinDllAddr + g_WxCalls.ui.home); } +static char home[MAX_PATH] = { 0 }; + +string GetHomePath() +{ + if (home[0] == 0) { + string path = Wstring2String(GET_WSTRING(g_WeChatWinDllAddr + g_WxCalls.ui.home)); + strncpy_s(home, path.c_str(), path.size()); + } + + return string(home); +} string GetSelfWxid() { DWORD wxidType = 0; try { wxidType = GET_DWORD(g_WeChatWinDllAddr + g_WxCalls.ui.wxid + 0x14); - LOG_DEBUG("WeChatWinDll: {:#x}, wxid type: {:#x}", g_WeChatWinDllAddr, wxidType); if (wxidType == 0xF) { return GET_STRING_FROM_P(g_WeChatWinDllAddr + g_WxCalls.ui.wxid); } else { @@ -33,7 +42,7 @@ UserInfo_t GetUserInfo() ui.wxid = GetSelfWxid(); ui.name = GET_STRING_FROM_P(g_WeChatWinDllAddr + g_WxCalls.ui.nickName); ui.mobile = GET_STRING_FROM_P(g_WeChatWinDllAddr + g_WxCalls.ui.mobile); - ui.home = Wstring2String(GET_WSTRING(g_WeChatWinDllAddr + g_WxCalls.ui.home)); + ui.home = GetHomePath(); return ui; }