Compare commits
9
Commits
3.8.0.41
...
3.8.1.26-V1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c508ae30f8 | ||
|
|
c05e9ce303 | ||
|
|
4758fbf005 | ||
|
|
088a7d28cb | ||
|
|
a9b01eebe1 | ||
|
|
8b68a347a0 | ||
|
|
fd66a641f6 | ||
|
|
ab3780c413 | ||
|
|
e62a37b354 |
@@ -30,3 +30,6 @@
|
||||
#*.exe
|
||||
*.out
|
||||
*.app
|
||||
/out
|
||||
CMakePresets.json
|
||||
.vscode
|
||||
+1
-1
@@ -11,7 +11,7 @@ file(GLOB CPP_FILES ${PROJECT_SOURCE_DIR}/src/*.cc ${PROJECT_SOURCE_DIR}/src/*
|
||||
|
||||
|
||||
|
||||
include_directories(c:/soft/vcpkg/installed/x86-windows/include)
|
||||
include_directories(${VCPKG_INSTALLED_DIR}/x86-windows/include)
|
||||
|
||||
# add_subdirectory(3rd)
|
||||
|
||||
|
||||
@@ -1,31 +1,82 @@
|
||||
# wxhelper
|
||||
wechat hook .
|
||||
wechat hook 。PC端微信逆向学习。支持3.8.0.41,3.8.1.26版本。
|
||||
#### 免责声明:
|
||||
本仓库发布的内容,仅用于学习研究,请勿用于非法用途和商业用途!如因此产生任何法律纠纷,均与作者无关!
|
||||
|
||||
#### 项目说明:
|
||||
本项目是个人学习学习逆向的项目,主要参考https://github.com/ttttupup/ComWeChatRobot,在此基础上实现了wechat 3.8.0.41的版本的部分内容。
|
||||
本项目是个人学习学习逆向的项目,主要参考https://github.com/ttttupup/ComWeChatRobot,在此基础上实现了微信的的其它版本的部分内容。
|
||||
|
||||
#### 使用说明:
|
||||
支持的版本3.8.0.41,目前是最新版本。
|
||||
支持的版本3.8.0.41,3.8.1.26。
|
||||
src:主要的dll代码
|
||||
tool:简单的注入工具,一个是控制台,一个是图形界面。
|
||||
python: 简单的服务器,用以接收消息内容。
|
||||
release:编译好的dll。
|
||||
|
||||
0.首先安装对应的微信版本,主分支是3.8.0.41版本,3.8.1.26分支对应3.8.1.26版本。
|
||||
1.通过cmake构建成功后,将wxhelper.dll注入到微信,本地启动tcp server,监听19088端口。
|
||||
2.通过http协议与dll通信,方便客户端操作。
|
||||
3.接口的url为http://127.0.0.1:19088,注入成功后,直接进行调用即可。
|
||||
4.特别注意数据库查询接口需要先调用获取到句柄之后,才能进行查询。
|
||||
5.相关功能只在win11环境下进行简单测试,其他环境无法保证。
|
||||
6.注意个别接口在3.8.0.41版本没有实现,具体参考源码。
|
||||
|
||||
#### 编译环境
|
||||
|
||||
Visual Studio 2022(x86)
|
||||
Visual Studio code
|
||||
cmake
|
||||
vcpkg
|
||||
Visual Studio 2022(x86)
|
||||
|
||||
Visual Studio code
|
||||
|
||||
cmake
|
||||
|
||||
vcpkg
|
||||
#### 构建步骤
|
||||
以下是在vscode中操作,vs中的操作类似。
|
||||
1.安装vcpkg,cmake,vscode
|
||||
|
||||
2.安装相应的库,如果安装的版本不同,则根据vcpkg安装成功后提示的find_package修改CMakeLists.txt内容即可。或者自己编译。
|
||||
```
|
||||
vcpkg install mongoose
|
||||
vcpkg install nlohmann-json
|
||||
```
|
||||
3.vscode 配置CMakePresets.json,主要设置CMAKE_C_COMPILER 和CMAKE_CXX_COMPILER 为cl.exe.参考如下
|
||||
```
|
||||
{
|
||||
"name": "x86-release",
|
||||
"displayName": "x86-release",
|
||||
"description": "Sets Ninja generator, build and install directory",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/out/build/${presetName}",
|
||||
"architecture":{
|
||||
"value": "x86",
|
||||
"strategy": "external"
|
||||
},
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "cl.exe",
|
||||
"CMAKE_CXX_COMPILER": "cl.exe",
|
||||
"CMAKE_BUILD_TYPE": "Release",
|
||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
|
||||
"CMAKE_TOOLCHAIN_FILE": {
|
||||
"value": "C:/soft/vcpkg/scripts/buildsystems/vcpkg.cmake",
|
||||
"type": "FILEPATH"
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
4.vscode中右键configure all projects,在Terminal中点击Run Task,如没有先配置build任务,然后运行即可
|
||||
|
||||
#### 更新说明
|
||||
2022-12-26 : 增加3.8.1.26版本支持。
|
||||
|
||||
2022-12-29 : 新增提取文字功能。
|
||||
|
||||
2022-01-02 : 退出微信登录。
|
||||
|
||||
2022-01-31 : 新增修改群昵称(仅支持3.8.1.26)。
|
||||
### 接口文档:
|
||||
|
||||
#### 0.检查微信登录**
|
||||
@@ -51,7 +102,6 @@ vcpkg
|
||||
|data|string|响应内容|
|
||||
|
||||
###### 接口示例
|
||||
地址:https://www.bincoding.cn/test
|
||||
入参:
|
||||
``` javascript
|
||||
```
|
||||
@@ -98,7 +148,6 @@ vcpkg
|
||||
|wxid|string|wxid|
|
||||
|
||||
###### 接口示例
|
||||
地址:https://www.bincoding.cn/test
|
||||
入参:
|
||||
``` javascript
|
||||
```
|
||||
@@ -134,7 +183,7 @@ vcpkg
|
||||
|
||||
|
||||
###### 接口示例
|
||||
地址:https://www.bincoding.cn/test
|
||||
|
||||
入参:
|
||||
``` javascript
|
||||
{
|
||||
@@ -453,6 +502,43 @@ vcpkg
|
||||
```
|
||||
|
||||
|
||||
#### 31.修改自身群昵称**
|
||||
###### 接口功能
|
||||
> 增加群成员
|
||||
|
||||
###### 接口地址
|
||||
> [/api/?type=31](/api/?type=31)
|
||||
|
||||
###### HTTP请求方式
|
||||
> POST JSON
|
||||
|
||||
###### 请求参数
|
||||
|参数|必选|类型|说明|
|
||||
|---|---|---|---|
|
||||
|chatRoomId |ture |string| 群id |
|
||||
|wxid |ture |string| 自己的id,只能修改自己的群名片 |
|
||||
|nickName |ture |string| 修改的昵称 |
|
||||
|
||||
###### 返回字段
|
||||
|返回字段|字段类型|说明 |
|
||||
|---|---|---|
|
||||
|code|int|返回状态,1成功, 0失败|
|
||||
|result|string|成功提示|
|
||||
|
||||
|
||||
###### 接口示例
|
||||
入参:
|
||||
``` javascript
|
||||
{
|
||||
"chatRoomId":"34932563384@chatroom",
|
||||
"wxid":"wxid_272211111121112",
|
||||
"nickName":"昵称test"
|
||||
}
|
||||
```
|
||||
响应:
|
||||
``` javascript
|
||||
{"code":1,"result":"OK"}
|
||||
```
|
||||
|
||||
|
||||
|
||||
@@ -556,6 +642,43 @@ vcpkg
|
||||
|
||||
|
||||
|
||||
#### 44.退出登录**
|
||||
###### 接口功能
|
||||
> 退出登录微信,相当于直接退出微信,跟手动退出比,少了重新打开登录的一步,dll注入后也会随微信关闭而关闭。调用后不能再继续操作dll。
|
||||
|
||||
###### 接口地址
|
||||
> [/api/?type=44](/api/?type=44)
|
||||
|
||||
###### HTTP请求方式
|
||||
> POST JSON
|
||||
|
||||
###### 请求参数
|
||||
|参数|必选|类型|说明|
|
||||
|---|---|---|---|
|
||||
|
||||
|
||||
|
||||
###### 返回字段
|
||||
|返回字段|字段类型|说明 |
|
||||
|---|---|---|
|
||||
|code|int|返回状态,非0成功|
|
||||
|result|string|成功提示|
|
||||
|
||||
|
||||
|
||||
|
||||
###### 接口示例
|
||||
入参:
|
||||
``` javascript
|
||||
|
||||
```
|
||||
响应:
|
||||
``` javascript
|
||||
{"code":4344,"result":"OK"}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 46.联系人列表**
|
||||
###### 接口功能
|
||||
> 联系人列表
|
||||
@@ -682,7 +805,47 @@ vcpkg
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 49.提取文字**
|
||||
###### 接口功能
|
||||
> 提取图片中的文字
|
||||
|
||||
###### 接口地址
|
||||
> [/api/?type=49](/api/?type=49)
|
||||
|
||||
###### HTTP请求方式
|
||||
> POST JSON
|
||||
|
||||
###### 请求参数
|
||||
|参数|必选|类型|说明|
|
||||
|---|---|---|---|
|
||||
|imagePath |ture |string| 图片路径 |
|
||||
|
||||
###### 返回字段
|
||||
|返回字段|字段类型|说明 |
|
||||
|---|---|---|
|
||||
|code|int|返回状态,0成功, -1失败,1 2 则是缓存或者正在进行中需再调用一次|
|
||||
|result|string|成功提示|
|
||||
|text|string|提取的相应文字|
|
||||
|
||||
|
||||
###### 接口示例
|
||||
入参:
|
||||
``` javascript
|
||||
{
|
||||
"imagePath":"C:\\3a610d7bc1cf5a15d12225a64b8962.dat"
|
||||
}
|
||||
|
||||
```
|
||||
响应:
|
||||
``` javascript
|
||||
{"code":0,"result":"OK","text":"搜索商品新闻简报小程序上线啦!!!我的收藏地址管理促销单品多买多省热门榜单热门榜单首发新品精品推荐精品推荐首发新品FRONTI警微安奈儿 童装冬季款男¥39900¥59.90帕拉丁品牌 时尚双背包409 00¥49.90我是有底线的首页分类购物车我的"}
|
||||
```
|
||||
|
||||
|
||||
#### 感谢
|
||||
https://github.com/ljc545w/ComWeChatRobot
|
||||
https://github.com/NationalSecurityAgency/ghidra
|
||||
https://github.com/x64dbg/x64dbg
|
||||
https://github.com/ljc545w/ComWeChatRobot
|
||||
|
||||
https://github.com/NationalSecurityAgency/ghidra
|
||||
|
||||
https://github.com/x64dbg/x64dbg
|
||||
|
||||
Binary file not shown.
+19
@@ -18,6 +18,7 @@
|
||||
#include "chat_room.h"
|
||||
#include "self_info.h"
|
||||
#include "hook_img.h"
|
||||
#include "ocr.h"
|
||||
|
||||
#pragma comment(lib, "ws2_32.lib")
|
||||
using namespace std;
|
||||
@@ -380,6 +381,12 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
|
||||
break;
|
||||
}
|
||||
case WECHAT_CHATROOM_SET_SELF_NICKNAME: {
|
||||
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 nick = get_http_req_param(hm, j_param, "nickName", is_post);
|
||||
int success = ModChatRoomMemberNickName(WS2LW(room_id),WS2LW(wxid),WS2LW(nick));
|
||||
json ret_data = {{"code", success}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
case WECHAT_DATABASE_GET_HANDLES: {
|
||||
@@ -460,6 +467,9 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
|
||||
break;
|
||||
}
|
||||
case WECHAT_LOGOUT: {
|
||||
int success = Logout();
|
||||
json ret_data = {{"code", success}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
case WECHAT_GET_TRANSFER: {
|
||||
@@ -535,6 +545,15 @@ void api_handle(mg_http_message *hm, struct mg_connection *c, string &ret) {
|
||||
int success = GetImgByName(WS2LW(image_path),WS2LW(save_path));
|
||||
json ret_data = {{"code", success}, {"result", "OK"}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
case WECHAT_DO_OCR:{
|
||||
wstring image_path = get_http_req_param(hm, j_param, "imagePath", is_post);
|
||||
string text("");
|
||||
int success = DoOCRTask(WS2LW(image_path),text);
|
||||
json ret_data = {{"code", success}, {"result", "OK"},{"text",text}};
|
||||
ret = ret_data.dump();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -63,6 +63,7 @@ typedef enum WECHAT_HTTP_APISTag
|
||||
WECHAT_GET_CONTACT_ALL,
|
||||
WECHAT_GET_CHATROOM_INFO,
|
||||
WECHAT_GET_IMG_BY_NAME,
|
||||
WECHAT_DO_OCR,
|
||||
} WECHAT_HTTP_APIS,
|
||||
*PWECHAT_HTTP_APIS;
|
||||
|
||||
|
||||
+49
-13
@@ -4,17 +4,18 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "wechat_data.h"
|
||||
#define WX_CHAT_ROOM_MGR_OFFSET 0x686e40
|
||||
#define WX_GET_CHAT_ROOM_DETAIL_INFO_OFFSET 0xa70920
|
||||
#define WX_NEW_CHAT_ROOM_INFO_OFFSET 0xd03ec0
|
||||
#define WX_FREE_CHAT_ROOM_INFO_OFFSET 0x7226e0
|
||||
#define WX_DEL_CHAT_ROOM_MEMBER_OFFSET 0xa668f0
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbcc40
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x651c40
|
||||
#define WX_ADD_MEMBER_TO_CHAT_ROOM_OFFSET 0xa66400
|
||||
#define WX_GET_MEMBER_FROM_CHAT_ROOM_OFFSET 0xa71650
|
||||
#define WX_INIT_CHAT_ROOM_OFFSET 0xd01c30
|
||||
#define WX_FREE_CHAT_ROOM_OFFSET 0xa79310
|
||||
#define WX_CHAT_ROOM_MGR_OFFSET 0x67ee70
|
||||
#define WX_GET_CHAT_ROOM_DETAIL_INFO_OFFSET 0xa73a80
|
||||
#define WX_NEW_CHAT_ROOM_INFO_OFFSET 0xd07010
|
||||
#define WX_FREE_CHAT_ROOM_INFO_OFFSET 0xd072f0
|
||||
#define WX_DEL_CHAT_ROOM_MEMBER_OFFSET 0xa69a50
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x649ac0
|
||||
#define WX_ADD_MEMBER_TO_CHAT_ROOM_OFFSET 0xa69560
|
||||
#define WX_GET_MEMBER_FROM_CHAT_ROOM_OFFSET 0xa749b0
|
||||
#define WX_INIT_CHAT_ROOM_OFFSET 0xd04d80
|
||||
#define WX_FREE_CHAT_ROOM_OFFSET 0xa7c620
|
||||
#define WX_MOD_CHAT_ROOM_MEMBER_NICK_NAME_OFFSET 0xa6f8f0
|
||||
|
||||
int GetChatRoomDetailInfo(wchar_t* chat_room_id, ChatRoomInfoInner& room_info) {
|
||||
int success = 0;
|
||||
@@ -24,7 +25,7 @@ int GetChatRoomDetailInfo(wchar_t* chat_room_id, ChatRoomInfoInner& room_info) {
|
||||
DWORD get_chat_room_detail_addr = base + WX_GET_CHAT_ROOM_DETAIL_INFO_OFFSET;
|
||||
DWORD create_chat_room_info_addr = base + WX_NEW_CHAT_ROOM_INFO_OFFSET;
|
||||
DWORD free_chat_room_info_addr = base + WX_FREE_CHAT_ROOM_INFO_OFFSET;
|
||||
char chat_room_info[0xA4] = {0};
|
||||
char chat_room_info[0xDC] = {0};
|
||||
__asm {
|
||||
PUSHAD
|
||||
LEA ECX,chat_room_info
|
||||
@@ -144,7 +145,7 @@ int GetMemberFromChatRoom(wchar_t* chat_room_id,ChatRoomInner & out){
|
||||
int success = 0;
|
||||
WeChatString chat_room(chat_room_id);
|
||||
DWORD chat_room_ptr = (DWORD) &chat_room;
|
||||
char buffer[0x1A0] = {0};
|
||||
char buffer[0x1D4] = {0};
|
||||
DWORD base = GetWeChatWinBase();
|
||||
DWORD get_member_addr = base + WX_GET_MEMBER_FROM_CHAT_ROOM_OFFSET;
|
||||
DWORD get_chat_room_mgr_addr = base + WX_CHAT_ROOM_MGR_OFFSET;
|
||||
@@ -182,3 +183,38 @@ int GetMemberFromChatRoom(wchar_t* chat_room_id,ChatRoomInner & out){
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
int ModChatRoomMemberNickName(wchar_t* chat_room_id,wchar_t* wxid,wchar_t * nick){
|
||||
int success = 0;
|
||||
WeChatString chat_room(chat_room_id);
|
||||
WeChatString self_wxid(wxid);
|
||||
WeChatString new_nick(nick);
|
||||
DWORD base = GetWeChatWinBase();
|
||||
DWORD get_chat_room_mgr_addr = base + WX_CHAT_ROOM_MGR_OFFSET;
|
||||
DWORD mod_member_nick_name_addr = base + WX_MOD_CHAT_ROOM_MEMBER_NICK_NAME_OFFSET;
|
||||
DWORD init_chat_msg_addr = base + WX_INIT_CHAT_MSG_OFFSET;
|
||||
__asm{
|
||||
PUSHAD
|
||||
CALL get_chat_room_mgr_addr
|
||||
SUB ESP,0x14
|
||||
MOV ECX,ESP
|
||||
LEA EDI,new_nick
|
||||
PUSH EDI
|
||||
CALL init_chat_msg_addr
|
||||
SUB ESP,0x14
|
||||
LEA EAX,self_wxid
|
||||
MOV ECX,ESP
|
||||
PUSH EAX
|
||||
CALL init_chat_msg_addr
|
||||
SUB ESP,0x14
|
||||
LEA EAX,chat_room
|
||||
MOV ECX,ESP
|
||||
PUSH EAX
|
||||
CALL init_chat_msg_addr
|
||||
CALL mod_member_nick_name_addr
|
||||
MOVZX EAX,AL
|
||||
MOV success,EAX
|
||||
POPAD
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -7,4 +7,5 @@ int DelMemberFromChatRoom(wchar_t* chat_room_id,wchar_t** wxids,int len);
|
||||
int AddMemberToChatRoom(wchar_t* chat_room_id, wchar_t** wxids,int len);
|
||||
|
||||
int GetMemberFromChatRoom(wchar_t* chat_room_id,ChatRoomInner & out);
|
||||
int ModChatRoomMemberNickName(wchar_t* chat_room_id,wchar_t* wxid,wchar_t * nick);
|
||||
#endif
|
||||
+6
-10
@@ -4,15 +4,11 @@
|
||||
#include "common.h"
|
||||
#include "wechat_data.h"
|
||||
|
||||
#define WX_CONTACT_MGR_INSTANCE_OFFSET 0x655d60
|
||||
#define WX_CONTACT_GET_LIST_OFFSET 0xa97da0
|
||||
#define WX_CONTACT_DEL_OFFSET 0xa9bd10
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbcc40
|
||||
#define WX_DB_QUERY_OFFSET 0xa9ba20
|
||||
#define WX_SYNC_MGR_OFFSET 0x993fa0
|
||||
#define WX_SYNC_MGR_OFFSET 0x993fa0
|
||||
#define WX_DO_DEL_CONTACT_OFFSET 0xb9a750
|
||||
#define WX_DEL_CONTACT_VTABLE_OFFSET 0x2886990
|
||||
#define WX_CONTACT_MGR_INSTANCE_OFFSET 0x64dc30
|
||||
#define WX_CONTACT_GET_LIST_OFFSET 0xa9b000
|
||||
#define WX_CONTACT_DEL_OFFSET 0xa9ef40
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
||||
#define WX_DB_QUERY_OFFSET 0xa9ec40
|
||||
int GetAllContact(vector<Contact> &vec) {
|
||||
DWORD base = GetWeChatWinBase();
|
||||
DWORD get_instance = base + WX_CONTACT_MGR_INSTANCE_OFFSET;
|
||||
@@ -66,7 +62,7 @@ int GetAllContact(vector<Contact> &vec) {
|
||||
temp.type = *(DWORD *)(start + 0x50);
|
||||
temp.verify_flag = *(DWORD *)(start + 0x54);
|
||||
vec.push_back(temp);
|
||||
start += 0x3E8;
|
||||
start += 0x438;
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
+4
-4
@@ -4,8 +4,8 @@
|
||||
#include "common.h"
|
||||
#include "get_db_handle.h"
|
||||
#include "wechat_data.h"
|
||||
#define WX_FORWARD_MSG_OFFSET 0xb68c80
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbcc40
|
||||
#define WX_FORWARD_MSG_OFFSET 0xb6a4e0
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
||||
|
||||
int ForwardMsg(wchar_t *wxid, unsigned long long msgid) {
|
||||
int success = 0;
|
||||
@@ -27,11 +27,11 @@ int ForwardMsg(wchar_t *wxid, unsigned long long msgid) {
|
||||
PUSH EAX
|
||||
SUB ESP,0x14
|
||||
MOV ECX,ESP
|
||||
LEA ESI, to_user;
|
||||
LEA ESI,to_user
|
||||
PUSH ESI
|
||||
CALL init_chat_msg_addr
|
||||
CALL forward_msg_addr
|
||||
MOVZX EAX,AL;
|
||||
MOVZX EAX,AL
|
||||
MOV success,EAX
|
||||
ADD ESP,0x1c
|
||||
POPFD
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "new_sqlite3.h"
|
||||
#include "pch.h"
|
||||
#include "wechat_data.h"
|
||||
#define CONTACT_G_PINSTANCE 0x2bee928
|
||||
#define CONTACT_G_PINSTANCE 0x2c42e78
|
||||
#define DB_MICRO_MSG_OFFSET 0x68
|
||||
#define DB_CHAT_MSG_OFFSET 0x1C0
|
||||
#define DB_MISC_OFFSET 0x3D8
|
||||
@@ -15,10 +15,10 @@
|
||||
#define DB_FUNCTION_MSG_OFFSET 0x11B0
|
||||
#define DB_NAME_OFFSET 0x14
|
||||
|
||||
#define PUBLIC_MSG_MGR_OFFSET 0x2c294c0
|
||||
#define MULTI_DB_MSG_MGR_OFFSET 0x2c2aff4
|
||||
#define FAVORITE_STORAGE_MGR_OFFSET 0x2c2aa14
|
||||
#define FTS_FAVORITE_MGR_OFFSET 0x2bef468
|
||||
#define PUBLIC_MSG_MGR_OFFSET 0x2c7ec88
|
||||
#define MULTI_DB_MSG_MGR_OFFSET 0x2c807d0
|
||||
#define FAVORITE_STORAGE_MGR_OFFSET 0x2c801f8
|
||||
#define FTS_FAVORITE_MGR_OFFSET 0x2c439b8
|
||||
|
||||
using namespace std;
|
||||
map<wstring, DatabaseInfo> dbmap;
|
||||
|
||||
+3
-3
@@ -6,9 +6,9 @@
|
||||
|
||||
// #define WX_HOOK_IMG_OFFSET 0xd7eaa5
|
||||
// #define WX_HOOK_IMG_NEXT_OFFSET 0xda56e0
|
||||
#define WX_HOOK_IMG_OFFSET 0xc63ebc
|
||||
#define WX_HOOK_IMG_NEXT_OFFSET 0xd7e9e0
|
||||
#define WX_SELF_ID_OFFSET 0x2BEE08C
|
||||
#define WX_HOOK_IMG_OFFSET 0xc672cc
|
||||
#define WX_HOOK_IMG_NEXT_OFFSET 0xd82370
|
||||
#define WX_SELF_ID_OFFSET 0x2C42A38
|
||||
#define BUFSIZE 1024
|
||||
|
||||
#define JPEG0 0xFF
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
using namespace nlohmann;
|
||||
|
||||
using namespace std;
|
||||
#define WX_RECV_MSG_HOOK_OFFSET 0xb94796
|
||||
#define WX_RECV_MSG_HOOK_NEXT_OFFSET 0x6fe2c0
|
||||
#define WX_RECV_MSG_HOOK_OFFSET 0xb97126
|
||||
#define WX_RECV_MSG_HOOK_NEXT_OFFSET 0x6fc850
|
||||
|
||||
// SyncMgr::addMsgListToDB
|
||||
// #define WX_RECV_MSG_HOOK_OFFSET 0xB9C919
|
||||
|
||||
+18
-18
@@ -135,24 +135,24 @@
|
||||
#define SQLITE_NULL 5
|
||||
#define SQLITE_TEXT 3
|
||||
|
||||
#define SQLITE3_EXEC_OFFSET 0x1b623b0
|
||||
#define SQLITE3_BACKUP_INIT_OFFSET 0x1b27d50
|
||||
#define SQLITE3_PREPARE_OFFSET 0x1b68d00
|
||||
#define SQLITE3_OPEN_OFFSET 0x1b96cf0
|
||||
#define SQLITE3_BACKUP_STEP_OFFSET 0x1b28150
|
||||
#define SQLITE3_BACKUP_REMAINING_OFFSET 0x1b28890
|
||||
#define SQLITE3_BACKUP_PAGECOUNT_OFFSET 0x1b288a0
|
||||
#define SQLITE3_BACKUP_FINISH_OFFSET 0x1b28790
|
||||
#define SQLITE3_SLEEP_OFFSET 0x1b97530
|
||||
#define SQLITE3_ERRCODE_OFFSET 0x1b95990
|
||||
#define SQLITE3_CLOSE_OFFSET 0x1b94110
|
||||
#define SQLITE3_STEP_OFFSET 0x1b30bc0
|
||||
#define SQLITE3_COLUMN_COUNT_OFFSET 0x1b310d0
|
||||
#define SQLITE3_COLUMN_NAME_OFFSET 0x1b319c0
|
||||
#define SQLITE3_COLUMN_TYPE_OFFSET 0x1b31860
|
||||
#define SQLITE3_COLUMN_BLOB_OFFSET 0x1b31110
|
||||
#define SQLITE3_COLUMN_BYTES_OFFSET 0x1b311f0
|
||||
#define SQLITE3_FINALIZE_OFFSET 0x1b2fb90
|
||||
#define SQLITE3_EXEC_OFFSET 0x1ba9de0
|
||||
#define SQLITE3_BACKUP_INIT_OFFSET 0x1b6f760
|
||||
#define SQLITE3_PREPARE_OFFSET 0x1bb0730
|
||||
#define SQLITE3_OPEN_OFFSET 0x1bde730
|
||||
#define SQLITE3_BACKUP_STEP_OFFSET 0x1b6fb60
|
||||
#define SQLITE3_BACKUP_REMAINING_OFFSET 0x1b702a0
|
||||
#define SQLITE3_BACKUP_PAGECOUNT_OFFSET 0x1b702b0
|
||||
#define SQLITE3_BACKUP_FINISH_OFFSET 0x1b701a0
|
||||
#define SQLITE3_SLEEP_OFFSET 0x1bdef70
|
||||
#define SQLITE3_ERRCODE_OFFSET 0x1bdd3d0
|
||||
#define SQLITE3_CLOSE_OFFSET 0x1bdbb20
|
||||
#define SQLITE3_STEP_OFFSET 0x1b785d0
|
||||
#define SQLITE3_COLUMN_COUNT_OFFSET 0x1b78ae0
|
||||
#define SQLITE3_COLUMN_NAME_OFFSET 0x1b793d0
|
||||
#define SQLITE3_COLUMN_TYPE_OFFSET 0x1b79270
|
||||
#define SQLITE3_COLUMN_BLOB_OFFSET 0x1b78b20
|
||||
#define SQLITE3_COLUMN_BYTES_OFFSET 0x1b78c00
|
||||
#define SQLITE3_FINALIZE_OFFSET 0x1b775a0
|
||||
|
||||
typedef int (*Sqlite3_callback)(void*, int, char**, char**);
|
||||
|
||||
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
#include "pch.h"
|
||||
#include "ocr.h"
|
||||
|
||||
#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
|
||||
|
||||
int DoOCRTask(wchar_t *img_path, std::string &result) {
|
||||
int success = -1;
|
||||
WeChatString path(img_path);
|
||||
WeChatString null_obj = {0};
|
||||
WeChatString ocr_result = {0};
|
||||
DWORD base = GetWeChatWinBase();
|
||||
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;
|
||||
__asm {
|
||||
PUSHAD
|
||||
PUSHFD
|
||||
LEA ECX,ocr_result
|
||||
CALL init_addr
|
||||
CALL ocr_manager_addr
|
||||
LEA ECX,null_obj
|
||||
PUSH ECX
|
||||
LEA ECX,ocr_result
|
||||
PUSH ECX
|
||||
PUSH ECX
|
||||
LEA ECX,path
|
||||
PUSH ECX
|
||||
MOV ECX,EAX
|
||||
CALL do_ocr_task_addr
|
||||
MOV success,EAX
|
||||
POPFD
|
||||
POPAD
|
||||
}
|
||||
|
||||
if (success == 0) {
|
||||
DWORD addr = (DWORD)&ocr_result;
|
||||
DWORD ptr = *(DWORD *)addr;
|
||||
DWORD num = *(DWORD *)(addr + 0x4);
|
||||
if (num <= 0) {
|
||||
return success;
|
||||
}
|
||||
|
||||
DWORD header = *(DWORD *)ptr;
|
||||
for (unsigned int i = 0; i < num -1; i++) {
|
||||
DWORD content = *(DWORD *)header;
|
||||
result += unicode_to_utf8((wchar_t *)READ_WSTRING(content, 0x14).c_str());
|
||||
|
||||
header = content;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
cout << "num:" << num << endl;
|
||||
cout << "all:" << result << endl;
|
||||
#endif
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
#ifndef OCR_H_
|
||||
#define OCR_H_
|
||||
#include <string>
|
||||
int DoOCRTask(wchar_t* img_path,std::string &result);
|
||||
#endif
|
||||
+36
-14
@@ -5,21 +5,22 @@
|
||||
|
||||
#include "wechat_data.h"
|
||||
|
||||
#define WX_SELF_NAME_OFFSET 0x2bee198
|
||||
#define WX_SELF_MOBILE_OFFSET 0x2BEE108
|
||||
#define WX_SELF_CITY_OFFSET 0x2BEE168
|
||||
#define WX_SELF_PROVINCE_OFFSET 0x2BEE150
|
||||
#define WX_SELF_COUNTRY_OFFSET 0x2BEE138
|
||||
#define WX_SELF_ACCOUNT_OFFSET 0x2BEE0F0
|
||||
#define WX_SELF_ID_OFFSET 0x2BEE08C
|
||||
#define WX_SELF_SMALL_IMG_OFFSET 0x2BEE34C
|
||||
#define WX_SELF_BIG_IMG_OFFSET 0x2BEE364
|
||||
#define WX_LOGIN_STATUS_OFFSET 0x2BEE4C0
|
||||
#define WX_APP_DATA_ROOT_PATH_OFFSET 0x2c2f478
|
||||
#define WX_APP_DATA_SAVE_PATH_OFFSET 0x2C10D04
|
||||
#define WX_CURRENT_DATA_PATH_OFFSET 0x2C0EC38
|
||||
|
||||
#define WX_SELF_NAME_OFFSET 0x2C426E8
|
||||
#define WX_SELF_MOBILE_OFFSET 0x2C42658
|
||||
#define WX_SELF_CITY_OFFSET 0x2C426B8
|
||||
#define WX_SELF_PROVINCE_OFFSET 0x2C426A0
|
||||
#define WX_SELF_COUNTRY_OFFSET 0x2C42688
|
||||
#define WX_SELF_ACCOUNT_OFFSET 0x2C42640
|
||||
#define WX_SELF_ID_OFFSET 0x2C42A38
|
||||
#define WX_SELF_SMALL_IMG_OFFSET 0x2C4289C
|
||||
#define WX_SELF_BIG_IMG_OFFSET 0x2C428B4
|
||||
#define WX_LOGIN_STATUS_OFFSET 0x2c42a10
|
||||
#define WX_APP_DATA_ROOT_PATH_OFFSET 0x2c84ae0
|
||||
#define WX_APP_DATA_SAVE_PATH_OFFSET 0x2c65728
|
||||
#define WX_CURRENT_DATA_PATH_OFFSET 0x2c636fc
|
||||
|
||||
#define WX_LOGOUT_OFFSET 0xccc320
|
||||
#define WX_ACCOUT_SERVICE_OFFSET 0x65bcc0
|
||||
|
||||
int GetSelfInfo(SelfInfoInner &out) {
|
||||
DWORD base = GetWeChatWinBase();
|
||||
@@ -136,4 +137,25 @@ int GetSelfInfo(SelfInfoInner &out) {
|
||||
int CheckLogin(){
|
||||
DWORD base = GetWeChatWinBase();
|
||||
return *(DWORD*) (base + WX_LOGIN_STATUS_OFFSET);
|
||||
}
|
||||
|
||||
|
||||
int Logout(){
|
||||
int success = 0;
|
||||
if(!CheckLogin()){
|
||||
return success;
|
||||
}
|
||||
DWORD base = GetWeChatWinBase();
|
||||
DWORD account_service_addr = base + WX_ACCOUT_SERVICE_OFFSET;
|
||||
DWORD logout_addr = base + WX_LOGOUT_OFFSET;
|
||||
__asm{
|
||||
PUSHAD
|
||||
CALL account_service_addr
|
||||
PUSH 0x0
|
||||
MOV ECX,EAX
|
||||
CALL logout_addr
|
||||
MOV success,EAX
|
||||
POPAD
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@@ -4,4 +4,6 @@
|
||||
int GetSelfInfo(SelfInfoInner& out);
|
||||
|
||||
int CheckLogin();
|
||||
|
||||
int Logout();
|
||||
#endif
|
||||
+4
-4
@@ -3,10 +3,10 @@
|
||||
#include "common.h"
|
||||
#include "wechat_data.h"
|
||||
|
||||
#define WX_APP_MSG_MGR_OFFSET 0x665f60
|
||||
#define WX_SEND_FILE_OFFSET 0xa0ce20
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbcc40
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x651c40
|
||||
#define WX_APP_MSG_MGR_OFFSET 0x65df50
|
||||
#define WX_SEND_FILE_OFFSET 0xa10190
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x649ac0
|
||||
|
||||
int SendFile(wchar_t *wxid, wchar_t *file_path){
|
||||
int success = 0;
|
||||
|
||||
+4
-4
@@ -3,10 +3,10 @@
|
||||
#include "common.h"
|
||||
#include "wechat_data.h"
|
||||
|
||||
#define WX_SEND_IMAGE_OFFSET 0xb68b90
|
||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x663320
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbcc40
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x651c40
|
||||
#define WX_SEND_IMAGE_OFFSET 0xb6a3f0
|
||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x65b2a0
|
||||
#define WX_INIT_CHAT_MSG_OFFSET 0xdbf380
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x649ac0
|
||||
|
||||
int SendImage(wchar_t *wxid, wchar_t *image_path){
|
||||
|
||||
|
||||
+3
-3
@@ -5,11 +5,11 @@
|
||||
#include "common.h"
|
||||
#include "wechat_data.h"
|
||||
|
||||
#define WX_SEND_TEXT_OFFSET 0xb690a0
|
||||
#define WX_SEND_TEXT_OFFSET 0xb6a930
|
||||
|
||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x663320
|
||||
#define WX_SEND_MESSAGE_MGR_OFFSET 0x65b2a0
|
||||
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x651c40
|
||||
#define WX_FREE_CHAT_MSG_OFFSET 0x649ac0
|
||||
/// @brief 发生文本消息
|
||||
/// @param wxid wxid
|
||||
/// @param msg 文本消息
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user