From 75d470935df51fa033c5a51b41ac22077e91caca Mon Sep 17 00:00:00 2001 From: hugy <504650082@qq.com> Date: Sat, 11 Feb 2023 16:26:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E6=9C=89=E7=9A=84=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=9B=B4=E6=96=B0=E5=88=B03.9.0.28=E7=89=88?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 18 ++++++++--------- src/chat_room.cc | 8 ++++++-- src/confirm_receipt.cc | 6 +++--- src/contact.cc | 45 +++++++++++++++++++++--------------------- src/ocr.cc | 11 +++++++---- src/pat.cc | 2 +- 6 files changed, 49 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index bebb8af..7165564 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ vcpkg 10.取消hook消息 11.hook图片 12.取消hook图片 -~~17.删除好友~~ +17.删除好友 25.获取群成员 27.删除群成员 28.增加群成员 @@ -120,14 +120,14 @@ vcpkg 34.查询数据库 40.转发消息 44.退出登录 -~~45.确认收款~~ +45.确认收款 46.联系人列表 47.获取群详情 48.获取解密图片 -~~49.图片提取文字ocr~~ -~~50.拍一拍~~ -~~51.群消息置顶消息~~ -~~52.群消息取消置顶~~ +49.图片提取文字ocr +50.拍一拍 +51.群消息置顶消息 +52.群消息取消置顶 53.朋友圈首页 54.朋友圈下一页 ### 接口文档: @@ -468,7 +468,7 @@ vcpkg #### 17.删除好友** ###### 接口功能 -> 删除好友 +> 删除好友,该接口不够完善,删除后,只会在通讯录里删除,如果点击聊天记录,又会重新加回来,删除的不彻底。 ###### 接口地址 > [/api/?type=17](/api/?type=17) @@ -485,7 +485,7 @@ vcpkg ###### 返回字段 |返回字段|字段类型|说明 | |---|---|---| -|code|int|返回状态,1成功, 0失败| +|code|int|返回状态,0成功, -1失败| |result|string|成功提示| @@ -498,7 +498,7 @@ vcpkg ``` 响应: ``` javascript -{"code":1,"result":"OK"} +{"code":0,"result":"OK"} ``` diff --git a/src/chat_room.cc b/src/chat_room.cc index 465984f..51164e7 100644 --- a/src/chat_room.cc +++ b/src/chat_room.cc @@ -22,6 +22,7 @@ using namespace std; #define WX_FREE_CHAT_MSG_OFFSET 0x6f4ea0 #define WX_TOP_MSG_OFFSET 0xb727e0 #define WX_REMOVE_TOP_MSG_OFFSET 0xb725a0 +#define WX_FREE_CHAT_MSG_INSTANCE_COUNTER_OFFSET 0x6f5370 int GetChatRoomDetailInfo(wchar_t* chat_room_id, ChatRoomInfoInner& room_info) { int success = 0; @@ -266,7 +267,8 @@ int SetTopMsg(wchar_t* wxid,ULONG64 msg_id){ DWORD new_chat_msg_addr = base + WX_NEW_CHAT_MSG_OFFSET; DWORD get_chat_room_mgr_addr = base + WX_CHAT_ROOM_MGR_OFFSET; DWORD handle_top_msg_addr = base + WX_TOP_MSG_OFFSET; - DWORD free_addr = base + WX_FREE_CHAT_MSG_OFFSET; + // DWORD free_addr = base + WX_FREE_CHAT_MSG_OFFSET; + DWORD free_addr = base + WX_FREE_CHAT_MSG_INSTANCE_COUNTER_OFFSET; vector local_msg = GetChatMsgByMsgId(msg_id); if(local_msg.empty()){ return -2; @@ -288,6 +290,7 @@ int SetTopMsg(wchar_t* wxid,ULONG64 msg_id){ WeChatString msg_content(w_content); WeChatString user_id(wxid); + __asm{ PUSHAD LEA ECX,chat_msg @@ -307,12 +310,13 @@ int SetTopMsg(wchar_t* wxid,ULONG64 msg_id){ __asm{ PUSHAD CALL get_chat_room_mgr_addr - PUSH 0x1 + PUSH 0x0 LEA EAX,chat_msg PUSH EAX CALL handle_top_msg_addr MOV success,EAX LEA ECX,chat_msg + PUSH 0x0 CALL free_addr POPAD } diff --git a/src/confirm_receipt.cc b/src/confirm_receipt.cc index 16cfa13..cb48b5b 100644 --- a/src/confirm_receipt.cc +++ b/src/confirm_receipt.cc @@ -4,9 +4,9 @@ #include "common.h" #include "wechat_data.h" -#define WX_NEW_WCPAYINFO_OFFSET 0x69d2b0 -#define WX_FREE_WCPAYINFO_OFFSET 0x68d610 -#define WX_CONFIRM_RECEIPT_OFFSET 0x13d5e00 +#define WX_NEW_WCPAYINFO_OFFSET 0x756340 +#define WX_FREE_WCPAYINFO_OFFSET 0x73c170 +#define WX_CONFIRM_RECEIPT_OFFSET 0x15287a0 int DoConfirmReceipt(wchar_t *wxid, wchar_t *transcationid, wchar_t *transferid) { diff --git a/src/contact.cc b/src/contact.cc index f4695d8..43ccccf 100644 --- a/src/contact.cc +++ b/src/contact.cc @@ -6,9 +6,11 @@ using namespace std; #define WX_CONTACT_MGR_INSTANCE_OFFSET 0x6f8990 #define WX_CONTACT_GET_LIST_OFFSET 0xb97550 -#define WX_CONTACT_DEL_OFFSET 0xa9ef40 -#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380 -#define WX_DB_QUERY_OFFSET 0xa9ec40 +#define WX_CONTACT_DEL_OFFSET 0xb9b3b0 +#define WX_INIT_CHAT_MSG_OFFSET 0xed3be0 +#define WX_SYNC_MGR_OFFSET 0xa87fd0 +#define WX_SET_VALUE_OFFSET 0x1f80900 +#define WX_DO_DEL_CONTACT_OFFSET 0xca6480 int GetAllContact(vector &vec) { DWORD base = GetWeChatWinBase(); DWORD get_instance = base + WX_CONTACT_MGR_INSTANCE_OFFSET; @@ -66,33 +68,32 @@ int GetAllContact(vector &vec) { } return success; } -// todo +// note maybe not delete int DelContact(wchar_t *wxid) { - int success = 0; + int success = -1; WeChatString user_id(wxid); DWORD id_ptr = (DWORD) &user_id; DWORD base = GetWeChatWinBase(); - DWORD get_instance_addr = base + WX_CONTACT_MGR_INSTANCE_OFFSET; - DWORD init_chat_msg_addr = base + WX_INIT_CHAT_MSG_OFFSET; - DWORD del_addr = base + WX_CONTACT_DEL_OFFSET; - DWORD db_op_addr = base + WX_DB_QUERY_OFFSET; + DWORD sync_mgr_addr = base + WX_SYNC_MGR_OFFSET; + DWORD set_id_addr = base + WX_SET_VALUE_OFFSET; + DWORD del_contact_addr = base + WX_DO_DEL_CONTACT_OFFSET; + int len = user_id.length; + + string id_cstr = unicode_to_utf8(wxid); + char id_[0x20]={0}; + memcpy(id_,id_cstr.c_str(),id_cstr.size()+1); + char buff[0x10]={0}; __asm{ PUSHAD PUSHFD - CALL get_instance_addr - MOV ECX,dword ptr[id_ptr] - PUSH ECX + CALL sync_mgr_addr MOV ECX,EAX - MOV ESI,EAX - CALL db_op_addr - SUB ESP,0x14 - MOV EAX,dword ptr[id_ptr] - MOV ECX,ESP - PUSH EAX - CALL init_chat_msg_addr - MOV ECX,ESI - CALL del_addr - MOV success,EAX + LEA EAX,buff + MOV [ECX + 4],EAX + LEA EAX,id_ + Mov dword ptr[buff +0x4],EAX + CALL del_contact_addr + MOV success,EAX POPFD POPAD } diff --git a/src/ocr.cc b/src/ocr.cc index c22275e..4ac88d4 100644 --- a/src/ocr.cc +++ b/src/ocr.cc @@ -4,9 +4,9 @@ #include "common.h" #include "wechat_data.h" -#define WX_INIT_OBJ_OFFSET 0x6cbab0 -#define WX_OCR_MANAGER_OFFSET 0x6cff00 -#define WX_DO_OCR_TASK_OFFSET 0x11e3210 +#define WX_INIT_OBJ_OFFSET 0x7a98f0 +#define WX_OCR_MANAGER_OFFSET 0x7ae470 +#define WX_DO_OCR_TASK_OFFSET 0x13230c0 using namespace std; int DoOCRTask(wchar_t *img_path, std::string &result) { int success = -1; @@ -17,6 +17,7 @@ int DoOCRTask(wchar_t *img_path, std::string &result) { DWORD ocr_manager_addr = base + WX_OCR_MANAGER_OFFSET; DWORD do_ocr_task_addr = base + WX_DO_OCR_TASK_OFFSET; DWORD init_addr = base + WX_INIT_OBJ_OFFSET; + DWORD flag = 0; __asm { PUSHAD PUSHFD @@ -25,9 +26,11 @@ int DoOCRTask(wchar_t *img_path, std::string &result) { CALL ocr_manager_addr LEA ECX,null_obj PUSH ECX + LEA ECX,flag + PUSH ECX LEA ECX,ocr_result PUSH ECX - PUSH ECX + PUSH 0x0 LEA ECX,path PUSH ECX MOV ECX,EAX diff --git a/src/pat.cc b/src/pat.cc index 2fa6ec8..16a4757 100644 --- a/src/pat.cc +++ b/src/pat.cc @@ -5,7 +5,7 @@ #include "wechat_data.h" #define WX_PAT_MGR_OFFSET 0x8d0c00 -#define WX_SEND_PAT_MSG_OFFSET 0x1228510 +#define WX_SEND_PAT_MSG_OFFSET 0x1369850 #define WX_RET_OFFSET 0x1C94D34 int SendPatMsg(wchar_t* chat_room_id, wchar_t* wxid) {