3.9.2.23版本更新

This commit is contained in:
hugy 2023-03-28 10:01:55 +08:00
parent 789b4b6e75
commit 4a3ef64467
3 changed files with 39 additions and 20 deletions

View File

@ -1,5 +1,5 @@
3.9.2.23 测试版,临时测试 ## 3.9.2.23版本,预览功能没有的接口,不能使用,文档仅供参考。
#### 功能预览: #### 功能预览:
0.检查是否登录 0.检查是否登录
1.获取登录微信信息 1.获取登录微信信息
@ -36,8 +36,8 @@
52.群消息取消置顶 --> 52.群消息取消置顶 -->
53.朋友圈首页 53.朋友圈首页
54.朋友圈下一页 54.朋友圈下一页
<!-- 55.获取联系人或者群名称 <!-- 55.获取联系人或者群名称 -->
56.获取消息附件(图片,视频,文件) --> 56.获取消息附件(图片,视频,文件)
### 接口文档: ### 接口文档:
@ -107,6 +107,7 @@
|province|string|省| |province|string|省|
|wxid|string|wxid| |wxid|string|wxid|
|signature|string|个人签名| |signature|string|个人签名|
|dbKey|string|数据库的SQLCipher的加密key可以使用该key配合decrypt.py解密数据库
###### 接口示例 ###### 接口示例
入参: 入参:
@ -114,7 +115,7 @@
``` ```
响应: 响应:
``` javascript ``` javascript
{"code":1,"data":{"account":"xx","headImage":"https://wx.qlogo.cn/mmhead/ver_1xx","city":"xx","country":"CN","currentDataPath":"C:\\xx\\wxid_xxxxx","dataSavePath":"C:\\xx","mobie":"13812345678","name":"xx","province":"xx","signature":"xx","wxid":"xx"},"result":"OK"} {"code":1,"data":{"account":"xx","headImage":"https://wx.qlogo.cn/mmhead/ver_1xx","city":"xx","country":"CN","currentDataPath":"C:\\xx\\wxid_xxxxx","dataSavePath":"C:\\xx","mobie":"13812345678","name":"xx","province":"xx","signature":"xx","wxid":"xx","dbKey":"aaa2222"},"result":"OK"}
``` ```

View File

@ -244,6 +244,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_MSG_SEND_AT: { case WECHAT_MSG_SEND_AT: {
break;
wstring chat_room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post); wstring chat_room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post);
vector<wstring> wxids = get_http_param_array(hm, j_param, "wxids", is_post); vector<wstring> wxids = get_http_param_array(hm, j_param, "wxids", is_post);
wstring msg = get_http_req_param(hm, j_param, "msg", is_post); wstring msg = get_http_req_param(hm, j_param, "msg", is_post);
@ -299,6 +300,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_MSG_START_IMAGE_HOOK: { case WECHAT_MSG_START_IMAGE_HOOK: {
break;
wstring img_dir = get_http_req_param(hm, j_param, "imgDir", is_post); wstring img_dir = get_http_req_param(hm, j_param, "imgDir", is_post);
int success = HookImg(img_dir); int success = HookImg(img_dir);
json ret_data = {{"code", success}, {"result", "OK"}}; json ret_data = {{"code", success}, {"result", "OK"}};
@ -306,6 +308,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_MSG_STOP_IMAGE_HOOK: { case WECHAT_MSG_STOP_IMAGE_HOOK: {
break;
int success = UnHookImg(); int success = UnHookImg();
json ret_data = {{"code", success}, {"result", "OK"}}; json ret_data = {{"code", success}, {"result", "OK"}};
ret = ret_data.dump(); ret = ret_data.dump();
@ -332,6 +335,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CONTACT_DEL: { case WECHAT_CONTACT_DEL: {
break;
wstring user_id = get_http_req_param(hm, j_param, "wxid", is_post); wstring user_id = get_http_req_param(hm, j_param, "wxid", is_post);
int success = DelContact(WS2LW(user_id)); int success = DelContact(WS2LW(user_id));
json ret_data = {{"code", success}, {"result", "OK"}}; json ret_data = {{"code", success}, {"result", "OK"}};
@ -342,6 +346,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CONTACT_SEARCH_BY_NET: { case WECHAT_CONTACT_SEARCH_BY_NET: {
break;
wstring keyword = get_http_req_param(hm, j_param, "keyword", is_post); wstring keyword = get_http_req_param(hm, j_param, "keyword", is_post);
UserInfo *user = nullptr; UserInfo *user = nullptr;
int success = SearchContactNetScene(WS2LW(keyword), &user); int success = SearchContactNetScene(WS2LW(keyword), &user);
@ -365,6 +370,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CONTACT_ADD_BY_WXID: { case WECHAT_CONTACT_ADD_BY_WXID: {
break;
wstring user_id = get_http_req_param(hm, j_param, "wxid", is_post); wstring user_id = get_http_req_param(hm, j_param, "wxid", is_post);
int success = AddFriendByWxid(WS2LW(user_id)); int success = AddFriendByWxid(WS2LW(user_id));
json ret_data = {{"code", success}, {"result", "OK"}}; json ret_data = {{"code", success}, {"result", "OK"}};
@ -400,6 +406,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CHATROOM_GET_MEMBER_NICKNAME: { case WECHAT_CHATROOM_GET_MEMBER_NICKNAME: {
break;
wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post); wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post);
wstring member_id = get_http_req_param(hm, j_param, "memberId", is_post); wstring member_id = get_http_req_param(hm, j_param, "memberId", is_post);
@ -409,6 +416,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CHATROOM_DEL_MEMBER: { case WECHAT_CHATROOM_DEL_MEMBER: {
break;
wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post); wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post);
vector<wstring> wxids = get_http_param_array(hm, j_param, "memberIds", is_post); vector<wstring> wxids = get_http_param_array(hm, j_param, "memberIds", is_post);
vector<wchar_t *> wxid_list; vector<wchar_t *> wxid_list;
@ -421,6 +429,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CHATROOM_ADD_MEMBER: { case WECHAT_CHATROOM_ADD_MEMBER: {
break;
wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post); wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post);
vector<wstring> wxids = get_http_param_array(hm, j_param, "memberIds", is_post); vector<wstring> wxids = get_http_param_array(hm, j_param, "memberIds", is_post);
vector<wchar_t *> wxid_list; vector<wchar_t *> wxid_list;
@ -439,6 +448,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CHATROOM_SET_SELF_NICKNAME: { case WECHAT_CHATROOM_SET_SELF_NICKNAME: {
break;
wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post); wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post);
wstring wxid = get_http_req_param(hm, j_param, "wxid", is_post); wstring wxid = get_http_req_param(hm, j_param, "wxid", is_post);
wstring nick = get_http_req_param(hm, j_param, "nickName", is_post); wstring nick = get_http_req_param(hm, j_param, "nickName", is_post);
@ -496,12 +506,14 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_LOG_START_HOOK: { case WECHAT_LOG_START_HOOK: {
break;
int success = HookLog(); int success = HookLog();
json ret_data = {{"code", success}, {"result", "OK"}}; json ret_data = {{"code", success}, {"result", "OK"}};
ret = ret_data.dump(); ret = ret_data.dump();
break; break;
} }
case WECHAT_LOG_STOP_HOOK: { case WECHAT_LOG_STOP_HOOK: {
break;
int success = UnHookLog(); int success = UnHookLog();
json ret_data = {{"code", success}, {"result", "OK"}}; json ret_data = {{"code", success}, {"result", "OK"}};
ret = ret_data.dump(); ret = ret_data.dump();
@ -537,6 +549,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_GET_TRANSFER: { case WECHAT_GET_TRANSFER: {
break;
wstring wxid = get_http_req_param(hm, j_param, "wxid", is_post); wstring wxid = get_http_req_param(hm, j_param, "wxid", is_post);
wstring transcationid = get_http_req_param(hm, j_param, "transcationId", is_post); wstring transcationid = get_http_req_param(hm, j_param, "transcationId", is_post);
wstring transferid = get_http_req_param(hm, j_param, "transferId", is_post); wstring transferid = get_http_req_param(hm, j_param, "transferId", is_post);
@ -583,6 +596,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_GET_CHATROOM_INFO: { case WECHAT_GET_CHATROOM_INFO: {
break;
wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post); wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post);
ChatRoomInfoInner chat_room_detail{0}; ChatRoomInfoInner chat_room_detail{0};
int success = GetChatRoomDetailInfo(WS2LW(room_id), chat_room_detail); int success = GetChatRoomDetailInfo(WS2LW(room_id), chat_room_detail);
@ -618,6 +632,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_DO_OCR:{ case WECHAT_DO_OCR:{
break;
wstring image_path = get_http_req_param(hm, j_param, "imagePath", is_post); wstring image_path = get_http_req_param(hm, j_param, "imagePath", is_post);
string text(""); string text("");
int success = DoOCRTask(WS2LW(image_path),text); int success = DoOCRTask(WS2LW(image_path),text);
@ -634,6 +649,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_SET_TOP_MSG:{ case WECHAT_SET_TOP_MSG:{
break;
wstring wxid = get_http_req_param(hm, j_param, "wxid", is_post); wstring wxid = get_http_req_param(hm, j_param, "wxid", is_post);
ULONG64 msgid = get_http_param_ulong64(hm, j_param, "msgid", is_post); ULONG64 msgid = get_http_param_ulong64(hm, j_param, "msgid", is_post);
int success = SetTopMsg(WS2LW(wxid),msgid); int success = SetTopMsg(WS2LW(wxid),msgid);
@ -642,6 +658,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_REMOVE_TOP_MSG:{ case WECHAT_REMOVE_TOP_MSG:{
break;
wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post); wstring room_id = get_http_req_param(hm, j_param, "chatRoomId", is_post);
ULONG64 msgid = get_http_param_ulong64(hm, j_param, "msgid", is_post); ULONG64 msgid = get_http_param_ulong64(hm, j_param, "msgid", is_post);
int success = RemoveTopMsg(WS2LW(room_id),msgid); int success = RemoveTopMsg(WS2LW(room_id),msgid);
@ -663,6 +680,7 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
break; break;
} }
case WECHAT_CONTACT_NAME:{ case WECHAT_CONTACT_NAME:{
break;
wstring pri_id = get_http_req_param(hm, j_param, "id", is_post); wstring pri_id = get_http_req_param(hm, j_param, "id", is_post);
wstring name =GetContactOrChatRoomNickname(WS2LW(pri_id)); wstring name =GetContactOrChatRoomNickname(WS2LW(pri_id));
json ret_data = {{"code", 1}, {"result", "OK"},{"name",unicode_to_utf8(WS2LW(name))}}; json ret_data = {{"code", 1}, {"result", "OK"},{"name",unicode_to_utf8(WS2LW(name))}};

View File

@ -6,20 +6,20 @@
#include "wechat_data.h" #include "wechat_data.h"
#define WX_NEW_CHAT_MSG_OFFSET 0x70e2a0 #define WX_NEW_CHAT_MSG_OFFSET 0x76f010
#define WX_GET_PRE_DOWNLOAD_MGR_OFFSET 0x7ae310 #define WX_GET_PRE_DOWNLOAD_MGR_OFFSET 0x80f110
#define WX_PUSH_ATTACH_TASK_OFFSET 0x7c94a0 #define WX_PUSH_ATTACH_TASK_OFFSET 0x82bb40
#define WX_FREE_CHAT_MSG_INSTANCE_COUNTER_OFFSET 0x6f5370 #define WX_FREE_CHAT_MSG_INSTANCE_COUNTER_OFFSET 0x756e30
#define WX_FREE_CHAT_MSG_OFFSET 0x6f4ea0 #define WX_FREE_CHAT_MSG_OFFSET 0x756960
#define WX_CHAT_MGR_OFFSET 0x732660 #define WX_CHAT_MGR_OFFSET 0x792700
#define WX_GET_MGR_BY_PREFIX_LOCAL_ID_OFFSET 0xb54950 #define WX_GET_MGR_BY_PREFIX_LOCAL_ID_OFFSET 0xbc0370
#define WX_GET_CURRENT_DATA_PATH_OFFSET 0xc11140 #define WX_GET_CURRENT_DATA_PATH_OFFSET 0xc872c0
#define WX_APP_MSG_INFO_OFFSET 0x7571d0 #define WX_APP_MSG_INFO_OFFSET 0x7b3d20
#define WX_GET_APP_MSG_XML_OFFSET 0xddef80 #define WX_GET_APP_MSG_XML_OFFSET 0xe628a0
#define WX_FREE_APP_MSG_INFO_OFFSET 0x73d820 #define WX_FREE_APP_MSG_INFO_OFFSET 0x79d900
#define WX_PUSH_THUMB_TASK_OFFSET 0x7c93a0 #define WX_PUSH_THUMB_TASK_OFFSET 0x82ba40
#define WX_VIDEO_MGR_OFFSET 0x7c7300 #define WX_VIDEO_MGR_OFFSET 0x829820
#define WX_DOWNLOAD_VIDEO_IMG_OFFSET 0xcc6d80 #define WX_DOWNLOAD_VIDEO_IMG_OFFSET 0xd46c30
using namespace std; using namespace std;
@ -31,7 +31,7 @@ int DoDownloadTask(ULONG64 msg_id) {
return -2; return -2;
} }
char chat_msg[0x2C4] = {0}; char chat_msg[0x2D8] = {0};
DWORD base = GetWeChatWinBase(); DWORD base = GetWeChatWinBase();
DWORD new_chat_msg_addr = base + WX_NEW_CHAT_MSG_OFFSET; DWORD new_chat_msg_addr = base + WX_NEW_CHAT_MSG_OFFSET;
DWORD get_chat_mgr_addr = base + WX_CHAT_MGR_OFFSET; DWORD get_chat_mgr_addr = base + WX_CHAT_MGR_OFFSET;
@ -143,7 +143,7 @@ int DoDownloadTask(ULONG64 msg_id) {
int temp =1; int temp =1;
memcpy(&chat_msg[0x19C], &w_thumb_path, sizeof(w_thumb_path)); memcpy(&chat_msg[0x19C], &w_thumb_path, sizeof(w_thumb_path));
memcpy(&chat_msg[0x1B0], &w_save_path, sizeof(w_save_path)); memcpy(&chat_msg[0x1B0], &w_save_path, sizeof(w_save_path));
memcpy(&chat_msg[0x290], &temp, sizeof(temp)); memcpy(&chat_msg[0x29C], &temp, sizeof(temp));
// note the image has been downloaded and will not be downloaded again // note the image has been downloaded and will not be downloaded again
// use low-level method // use low-level method
// this function does not work, need to modify chatmsg. // this function does not work, need to modify chatmsg.