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

View File

@ -38,14 +38,16 @@ typedef vector<DbRow_t> DbRows_t;
typedef struct {
bool is_self;
bool is_group;
int32_t type;
string id;
string xml;
uint32_t type;
uint32_t ts;
uint64_t id;
string sender;
string roomid;
string content;
string sign;
string thumb;
string extra;
string xml;
} WxMsg_t;
typedef struct {

View File

@ -42,6 +42,7 @@ message Request
XmlMsg xml = 9;
DecPath dec = 10;
Transfer tf = 11;
uint64 ui64 = 12; // 64
}
}
@ -68,14 +69,16 @@ message WxMsg
{
bool is_self = 1; //
bool is_group = 2; //
int32 type = 3; //
string id = 4; // id
string xml = 5; // xml
string sender = 6; //
string roomid = 7; // id
string content = 8; //
string thumb = 9; //
string extra = 10; //
uint64 id = 3; // id
uint32 type = 4; //
uint32 ts = 5; //
string roomid = 6; // id
string content = 7; //
string sender = 8; //
string sign = 9; // Sign
string thumb = 10; //
string extra = 11; //
string xml = 12; // xml
}
message TextMsg

View File

@ -9,8 +9,8 @@ WxCalls_t wxCalls = {
{ 0x2FFD484, 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 */
{ 0xD19A0B, 0x756960, 0x38, 0x3C, 0x194, 0x1FC, 0x48, 0x180, 0x70, 0x1A8, 0x1BC },
Hook, call, msgId, type, isSelf, ts, roomId, content, wxid, sign, thumb, extra, msgXml */
{ 0xD19A0B, 0x756960, 0x30, 0x38, 0x3C, 0x44, 0x48, 0x70, 0x180, 0x194, 0x1A8, 0x1BC, 0x1FC },
{ 0x768140, 0XF59E40, 0XCE6640, 0x756960 }, // Send Image Message
{ 0x76AE20, 0xF59E40, 0xB6D1F0, 0x756960 }, // Send File Message
{ 0xB8A70, 0x3ED5E0, 0x107F00, 0x3ED7B0, 0x2386FE4 }, // Send xml Message

View File

@ -90,9 +90,12 @@ void DispatchMsg(DWORD reg)
{
WxMsg_t wxMsg;
wxMsg.id = GET_QWORD(reg + g_WxCalls.recvMsg.msgId);
wxMsg.type = GET_DWORD(reg + g_WxCalls.recvMsg.type);
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);
string roomid = GetStringByWstrAddr(reg + g_WxCalls.recvMsg.roomId);
@ -102,7 +105,7 @@ void DispatchMsg(DWORD reg)
if (wxMsg.is_self) {
wxMsg.sender = GetSelfWxid();
} else {
wxMsg.sender = GetStringByStrAddr(reg + g_WxCalls.recvMsg.wxId);
wxMsg.sender = GetStringByStrAddr(reg + g_WxCalls.recvMsg.wxid);
}
} else {
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);
if (!wxMsg.thumb.empty()) {
wxMsg.thumb = GetHomePath() + wxMsg.thumb;

View File

@ -12,15 +12,17 @@ typedef struct UserInfoCall {
typedef struct RecvMsg {
DWORD hook; // Hook地址
DWORD call; // Call地址
DWORD msgId; // 消息ID地址
DWORD type; // 消息类型地址
DWORD isSelf; // 是否自己发送标志地址
DWORD msgId; // 消息ID地址
DWORD msgXml; // 消息xml内容地址
DWORD ts; // TimeStamp
DWORD roomId; // 群聊时为群ID私聊时为微信ID
DWORD wxId; // 私聊时为空群聊时为发送者微信ID
DWORD content; // 消息内容地址
DWORD wxid; // 私聊时为空群聊时为发送者微信ID
DWORD sign; // Sign
DWORD thumb; // 缩略图
DWORD extra; // 附加数据
DWORD msgXml; // 消息xml内容地址
} RecvMsg_t;
typedef struct SendText {

View File

@ -9,6 +9,7 @@
#define WECHATINJECTDLL_DEBUG L"spy_debug.dll"
#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_WSTRING(addr) ((WCHAR *)(*(DWORD *)(addr)))
#define GET_STRING_FROM_P(addr) ((CHAR *)(addr))