From 218a4e72bbc2f2be572124d06db3dd6df4b4a92f Mon Sep 17 00:00:00 2001 From: Changhua Date: Mon, 10 Apr 2023 23:39:57 +0800 Subject: [PATCH] Insert home path to extra data --- spy/load_calls.cpp | 2 +- spy/receive_msg.cpp | 4 ++++ spy/spy_types.h | 1 + spy/user_info.cpp | 4 +++- spy/user_info.h | 5 ++++- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/spy/load_calls.cpp b/spy/load_calls.cpp index 63f901c..67fbf65 100644 --- a/spy/load_calls.cpp +++ b/spy/load_calls.cpp @@ -6,7 +6,7 @@ #define SUPPORT_VERSION L"3.7.0.30" WxCalls_t wxCalls = { 0x2366538, // Login Status - { 0x236607C, 0x23660F4, 0x2366128 }, // User Info: wxid, nickname, mobile + { 0x236607C, 0x23660F4, 0x2366128, 0x2386F7C }, // User Info: wxid, nickname, mobile, home 0x521D30, // Send Message /* Receive Message: Hook, call, type, self, id, msgXml, roomId, wxId, content, extra */ diff --git a/spy/receive_msg.cpp b/spy/receive_msg.cpp index 669959c..be24287 100644 --- a/spy/receive_msg.cpp +++ b/spy/receive_msg.cpp @@ -7,6 +7,7 @@ #include "load_calls.h" #include "receive_msg.h" +#include "user_info.h" #include "util.h" // Defined in rpc_server.cpp @@ -90,6 +91,9 @@ void DispatchMsg(DWORD reg) } wxMsg.content = GetStringByAddress(*p + g_WxCalls.recvMsg.content); wxMsg.extra = GetStringByAddress(*p + g_WxCalls.recvMsg.extra); + if (!wxMsg.extra.empty()) { + wxMsg.extra = GetHomePath() + "\\" + wxMsg.extra; + } { unique_lock lock(gMutex); diff --git a/spy/spy_types.h b/spy/spy_types.h index 44aef68..8e7f9ec 100644 --- a/spy/spy_types.h +++ b/spy/spy_types.h @@ -6,6 +6,7 @@ typedef struct UserInfoCall { DWORD wxid; DWORD nickName; DWORD mobile; + DWORD home; } UserInfoCall_t; typedef struct RecvMsg { diff --git a/spy/user_info.cpp b/spy/user_info.cpp index e2e69e1..68b6301 100644 --- a/spy/user_info.cpp +++ b/spy/user_info.cpp @@ -6,7 +6,9 @@ extern WxCalls_t g_WxCalls; extern DWORD g_WeChatWinDllAddr; -std::string GetSelfWxid() +string GetHomePath() { return GET_STRING(g_WeChatWinDllAddr + g_WxCalls.ui.home); } + +string GetSelfWxid() { DWORD wxidType = 0; try { diff --git a/spy/user_info.h b/spy/user_info.h index ce4aa31..8a7131f 100644 --- a/spy/user_info.h +++ b/spy/user_info.h @@ -2,4 +2,7 @@ #include -std::string GetSelfWxid(); +using namespace std; + +string GetHomePath(); +string GetSelfWxid();