add thumb

This commit is contained in:
hcaihao 2023-04-11 16:12:02 +08:00
parent 5503831ca0
commit 7bfe2afef2
7 changed files with 16 additions and 4 deletions

View File

@ -61,12 +61,14 @@ class Wcf():
self.sender = msg.sender
self.roomid = msg.roomid
self.content = msg.content
self.thumb = msg.thumb
self.extra = msg.extra
def __str__(self) -> str:
s = f"{'自己发的:' if self._is_self else ''}"
s += f"{self.sender}[{self.roomid}]:{self.id}:{self.type}:{self.xml.replace(chr(10), '').replace(chr(9),'')}\n"
s += self.content
s += f"\n{self.thumb}" if self.thumb else ""
s += f"\n{self.extra}" if self.extra else ""
return s

View File

@ -43,5 +43,6 @@ typedef struct {
string sender;
string roomid;
string content;
string thumb;
string extra;
} WxMsg_t;

View File

@ -67,7 +67,8 @@ message WxMsg
string sender = 6; //
string roomid = 7; // id
string content = 8; //
string extra = 9; //
string thumb = 9; //
string extra = 10; //
}
message TextMsg

View File

@ -9,8 +9,8 @@ WxCalls_t wxCalls = {
{ 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 */
{ 0x550F4C, 0xA96350, 0x38, 0x3C, 0x184, 0x1EC, 0x48, 0x170, 0x70, 0x1AC },
Hook, call, type, self, id, msgXml, roomId, wxId, content, thumb, extra */
{ 0x550F4C, 0xA96350, 0x38, 0x3C, 0x184, 0x1EC, 0x48, 0x170, 0x70, 0x198, 0x1AC},
{ 0xBD780, 0x771980, 0x521640 }, // Send Image Message
{ 0xC3B70, 0x771980, 0x3ED8C0 }, // Send File Message
{ 0xB8A70, 0x3ED5E0, 0x107F00, 0x3ED7B0, 0x2386FE4 }, // Send xml Message

View File

@ -90,9 +90,15 @@ void DispatchMsg(DWORD reg)
wxMsg.sender = GetStringByAddress(*p + g_WxCalls.recvMsg.roomId);
}
wxMsg.content = GetStringByAddress(*p + g_WxCalls.recvMsg.content);
wxMsg.thumb = GetStringByAddress(*p + g_WxCalls.recvMsg.thumb);
if (!wxMsg.thumb.empty()) {
wxMsg.thumb = GetHomePath() + "\\WeChat Files\\" + wxMsg.thumb;
}
wxMsg.extra = GetStringByAddress(*p + g_WxCalls.recvMsg.extra);
if (!wxMsg.extra.empty()) {
wxMsg.extra = GetHomePath() + "\\" + wxMsg.extra;
wxMsg.extra = GetHomePath() + "\\WeChat Files\\" + wxMsg.extra;
}
{

View File

@ -330,6 +330,7 @@ static void PushMessage()
rsp.msg.wxmsg.sender = (char *)wxmsg.sender.c_str();
rsp.msg.wxmsg.roomid = (char *)wxmsg.roomid.c_str();
rsp.msg.wxmsg.content = (char *)wxmsg.content.c_str();
rsp.msg.wxmsg.thumb = (char*)wxmsg.thumb.c_str();
rsp.msg.wxmsg.extra = (char *)wxmsg.extra.c_str();
gMsgQueue.pop();
LOG_DEBUG("Recv msg: {}", wxmsg.content);

View File

@ -19,6 +19,7 @@ typedef struct RecvMsg {
DWORD roomId; // 群聊时为群ID私聊时为微信ID
DWORD wxId; // 私聊时为空群聊时为发送者微信ID
DWORD content; // 消息内容地址
DWORD thumb; // 缩略图
DWORD extra; // 附加数据
} RecvMsg_t;