Fix Functions_FUNC_GET_USER_INFO

This commit is contained in:
Changhua 2023-06-07 15:50:12 +08:00
parent 14a7def6f4
commit e70fa39ad8
2 changed files with 13 additions and 4 deletions

View File

@ -6,7 +6,7 @@
#define SUPPORT_VERSION L"3.9.2.23" #define SUPPORT_VERSION L"3.9.2.23"
WxCalls_t wxCalls = { WxCalls_t wxCalls = {
0x2FFD638, // Login Status 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 { 0x768140, 0xCE6C80, 0x756960 }, // Send Message
/* Receive Message: /* Receive Message:
Hook, call, type, self, id, msgXml, roomId, wxId, content, thumb, extra */ Hook, call, type, self, id, msgXml, roomId, wxId, content, thumb, extra */

View File

@ -6,14 +6,23 @@
extern WxCalls_t g_WxCalls; extern WxCalls_t g_WxCalls;
extern DWORD g_WeChatWinDllAddr; 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() string GetSelfWxid()
{ {
DWORD wxidType = 0; DWORD wxidType = 0;
try { try {
wxidType = GET_DWORD(g_WeChatWinDllAddr + g_WxCalls.ui.wxid + 0x14); wxidType = GET_DWORD(g_WeChatWinDllAddr + g_WxCalls.ui.wxid + 0x14);
LOG_DEBUG("WeChatWinDll: {:#x}, wxid type: {:#x}", g_WeChatWinDllAddr, wxidType);
if (wxidType == 0xF) { if (wxidType == 0xF) {
return GET_STRING_FROM_P(g_WeChatWinDllAddr + g_WxCalls.ui.wxid); return GET_STRING_FROM_P(g_WeChatWinDllAddr + g_WxCalls.ui.wxid);
} else { } else {
@ -33,7 +42,7 @@ UserInfo_t GetUserInfo()
ui.wxid = GetSelfWxid(); ui.wxid = GetSelfWxid();
ui.name = GET_STRING_FROM_P(g_WeChatWinDllAddr + g_WxCalls.ui.nickName); 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.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; return ui;
} }