mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-05 18:09:24 +08:00
3.9.0.28版本
This commit is contained in:
parent
915cb1602f
commit
e563710f80
42
README.md
42
README.md
@ -1,5 +1,5 @@
|
|||||||
# wxhelper
|
# wxhelper
|
||||||
wechat hook 。PC端微信逆向学习。支持3.8.0.41,3.8.1.26版本。
|
wechat hook 。PC端微信逆向学习。支持3.8.0.41,3.8.1.26,3.9.0.28版本。
|
||||||
#### 免责声明:
|
#### 免责声明:
|
||||||
本仓库发布的内容,仅用于学习研究,请勿用于非法用途和商业用途!如因此产生任何法律纠纷,均与作者无关!
|
本仓库发布的内容,仅用于学习研究,请勿用于非法用途和商业用途!如因此产生任何法律纠纷,均与作者无关!
|
||||||
|
|
||||||
@ -7,13 +7,13 @@ wechat hook 。PC端微信逆向学习。支持3.8.0.41,3.8.1.26版本。
|
|||||||
本项目是个人学习学习逆向的项目,主要参考 https://github.com/ljc545w/ComWeChatRobot ,在此基础上实现了微信的的其它版本的部分内容。
|
本项目是个人学习学习逆向的项目,主要参考 https://github.com/ljc545w/ComWeChatRobot ,在此基础上实现了微信的的其它版本的部分内容。
|
||||||
|
|
||||||
#### 使用说明:
|
#### 使用说明:
|
||||||
支持的版本3.8.0.41,3.8.1.26。
|
支持的版本3.8.0.41,3.8.1.26,3.9.0.28。
|
||||||
src:主要的dll代码
|
src:主要的dll代码
|
||||||
tool:简单的注入工具,一个是控制台,一个是图形界面。
|
tool:简单的注入工具,一个是控制台,一个是图形界面。
|
||||||
python: 简单的服务器,用以接收消息内容。
|
python: 简单的服务器,用以接收消息内容。
|
||||||
release:编译好的dll。
|
release:编译好的dll。
|
||||||
|
|
||||||
0.首先安装对应的微信版本,主分支是3.8.0.41版本,3.8.1.26分支对应3.8.1.26版本。
|
0.首先安装对应的微信版本,主分支是3.8.0.41版本,分支对应相应的微信版本号.
|
||||||
1.通过cmake构建成功后,将wxhelper.dll注入到微信,本地启动tcp server,监听19088端口。
|
1.通过cmake构建成功后,将wxhelper.dll注入到微信,本地启动tcp server,监听19088端口。
|
||||||
2.通过http协议与dll通信,方便客户端操作。
|
2.通过http协议与dll通信,方便客户端操作。
|
||||||
3.接口的url为http://127.0.0.1:19088,注入成功后,直接进行调用即可。
|
3.接口的url为http://127.0.0.1:19088,注入成功后,直接进行调用即可。
|
||||||
@ -21,6 +21,8 @@ release:编译好的dll。
|
|||||||
5.相关功能只在win11环境下进行简单测试,其他环境无法保证。
|
5.相关功能只在win11环境下进行简单测试,其他环境无法保证。
|
||||||
6.注意个别接口在3.8.0.41版本没有实现,具体参考源码。
|
6.注意个别接口在3.8.0.41版本没有实现,具体参考源码。
|
||||||
7.对应分支接口文档都是支持指定版本的,其他版本不支持,请特别注意版本。
|
7.对应分支接口文档都是支持指定版本的,其他版本不支持,请特别注意版本。
|
||||||
|
8.相应分支的文档对应相应版本,带有删除线的接口表示该版本的暂未实现,其他版本有实现。后续会继续实现。
|
||||||
|
|
||||||
|
|
||||||
#### 编译环境
|
#### 编译环境
|
||||||
|
|
||||||
@ -97,6 +99,8 @@ vcpkg
|
|||||||
|
|
||||||
2023-02-08 : 新增朋友圈消息。
|
2023-02-08 : 新增朋友圈消息。
|
||||||
|
|
||||||
|
2023-02-09 : 新增3.9.0.28版本基础功能。
|
||||||
|
|
||||||
#### 功能预览:
|
#### 功能预览:
|
||||||
0.检查是否登录
|
0.检查是否登录
|
||||||
1.获取登录微信信息
|
1.获取登录微信信息
|
||||||
@ -105,25 +109,25 @@ vcpkg
|
|||||||
6.发送文件
|
6.发送文件
|
||||||
9.hook消息
|
9.hook消息
|
||||||
10.取消hook消息
|
10.取消hook消息
|
||||||
11.hook图片
|
~~11.hook图片~~
|
||||||
12.取消hook图片
|
~~12.取消hook图片~~
|
||||||
17.删除好友
|
~~17.删除好友~~
|
||||||
25.获取群成员
|
~~25.获取群成员~~
|
||||||
27.删除群成员
|
~~27.删除群成员~~
|
||||||
28.增加群成员
|
~~28.增加群成员~~
|
||||||
31.修改群昵称
|
~~31.修改群昵称~~
|
||||||
32.获取数据库句柄
|
~~32.获取数据库句柄~~
|
||||||
34.查询数据库
|
~~34.查询数据库~~
|
||||||
40.转发消息
|
~~40.转发消息~~
|
||||||
44.退出登录
|
44.退出登录
|
||||||
45.确认收款
|
~~45.确认收款~~
|
||||||
46.联系人列表
|
46.联系人列表
|
||||||
47.获取群详情
|
~~47.获取群详情~~
|
||||||
48.获取解密图片
|
48.获取解密图片
|
||||||
49.图片提取文字ocr
|
~~49.图片提取文字ocr~~
|
||||||
50.拍一拍
|
~~50.拍一拍~~
|
||||||
51.群消息置顶消息
|
~~51.群消息置顶消息~~
|
||||||
52.群消息取消置顶
|
~~52.群消息取消置顶~~
|
||||||
53.朋友圈首页
|
53.朋友圈首页
|
||||||
54.朋友圈下一页
|
54.朋友圈下一页
|
||||||
### 接口文档:
|
### 接口文档:
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "wechat_data.h"
|
#include "wechat_data.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#define WX_CONTACT_MGR_INSTANCE_OFFSET 0x64dc30
|
#define WX_CONTACT_MGR_INSTANCE_OFFSET 0x6f8990
|
||||||
#define WX_CONTACT_GET_LIST_OFFSET 0xa9b000
|
#define WX_CONTACT_GET_LIST_OFFSET 0xb97550
|
||||||
#define WX_CONTACT_DEL_OFFSET 0xa9ef40
|
#define WX_CONTACT_DEL_OFFSET 0xa9ef40
|
||||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
||||||
#define WX_DB_QUERY_OFFSET 0xa9ec40
|
#define WX_DB_QUERY_OFFSET 0xa9ec40
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
using namespace nlohmann;
|
using namespace nlohmann;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#define WX_RECV_MSG_HOOK_OFFSET 0xb97126
|
#define WX_RECV_MSG_HOOK_OFFSET 0xca0284
|
||||||
#define WX_RECV_MSG_HOOK_NEXT_OFFSET 0x6fc850
|
#define WX_RECV_MSG_HOOK_NEXT_OFFSET 0x7d5030
|
||||||
#define WX_SNS_HOOK_OFFSET 0x12fb9a5
|
#define WX_SNS_HOOK_OFFSET 0x143ef09
|
||||||
#define WX_SNS_HOOK_NEXT_OFFSET 0x12fbc30
|
#define WX_SNS_HOOK_NEXT_OFFSET 0x143f1b0
|
||||||
|
|
||||||
// SyncMgr::addMsgListToDB
|
// SyncMgr::addMsgListToDB
|
||||||
// #define WX_RECV_MSG_HOOK_OFFSET 0xB9C919
|
// #define WX_RECV_MSG_HOOK_OFFSET 0xB9C919
|
||||||
@ -147,9 +147,6 @@ void __cdecl OnRecvMsg(DWORD msg_addr) {
|
|||||||
if (content_len > 0) {
|
if (content_len > 0) {
|
||||||
j_msg["content"] =
|
j_msg["content"] =
|
||||||
unicode_to_utf8((wchar_t *)READ_WSTRING(msg_addr, 0x70).c_str());
|
unicode_to_utf8((wchar_t *)READ_WSTRING(msg_addr, 0x70).c_str());
|
||||||
#ifdef _DEBUG
|
|
||||||
printf("%s", j_msg["content"].get<std::string>().c_str());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
int sign_len = *(DWORD *)(msg_addr + 0x18C);
|
int sign_len = *(DWORD *)(msg_addr + 0x18C);
|
||||||
if (sign_len > 0) {
|
if (sign_len > 0) {
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "wechat_data.h"
|
#include "wechat_data.h"
|
||||||
|
|
||||||
#define WX_PAT_MGR_OFFSET 0x7e91c0
|
#define WX_PAT_MGR_OFFSET 0x8d0c00
|
||||||
#define WX_SEND_PAT_MSG_OFFSET 0x1228510
|
#define WX_SEND_PAT_MSG_OFFSET 0x1228510
|
||||||
#define WX_RET_OFFSET 0x1AE4A45
|
#define WX_RET_OFFSET 0x1C94D34
|
||||||
|
|
||||||
int SendPatMsg(wchar_t* chat_room_id, wchar_t* wxid) {
|
int SendPatMsg(wchar_t* chat_room_id, wchar_t* wxid) {
|
||||||
int success = -1;
|
int success = -1;
|
||||||
|
@ -6,22 +6,22 @@
|
|||||||
#include "wechat_data.h"
|
#include "wechat_data.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define WX_SELF_NAME_OFFSET 0x2C426E8
|
#define WX_SELF_NAME_OFFSET 0x2E2CE48
|
||||||
#define WX_SELF_MOBILE_OFFSET 0x2C42658
|
#define WX_SELF_MOBILE_OFFSET 0x2E2CDB8
|
||||||
#define WX_SELF_CITY_OFFSET 0x2C426B8
|
#define WX_SELF_CITY_OFFSET 0x2E2CE18
|
||||||
#define WX_SELF_PROVINCE_OFFSET 0x2C426A0
|
#define WX_SELF_PROVINCE_OFFSET 0x2E2CE00
|
||||||
#define WX_SELF_COUNTRY_OFFSET 0x2C42688
|
#define WX_SELF_COUNTRY_OFFSET 0x2E2CDE8
|
||||||
#define WX_SELF_ACCOUNT_OFFSET 0x2C42640
|
#define WX_SELF_ACCOUNT_OFFSET 0x2e2d1d0
|
||||||
#define WX_SELF_ID_OFFSET 0x2C42A38
|
#define WX_SELF_ID_OFFSET 0x2E2CD3C
|
||||||
#define WX_SELF_SMALL_IMG_OFFSET 0x2C4289C
|
#define WX_SELF_SMALL_IMG_OFFSET 0x2E2D014
|
||||||
#define WX_SELF_BIG_IMG_OFFSET 0x2C428B4
|
#define WX_SELF_BIG_IMG_OFFSET 0x2E2CFFC
|
||||||
#define WX_LOGIN_STATUS_OFFSET 0x2c42a10
|
#define WX_LOGIN_STATUS_OFFSET 0x2E2D1C0
|
||||||
#define WX_APP_DATA_ROOT_PATH_OFFSET 0x2c84ae0
|
#define WX_APP_DATA_ROOT_PATH_OFFSET 0x2E73010
|
||||||
#define WX_APP_DATA_SAVE_PATH_OFFSET 0x2c65728
|
#define WX_APP_DATA_SAVE_PATH_OFFSET 0x2E52DB0
|
||||||
#define WX_CURRENT_DATA_PATH_OFFSET 0x2c636fc
|
#define WX_CURRENT_DATA_PATH_OFFSET 0x2E4F290
|
||||||
|
|
||||||
#define WX_LOGOUT_OFFSET 0xccc320
|
#define WX_LOGOUT_OFFSET 0xdd5c90
|
||||||
#define WX_ACCOUT_SERVICE_OFFSET 0x65bcc0
|
#define WX_ACCOUT_SERVICE_OFFSET 0x707960
|
||||||
|
|
||||||
int GetSelfInfo(SelfInfoInner &out) {
|
int GetSelfInfo(SelfInfoInner &out) {
|
||||||
DWORD base = GetWeChatWinBase();
|
DWORD base = GetWeChatWinBase();
|
||||||
|
@ -3,16 +3,16 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "wechat_data.h"
|
#include "wechat_data.h"
|
||||||
|
|
||||||
#define WX_APP_MSG_MGR_OFFSET 0x65df50
|
#define WX_APP_MSG_MGR_OFFSET 0x709bb0
|
||||||
#define WX_SEND_FILE_OFFSET 0xa10190
|
#define WX_SEND_FILE_OFFSET 0xb06240
|
||||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
#define WX_INIT_CHAT_MSG_OFFSET 0xed3be0
|
||||||
#define WX_FREE_CHAT_MSG_OFFSET 0x649ac0
|
#define WX_FREE_CHAT_MSG_OFFSET 0x6f4ea0
|
||||||
|
|
||||||
int SendFile(wchar_t *wxid, wchar_t *file_path){
|
int SendFile(wchar_t *wxid, wchar_t *file_path){
|
||||||
int success = 0;
|
int success = 0;
|
||||||
WeChatString to_user(wxid);
|
WeChatString to_user(wxid);
|
||||||
WeChatString path(file_path);
|
WeChatString path(file_path);
|
||||||
char chat_msg[0x2A8] = {0};
|
char chat_msg[0x2C4] = {0};
|
||||||
DWORD base = GetWeChatWinBase();
|
DWORD base = GetWeChatWinBase();
|
||||||
DWORD app_msg_mgr_addr = base + WX_APP_MSG_MGR_OFFSET;
|
DWORD app_msg_mgr_addr = base + WX_APP_MSG_MGR_OFFSET;
|
||||||
DWORD init_chat_msg_addr = base + WX_INIT_CHAT_MSG_OFFSET;
|
DWORD init_chat_msg_addr = base + WX_INIT_CHAT_MSG_OFFSET;
|
||||||
|
@ -3,17 +3,17 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "wechat_data.h"
|
#include "wechat_data.h"
|
||||||
|
|
||||||
#define WX_SEND_IMAGE_OFFSET 0xb6a3f0
|
#define WX_SEND_IMAGE_OFFSET 0xc71500
|
||||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x65b2a0
|
#define WX_SEND_MESSAGE_MGR_OFFSET 0x706d30
|
||||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
#define WX_INIT_CHAT_MSG_OFFSET 0xed3be0
|
||||||
#define WX_FREE_CHAT_MSG_OFFSET 0x649ac0
|
#define WX_FREE_CHAT_MSG_OFFSET 0x6f4ea0
|
||||||
|
|
||||||
int SendImage(wchar_t *wxid, wchar_t *image_path){
|
int SendImage(wchar_t *wxid, wchar_t *image_path){
|
||||||
|
|
||||||
int success = 0;
|
int success = 0;
|
||||||
WeChatString to_user(wxid);
|
WeChatString to_user(wxid);
|
||||||
WeChatString path(image_path);
|
WeChatString path(image_path);
|
||||||
char chat_msg[0x2A8] ={0};
|
char chat_msg[0x2C4] ={0};
|
||||||
DWORD base = GetWeChatWinBase();
|
DWORD base = GetWeChatWinBase();
|
||||||
DWORD send_message_mgr_addr = base + WX_SEND_MESSAGE_MGR_OFFSET;
|
DWORD send_message_mgr_addr = base + WX_SEND_MESSAGE_MGR_OFFSET;
|
||||||
DWORD init_chat_msg_addr = base + WX_INIT_CHAT_MSG_OFFSET;
|
DWORD init_chat_msg_addr = base + WX_INIT_CHAT_MSG_OFFSET;
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "wechat_data.h"
|
#include "wechat_data.h"
|
||||||
|
|
||||||
#define WX_SEND_TEXT_OFFSET 0xb6a930
|
#define WX_SEND_TEXT_OFFSET 0xc71a60
|
||||||
|
|
||||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x65b2a0
|
#define WX_SEND_MESSAGE_MGR_OFFSET 0x706d30
|
||||||
|
|
||||||
#define WX_FREE_CHAT_MSG_OFFSET 0x649ac0
|
#define WX_FREE_CHAT_MSG_OFFSET 0x6f4ea0
|
||||||
/// @brief 发生文本消息
|
/// @brief 发生文本消息
|
||||||
/// @param wxid wxid
|
/// @param wxid wxid
|
||||||
/// @param msg 文本消息
|
/// @param msg 文本消息
|
||||||
@ -19,26 +19,29 @@ int SendText(wchar_t* wxid, wchar_t* msg) {
|
|||||||
WeChatString to_user(wxid);
|
WeChatString to_user(wxid);
|
||||||
WeChatString text_msg(msg);
|
WeChatString text_msg(msg);
|
||||||
wchar_t **msg_pptr = &text_msg.ptr;
|
wchar_t **msg_pptr = &text_msg.ptr;
|
||||||
char chat_msg[0x2A8] ={0};
|
|
||||||
DWORD base = GetWeChatWinBase();
|
DWORD base = GetWeChatWinBase();
|
||||||
DWORD send_message_mgr_addr = base + WX_SEND_MESSAGE_MGR_OFFSET;
|
DWORD send_message_mgr_addr = base + WX_SEND_MESSAGE_MGR_OFFSET;
|
||||||
DWORD send_text_msg_addr = base + WX_SEND_TEXT_OFFSET;
|
DWORD send_text_msg_addr = base + WX_SEND_TEXT_OFFSET;
|
||||||
DWORD free_msg_addr = base + WX_FREE_CHAT_MSG_OFFSET;
|
DWORD free_chat_msg_addr = base + WX_FREE_CHAT_MSG_OFFSET;
|
||||||
|
char chat_msg[0x2C4] ={0};
|
||||||
__asm{
|
__asm{
|
||||||
PUSHAD
|
PUSHAD
|
||||||
|
CALL send_message_mgr_addr
|
||||||
|
PUSH 0x0
|
||||||
PUSH 0x0
|
PUSH 0x0
|
||||||
PUSH 0x0
|
PUSH 0x0
|
||||||
PUSH 0x1
|
PUSH 0x1
|
||||||
PUSH 0x0
|
PUSH 0x0
|
||||||
MOV EDI,msg_pptr
|
MOV EAX,msg_pptr
|
||||||
PUSH EDI
|
PUSH EAX
|
||||||
LEA EDX,to_user
|
LEA EDX,to_user
|
||||||
LEA ECX,chat_msg
|
LEA ECX,chat_msg
|
||||||
CALL send_text_msg_addr
|
CALL send_text_msg_addr
|
||||||
ADD ESP,0x14
|
|
||||||
MOV success,EAX
|
MOV success,EAX
|
||||||
|
ADD ESP,0x18
|
||||||
LEA ECX,chat_msg
|
LEA ECX,chat_msg
|
||||||
CALL free_msg_addr
|
CALL free_chat_msg_addr
|
||||||
POPAD
|
POPAD
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
|
19
src/sns.cc
19
src/sns.cc
@ -4,11 +4,9 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "wechat_data.h"
|
#include "wechat_data.h"
|
||||||
using namespace std;
|
using namespace std;
|
||||||
#define WX_SNS_DATA_MGR_OFFSET 0xac66a0
|
#define WX_SNS_DATA_MGR_OFFSET 0xbc4100
|
||||||
#define WX_SNS_GET_FIRST_PAGE_OFFSET 0x12e46c0
|
#define WX_SNS_GET_FIRST_PAGE_OFFSET 0x1427be0
|
||||||
#define WX_SNS_TIME_LINE_MGR_OFFSET 0x128e6a0
|
#define WX_SNS_GET_NEXT_PAGE_OFFSET 0x1427c80
|
||||||
#define WX_SNS_TRY_GET_FIRST_PAGE_SCENE_OFFSET 0x12ff300
|
|
||||||
#define WX_SNS_GET_NEXT_PAGE_OFFSET 0x12e4760
|
|
||||||
|
|
||||||
int GetFirstPage() {
|
int GetFirstPage() {
|
||||||
int success = -1;
|
int success = -1;
|
||||||
@ -16,8 +14,6 @@ int GetFirstPage() {
|
|||||||
DWORD sns_data_mgr_addr = base + WX_SNS_DATA_MGR_OFFSET;
|
DWORD sns_data_mgr_addr = base + WX_SNS_DATA_MGR_OFFSET;
|
||||||
DWORD get_first_page_addr = base + WX_SNS_GET_FIRST_PAGE_OFFSET;
|
DWORD get_first_page_addr = base + WX_SNS_GET_FIRST_PAGE_OFFSET;
|
||||||
|
|
||||||
DWORD time_line_mgr_addr = base + WX_SNS_TIME_LINE_MGR_OFFSET;
|
|
||||||
DWORD get_first_page_scene_addr = base + WX_SNS_TRY_GET_FIRST_PAGE_SCENE_OFFSET;
|
|
||||||
char buff[0xB44] = {};
|
char buff[0xB44] = {};
|
||||||
__asm {
|
__asm {
|
||||||
PUSHAD
|
PUSHAD
|
||||||
@ -31,15 +27,6 @@ int GetFirstPage() {
|
|||||||
POPAD
|
POPAD
|
||||||
}
|
}
|
||||||
|
|
||||||
// __asm {
|
|
||||||
// PUSHAD
|
|
||||||
// CALL time_line_mgr_addr
|
|
||||||
// PUSH 0x1
|
|
||||||
// MOV ECX,EAX
|
|
||||||
// CALL get_first_page_scene_addr
|
|
||||||
// MOV success, EAX
|
|
||||||
// POPAD
|
|
||||||
// }
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user