Impl pat group member

This commit is contained in:
Changhua 2023-12-06 09:21:55 +08:00
parent 436785fdb5
commit 631a4fc6e0
10 changed files with 155 additions and 59 deletions

View File

@ -19,6 +19,7 @@ enum Functions {
FUNC_SEND_XML = 0x23; FUNC_SEND_XML = 0x23;
FUNC_SEND_EMOTION = 0x24; FUNC_SEND_EMOTION = 0x24;
FUNC_SEND_RICH_TXT = 0x25; FUNC_SEND_RICH_TXT = 0x25;
FUNC_SEND_PAT_MSG = 0x26;
FUNC_ENABLE_RECV_TXT = 0x30; FUNC_ENABLE_RECV_TXT = 0x30;
FUNC_DISABLE_RECV_TXT = 0x40; FUNC_DISABLE_RECV_TXT = 0x40;
FUNC_EXEC_DB_QUERY = 0x50; FUNC_EXEC_DB_QUERY = 0x50;
@ -53,6 +54,7 @@ message Request
AttachMsg att = 14; AttachMsg att = 14;
AudioMsg am = 15; AudioMsg am = 15;
RichText rt = 16; RichText rt = 16;
PatMsg pm = 17;
} }
} }
@ -208,3 +210,9 @@ message RichText
string thumburl = 6; // string thumburl = 6; //
string receiver = 7; // string receiver = 7; //
} }
message PatMsg
{
string roomid = 1; // id
string wxid = 2; // wxid
}

View File

@ -33,7 +33,9 @@ WxCalls_t wxCalls = {
/* call1, call2, call3, call4, call5*/ /* call1, call2, call3, call4, call5*/
{0x76F010, 0x792700, 0xBC0370, 0xBB5F70, 0x756E30}, {0x76F010, 0x792700, 0xBC0370, 0xBB5F70, 0x756E30},
/* call1, call2, call3, call4, call5*/ /* call1, call2, call3, call4, call5*/
{0x76E630, 0x76AE20, 0xF59E40, 0xB73000, 0x76E350} {0x76E630, 0x76AE20, 0xF59E40, 0xB73000, 0x76E350},
/* call1, call2, call3 */
{0x931730, 0x1D58751, 0x1421940}
}; };
int LoadCalls(const wchar_t *version, WxCalls_t *calls) int LoadCalls(const wchar_t *version, WxCalls_t *calls)

View File

@ -361,6 +361,28 @@ bool func_send_rich_txt(RichText rt, uint8_t *out, size_t *len)
return true; return true;
} }
bool func_send_pat_msg(char *roomid, char *wxid, uint8_t *out, size_t *len)
{
Response rsp = Response_init_default;
rsp.func = Functions_FUNC_SEND_PAT_MSG;
rsp.which_msg = Response_status_tag;
if ((roomid == NULL) || (wxid == NULL)) {
rsp.msg.status = -1;
} else {
rsp.msg.status = SendPatMessage(roomid, wxid);
}
pb_ostream_t stream = pb_ostream_from_buffer(out, *len);
if (!pb_encode(&stream, Response_fields, &rsp)) {
LOG_ERROR("Encoding failed: {}", PB_GET_ERROR(&stream));
return false;
}
*len = stream.bytes_written;
return true;
}
static void PushMessage() static void PushMessage()
{ {
static nng_socket msg_sock; static nng_socket msg_sock;
@ -758,6 +780,11 @@ static bool dispatcher(uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len
ret = func_send_rich_txt(req.msg.rt, out, out_len); ret = func_send_rich_txt(req.msg.rt, out, out_len);
break; break;
} }
case Functions_FUNC_SEND_PAT_MSG: {
LOG_DEBUG("[Functions_FUNC_SEND_PAT_MSG]");
ret = func_send_pat_msg(req.msg.pm.roomid, req.msg.pm.wxid, out, out_len);
break;
}
case Functions_FUNC_SEND_IMG: { case Functions_FUNC_SEND_IMG: {
LOG_DEBUG("[Functions_FUNC_SEND_IMG]"); LOG_DEBUG("[Functions_FUNC_SEND_IMG]");
ret = func_send_img(req.msg.file.path, req.msg.file.receiver, out, out_len); ret = func_send_img(req.msg.file.path, req.msg.file.receiver, out, out_len);

View File

@ -364,3 +364,34 @@ int SendRichTextMessage(RichText_t &rt)
return status; return status;
} }
int SendPatMessage(string roomid, string wxid)
{
int status = -1;
wstring wsRoomid = String2Wstring(roomid);
wstring wsWxid = String2Wstring(wxid);
WxString wxRoomid(wsRoomid);
WxString wxWxid(wsWxid);
DWORD pmCall1 = g_WeChatWinDllAddr + g_WxCalls.pm.call1;
DWORD pmCall2 = g_WeChatWinDllAddr + g_WxCalls.pm.call2;
DWORD pmCall3 = g_WeChatWinDllAddr + g_WxCalls.pm.call3;
__asm {
pushad;
call pmCall1;
push pmCall2;
push 0x0;
push eax;
lea ecx, wxRoomid;
lea edx, wxWxid;
call pmCall3;
add esp, 0xc;
movzx eax, al;
mov status, eax;
popad;
}
return status;
}

View File

@ -20,3 +20,4 @@ void SendFileMessage(string wxid, string path);
void SendXmlMessage(string receiver, string xml, string path, int type); void SendXmlMessage(string receiver, string xml, string path, int type);
void SendEmotionMessage(string wxid, string path); void SendEmotionMessage(string wxid, string path);
int SendRichTextMessage(RichText_t &rt); int SendRichTextMessage(RichText_t &rt);
int SendPatMessage(string roomid, string wxid);

Binary file not shown.

View File

@ -51,7 +51,7 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 39,0,8,0 FILEVERSION 39,0,9,0
PRODUCTVERSION 3,9,2,23 PRODUCTVERSION 3,9,2,23
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
@ -69,7 +69,7 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "WeChatFerry" VALUE "CompanyName", "WeChatFerry"
VALUE "FileDescription", "WeChatFerry" VALUE "FileDescription", "WeChatFerry"
VALUE "FileVersion", "39.0.8.0" VALUE "FileVersion", "39.0.9.0"
VALUE "InternalName", "spy.dll" VALUE "InternalName", "spy.dll"
VALUE "LegalCopyright", "Copyright (C) 2023" VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "spy.dll" VALUE "OriginalFilename", "spy.dll"

View File

@ -128,6 +128,12 @@ typedef struct CallRichText {
DWORD call5; DWORD call5;
} CallRichText_t; } CallRichText_t;
typedef struct CallPatMsg {
DWORD call1;
DWORD call2;
DWORD call3;
} CallPatMsg_t;
typedef struct WxCalls { typedef struct WxCalls {
DWORD login; // 登录状态 DWORD login; // 登录状态
UserInfoCall_t ui; // 用户信息 UserInfoCall_t ui; // 用户信息
@ -146,7 +152,8 @@ typedef struct WxCalls {
Pyq_t pyq; // 接收朋友圈消息 Pyq_t pyq; // 接收朋友圈消息
DlAttach_t da; // 下载资源(图片、文件、视频) DlAttach_t da; // 下载资源(图片、文件、视频)
RevokeMsg_t rm; // 撤回消息 RevokeMsg_t rm; // 撤回消息
CallRichText_t rt; // 消息卡片 CallRichText_t rt; // 发送消息卡片
CallPatMsg_t pm; // 发送拍一拍消息
} WxCalls_t; } WxCalls_t;
struct WxString { struct WxString {

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python3 #! /usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
__version__ = "39.0.8.0" __version__ = "39.0.9.0"
import atexit import atexit
import base64 import base64
@ -452,6 +452,24 @@ class Wcf():
rsp = self._send_request(req) rsp = self._send_request(req)
return rsp.status return rsp.status
def send_pat_msg(self, roomid: str, wxid: str) -> int:
"""拍一拍群友
Args:
roomid (str): id
wxid (str): 要拍的群友的 wxid
Returns:
int: 1 为成功其他失败
"""
req = wcf_pb2.Request()
req.func = wcf_pb2.FUNC_SEND_PAT_MSG # FUNC_SEND_PAT_MSG
req.pm.roomid = roomid
req.pm.wxid = wxid
rsp = self._send_request(req)
return rsp.status
def get_msg(self, block=True) -> WxMsg: def get_msg(self, block=True) -> WxMsg:
"""从消息队列中获取消息 """从消息队列中获取消息

File diff suppressed because one or more lines are too long