Add more fields in WxMsg

This commit is contained in:
Changhua
2023-07-16 14:25:46 +08:00
parent d7a75eb37e
commit f2acc668bf
6 changed files with 29 additions and 20 deletions
+5 -3
View File
@@ -38,14 +38,16 @@ typedef vector<DbRow_t> DbRows_t;
typedef struct { typedef struct {
bool is_self; bool is_self;
bool is_group; bool is_group;
int32_t type; uint32_t type;
string id; uint32_t ts;
string xml; uint64_t id;
string sender; string sender;
string roomid; string roomid;
string content; string content;
string sign;
string thumb; string thumb;
string extra; string extra;
string xml;
} WxMsg_t; } WxMsg_t;
typedef struct { typedef struct {
+11 -8
View File
@@ -42,6 +42,7 @@ message Request
XmlMsg xml = 9; XmlMsg xml = 9;
DecPath dec = 10; DecPath dec = 10;
Transfer tf = 11; Transfer tf = 11;
uint64 ui64 = 12; // 64 位整数,通用
} }
} }
@@ -68,14 +69,16 @@ message WxMsg
{ {
bool is_self = 1; // 是否自己发送的 bool is_self = 1; // 是否自己发送的
bool is_group = 2; // 是否群消息 bool is_group = 2; // 是否群消息
int32 type = 3; // 消息类型 uint64 id = 3; // 消息 id
string id = 4; // 消息 id uint32 type = 4; // 消息类型
string xml = 5; // 消息 xml uint32 ts = 5; // 消息类型
string sender = 6; // 消息发送者 string roomid = 6; // 群 id(如果是群消息的话)
string roomid = 7; // 群 id(如果是群消息的话) string content = 7; // 消息内容
string content = 8; // 消息内容 string sender = 8; // 消息发送者
string thumb = 9; // 缩略图 string sign = 9; // Sign
string extra = 10; // 附加内容 string thumb = 10; // 缩略图
string extra = 11; // 附加内容
string xml = 12; // 消息 xml
} }
message TextMsg message TextMsg
+2 -2
View File
@@ -9,8 +9,8 @@ WxCalls_t wxCalls = {
{ 0x2FFD484, 0x2FFD590, 0x2FFD500, 0x30238CC }, // User Info: wxid, nickname, mobile, home { 0x2FFD484, 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, msgId, type, isSelf, ts, roomId, content, wxid, sign, thumb, extra, msgXml */
{ 0xD19A0B, 0x756960, 0x38, 0x3C, 0x194, 0x1FC, 0x48, 0x180, 0x70, 0x1A8, 0x1BC }, { 0xD19A0B, 0x756960, 0x30, 0x38, 0x3C, 0x44, 0x48, 0x70, 0x180, 0x194, 0x1A8, 0x1BC, 0x1FC },
{ 0x768140, 0XF59E40, 0XCE6640, 0x756960 }, // Send Image Message { 0x768140, 0XF59E40, 0XCE6640, 0x756960 }, // Send Image Message
{ 0x76AE20, 0xF59E40, 0xB6D1F0, 0x756960 }, // Send File Message { 0x76AE20, 0xF59E40, 0xB6D1F0, 0x756960 }, // Send File Message
{ 0xB8A70, 0x3ED5E0, 0x107F00, 0x3ED7B0, 0x2386FE4 }, // Send xml Message { 0xB8A70, 0x3ED5E0, 0x107F00, 0x3ED7B0, 0x2386FE4 }, // Send xml Message
+5 -4
View File
@@ -90,9 +90,12 @@ void DispatchMsg(DWORD reg)
{ {
WxMsg_t wxMsg; WxMsg_t wxMsg;
wxMsg.id = GET_QWORD(reg + g_WxCalls.recvMsg.msgId);
wxMsg.type = GET_DWORD(reg + g_WxCalls.recvMsg.type); wxMsg.type = GET_DWORD(reg + g_WxCalls.recvMsg.type);
wxMsg.is_self = GET_DWORD(reg + g_WxCalls.recvMsg.isSelf); wxMsg.is_self = GET_DWORD(reg + g_WxCalls.recvMsg.isSelf);
wxMsg.id = GetStringByStrAddr(reg + g_WxCalls.recvMsg.msgId); wxMsg.ts = GET_DWORD(reg + g_WxCalls.recvMsg.ts);
wxMsg.content = GetStringByWstrAddr(reg + g_WxCalls.recvMsg.content);
wxMsg.sign = GetStringByStrAddr(reg + g_WxCalls.recvMsg.sign);
wxMsg.xml = GetStringByStrAddr(reg + g_WxCalls.recvMsg.msgXml); wxMsg.xml = GetStringByStrAddr(reg + g_WxCalls.recvMsg.msgXml);
string roomid = GetStringByWstrAddr(reg + g_WxCalls.recvMsg.roomId); string roomid = GetStringByWstrAddr(reg + g_WxCalls.recvMsg.roomId);
@@ -102,7 +105,7 @@ void DispatchMsg(DWORD reg)
if (wxMsg.is_self) { if (wxMsg.is_self) {
wxMsg.sender = GetSelfWxid(); wxMsg.sender = GetSelfWxid();
} else { } else {
wxMsg.sender = GetStringByStrAddr(reg + g_WxCalls.recvMsg.wxId); wxMsg.sender = GetStringByStrAddr(reg + g_WxCalls.recvMsg.wxid);
} }
} else { } else {
wxMsg.is_group = false; wxMsg.is_group = false;
@@ -113,8 +116,6 @@ void DispatchMsg(DWORD reg)
} }
} }
wxMsg.content = GetStringByWstrAddr(reg + g_WxCalls.recvMsg.content);
wxMsg.thumb = GetStringByStrAddr(reg + g_WxCalls.recvMsg.thumb); wxMsg.thumb = GetStringByStrAddr(reg + g_WxCalls.recvMsg.thumb);
if (!wxMsg.thumb.empty()) { if (!wxMsg.thumb.empty()) {
wxMsg.thumb = GetHomePath() + wxMsg.thumb; wxMsg.thumb = GetHomePath() + wxMsg.thumb;
+5 -3
View File
@@ -12,15 +12,17 @@ typedef struct UserInfoCall {
typedef struct RecvMsg { typedef struct RecvMsg {
DWORD hook; // Hook地址 DWORD hook; // Hook地址
DWORD call; // Call地址 DWORD call; // Call地址
DWORD msgId; // 消息ID地址
DWORD type; // 消息类型地址 DWORD type; // 消息类型地址
DWORD isSelf; // 是否自己发送标志地址 DWORD isSelf; // 是否自己发送标志地址
DWORD msgId; // 消息ID地址 DWORD ts; // TimeStamp
DWORD msgXml; // 消息xml内容地址
DWORD roomId; // 群聊时,为群ID;私聊时,为微信ID DWORD roomId; // 群聊时,为群ID;私聊时,为微信ID
DWORD wxId; // 私聊时,为空;群聊时,为发送者微信ID
DWORD content; // 消息内容地址 DWORD content; // 消息内容地址
DWORD wxid; // 私聊时,为空;群聊时,为发送者微信ID
DWORD sign; // Sign
DWORD thumb; // 缩略图 DWORD thumb; // 缩略图
DWORD extra; // 附加数据 DWORD extra; // 附加数据
DWORD msgXml; // 消息xml内容地址
} RecvMsg_t; } RecvMsg_t;
typedef struct SendText { typedef struct SendText {
+1
View File
@@ -9,6 +9,7 @@
#define WECHATINJECTDLL_DEBUG L"spy_debug.dll" #define WECHATINJECTDLL_DEBUG L"spy_debug.dll"
#define GET_DWORD(addr) ((DWORD) * (DWORD *)(addr)) #define GET_DWORD(addr) ((DWORD) * (DWORD *)(addr))
#define GET_QWORD(addr) ((uint64_t) * (uint64_t *)(addr))
#define GET_STRING(addr) ((CHAR *)(*(DWORD *)(addr))) #define GET_STRING(addr) ((CHAR *)(*(DWORD *)(addr)))
#define GET_WSTRING(addr) ((WCHAR *)(*(DWORD *)(addr))) #define GET_WSTRING(addr) ((WCHAR *)(*(DWORD *)(addr)))
#define GET_STRING_FROM_P(addr) ((CHAR *)(addr)) #define GET_STRING_FROM_P(addr) ((CHAR *)(addr))