mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-23 02:39:25 +08:00
commit
4ab28cfc03
@ -874,7 +874,7 @@ enableHttp=0时,使用ip,port的tcp服务回传消息。
|
||||
```
|
||||
|
||||
|
||||
#### 16.hook日志**
|
||||
#### 17.hook日志**
|
||||
###### 接口功能
|
||||
> hook微信日志,输出在wechat安装目录的logs目录下
|
||||
|
||||
@ -953,4 +953,44 @@ enableHttp=0时,使用ip,port的tcp服务回传消息。
|
||||
"data": null,
|
||||
"msg": "success"
|
||||
}
|
||||
```
|
||||
|
||||
#### 19.建群**
|
||||
###### 接口功能
|
||||
> 建群(不建议使用,容易被封,测试期间被封了,无法保证效果)
|
||||
|
||||
###### 接口地址
|
||||
> [/api/createChatRoom](/api/createChatRoom)
|
||||
|
||||
###### HTTP请求方式
|
||||
> POST JSON
|
||||
|
||||
###### 请求参数
|
||||
|参数|必选|类型|说明|
|
||||
|---|---|---|---|
|
||||
|memberIds|string|群成员id,以,分割|
|
||||
|
||||
|
||||
###### 返回字段
|
||||
|返回字段|字段类型|说明 |
|
||||
|---|---|---|
|
||||
|code|int|返回状态,0成功, -1失败|
|
||||
|msg|string|成功提示|
|
||||
|data|object|null|
|
||||
|
||||
|
||||
###### 接口示例
|
||||
|
||||
入参:
|
||||
``` javascript
|
||||
|
||||
|
||||
```
|
||||
响应:
|
||||
``` javascript
|
||||
{
|
||||
"code": 1,
|
||||
"data": null,
|
||||
"msg": "success"
|
||||
}
|
||||
```
|
@ -380,6 +380,14 @@ std::string HttpDispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
||||
{"code", success}, {"msg", "success"}, {"data", {}}};
|
||||
ret = ret_data.dump();
|
||||
return ret;
|
||||
} else if (mg_http_match_uri(hm, "/api/createChatRoom")) {
|
||||
std::vector<std::wstring> wxids = GetArrayParam(j_param, "memberIds");
|
||||
INT64 success =
|
||||
wxhelper::GlobalContext::GetInstance().mgr->CreateChatRoom(wxids);
|
||||
nlohmann::json ret_data = {
|
||||
{"code", success}, {"msg", "success"}, {"data", {}}};
|
||||
ret = ret_data.dump();
|
||||
return ret;
|
||||
} else {
|
||||
nlohmann::json ret_data = {
|
||||
{"code", 200}, {"data", {}}, {"msg", "not support url"}};
|
||||
|
@ -552,4 +552,25 @@ INT64 Manager::InviteMemberToChatRoom(const std::wstring &room_id,
|
||||
reinterpret_cast<UINT64>(&temp));
|
||||
return success;
|
||||
}
|
||||
|
||||
INT64 Manager::CreateChatRoom(const std::vector<std::wstring>& wxids){
|
||||
INT64 success = -1;
|
||||
UINT64 get_chat_room_mgr_addr = base_addr_ + offset::kChatRoomMgr;
|
||||
UINT64 create_chat_room_addr = base_addr_ + offset::kCreateChatRoom;
|
||||
func::__GetChatRoomMgr get_chat_room_mgr =
|
||||
(func::__GetChatRoomMgr)get_chat_room_mgr_addr;
|
||||
func::__CreateChatRoom create_chat_room =
|
||||
(func::__CreateChatRoom)create_chat_room_addr;
|
||||
std::vector<prototype::WeChatString> wxid_list;
|
||||
common::VectorInner *list = (common::VectorInner *)&wxid_list;
|
||||
INT64 head = (INT64)&list->start;
|
||||
for (int i = 0; i < wxids.size(); i++) {
|
||||
prototype::WeChatString id(wxids[i]);
|
||||
wxid_list.push_back(id);
|
||||
}
|
||||
INT64 end = list->end;
|
||||
UINT64 mgr = get_chat_room_mgr();
|
||||
success = create_chat_room(mgr, head, end);
|
||||
return success;
|
||||
}
|
||||
} // namespace wxhelper
|
@ -29,6 +29,7 @@ class Manager {
|
||||
INT64 RemoveTopMsg(const std::wstring& room_id,ULONG64 msg_id);
|
||||
INT64 InviteMemberToChatRoom(const std::wstring& room_id,
|
||||
const std::vector<std::wstring>& wxids);
|
||||
INT64 CreateChatRoom(const std::vector<std::wstring>& wxids);
|
||||
|
||||
private:
|
||||
UINT64 base_addr_;
|
||||
|
@ -237,6 +237,9 @@ typedef UINT64 (*__DoTopMsg)(UINT64,UINT64);
|
||||
typedef UINT64 (*__RemoveTopMsg)(UINT64,UINT64,UINT64);
|
||||
typedef UINT64 (*__InviteMemberToChatRoom)(UINT64,UINT64,UINT64,UINT64);
|
||||
|
||||
typedef UINT64 (*__CreateChatRoom)(UINT64,UINT64,UINT64);
|
||||
|
||||
|
||||
} // namespace function
|
||||
namespace prototype {
|
||||
|
||||
@ -338,6 +341,8 @@ const UINT64 kRemoveTopMsg = 0xe787b0;
|
||||
const UINT64 kInviteMember = 0xe63650;
|
||||
const UINT64 kHookLog = 0x1304e60;
|
||||
|
||||
const UINT64 kCreateChatRoom = 0xe63340;
|
||||
|
||||
} // namespace offset
|
||||
} // namespace V3_9_5_81
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user