mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-05 18:09:24 +08:00
feat: 新增邀请入群
This commit is contained in:
parent
aaada266df
commit
80718a2af5
1662
doc/3.9.2.26.md
1662
doc/3.9.2.26.md
File diff suppressed because it is too large
Load Diff
@ -72,6 +72,7 @@ typedef enum HTTP_API_ROUTE {
|
||||
WECHAT_ATTACH_DOWNLOAD,
|
||||
WECHAT_GET_VOICE,
|
||||
WECHAT_GET_QRCODE,
|
||||
WECHAT_INVITE_MEMBERS,
|
||||
} WECHAT_HTTP_APIS,
|
||||
*PWECHAT_HTTP_APIS;
|
||||
|
||||
|
@ -374,4 +374,65 @@ std::wstring ChatRoomMgr::GetChatRoomMemberNickname(wchar_t* chat_room_id,
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
int ChatRoomMgr::InviteMemberToChatRoom(wchar_t* chat_room_id, wchar_t** wxids, int len) {
|
||||
int success = -1;
|
||||
WeChatString chat_room(chat_room_id);
|
||||
vector<WeChatString> members;
|
||||
VectorInner* list = (VectorInner*)&members;
|
||||
DWORD members_ptr = (DWORD)&list->start;
|
||||
for (int i = 0; i < len; i++) {
|
||||
WeChatString pwxid(wxids[i]);
|
||||
members.push_back(pwxid);
|
||||
}
|
||||
DWORD get_chat_room_mgr_addr = base_addr_ + WX_CHAT_ROOM_MGR_OFFSET;
|
||||
DWORD add_member_addr = base_addr_ + WX_ADD_MEMBER_TO_CHAT_ROOM_OFFSET;
|
||||
DWORD init_chat_msg_addr = base_addr_ + WX_INIT_CHAT_MSG_OFFSET;
|
||||
DWORD get_share_record_mgr_addr = base_addr_ + WX_SHARE_RECORD_MGR_OFFSET;
|
||||
|
||||
DWORD fn1 = base_addr_ + 0x7fa730;
|
||||
DWORD fn2 = base_addr_ + 0x78d9a0;
|
||||
DWORD fn3 = base_addr_ + 0x7fb6e0;
|
||||
DWORD fn4 = base_addr_ + 0x755af0;
|
||||
DWORD invite_addr = base_addr_ + 0xbd28a0;
|
||||
|
||||
DWORD sys_addr = (DWORD)GetModuleHandleA("win32u.dll") + 0x116C;
|
||||
DWORD addr[2] = {sys_addr,0};
|
||||
__asm {
|
||||
PUSHAD
|
||||
PUSHFD
|
||||
CALL get_share_record_mgr_addr
|
||||
LEA ECX,addr
|
||||
PUSH ECX
|
||||
MOV ECX,EAX
|
||||
CALL fn1
|
||||
CALL get_chat_room_mgr_addr
|
||||
SUB ESP,0x8
|
||||
LEA EAX,addr
|
||||
MOV ECX,ESP
|
||||
PUSH EAX
|
||||
CALL fn2
|
||||
SUB ESP,0x14
|
||||
MOV ECX,ESP
|
||||
LEA EAX,chat_room
|
||||
PUSH EAX
|
||||
CALL init_chat_msg_addr
|
||||
MOV EAX,dword ptr[members_ptr]
|
||||
PUSH EAX
|
||||
CALL invite_addr
|
||||
CALL get_share_record_mgr_addr
|
||||
PUSH 0x0
|
||||
PUSH 0x1
|
||||
MOV ECX,EAX
|
||||
CALL fn3
|
||||
LEA ECX,addr
|
||||
CALL fn4
|
||||
POPFD
|
||||
POPAD
|
||||
}
|
||||
success = 1;
|
||||
return success;
|
||||
|
||||
}
|
||||
|
||||
} // namespace wxhelper
|
@ -23,6 +23,8 @@ class ChatRoomMgr:public BaseMgr {
|
||||
|
||||
std::wstring GetChatRoomMemberNickname(wchar_t* chat_room_id,
|
||||
wchar_t* wxid);
|
||||
int InviteMemberToChatRoom(wchar_t* chat_room_id, wchar_t** wxids,
|
||||
int len);
|
||||
};
|
||||
} // namespace wxhelper
|
||||
#endif
|
@ -578,6 +578,19 @@ string Dispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
case WECHAT_INVITE_MEMBERS: {
|
||||
wstring room_id = GetWStringParam(j_param, "chatRoomId");
|
||||
vector<wstring> wxids = getArrayParam(j_param, "memberIds");
|
||||
vector<wchar_t *> wxid_list;
|
||||
for (unsigned int i = 0; i < wxids.size(); i++) {
|
||||
wxid_list.push_back(WS2LPWS(wxids[i]));
|
||||
}
|
||||
int success = g_context.chat_room_mgr->InviteMemberToChatRoom(
|
||||
WS2LPWS(room_id), wxid_list.data(), wxid_list.size());
|
||||
json ret_data = {{"code", success}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -25,6 +25,8 @@
|
||||
#define WX_APP_MSG_MGR_OFFSET 0x76b8c0
|
||||
// sendMessageMgr
|
||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x768be0
|
||||
// shareRecordMgr
|
||||
#define WX_SHARE_RECORD_MGR_OFFSET 0x78d5f0
|
||||
|
||||
|
||||
// setChatMsgValue
|
||||
|
Loading…
Reference in New Issue
Block a user