mirror of
https://github.com/ttttupup/wxhelper.git
synced 2025-04-20 03:49:17 +08:00
Compare commits
45 Commits
3.9.5.81-v
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
24bb7212fa | ||
|
1528b66b94 | ||
|
62a641d7f7 | ||
|
49188b7ef0 | ||
|
e4656e5139 | ||
|
0bd8b47da0 | ||
|
7a5a8a90df | ||
|
b5cc83be77 | ||
|
3b5f191bf2 | ||
|
dff024745c | ||
|
8b6e2d7160 | ||
|
5d7c1d1d48 | ||
|
d574af863a | ||
|
632d4222fa | ||
|
ee7d4ee9a3 | ||
|
1ba2ed87b7 | ||
|
2863f8258f | ||
|
fa31de81e0 | ||
|
758b773d99 | ||
|
b17af7a9e0 | ||
|
b364885daf | ||
|
427b43304c | ||
|
0593dbe79e | ||
|
13f182a95b | ||
|
1718ddefdd | ||
|
4c3c02283e | ||
|
bb46b9b8d9 | ||
|
e806914775 | ||
|
e5ead96c05 | ||
|
938e7e9bc2 | ||
|
8acad316a9 | ||
|
a5a2f0f17d | ||
|
3b76b2332c | ||
|
5088f5171b | ||
|
d8c8078f5c | ||
|
8bdc8c7e46 | ||
|
212613e3b6 | ||
|
2f6760e28e | ||
|
41b3b6b18d | ||
|
e6e72dd492 | ||
|
f9b859baca | ||
|
4ab28cfc03 | ||
|
e6c57f8ede | ||
|
51a4693330 | ||
|
e0c946bf72 |
146
doc/3.9.5.81.md
146
doc/3.9.5.81.md
@ -1680,4 +1680,150 @@ enableHttp=0时,使用ip,port的tcp服务回传消息。
|
|||||||
"data": {},
|
"data": {},
|
||||||
"msg": "success"
|
"msg": "success"
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### 34.发送小程序**
|
||||||
|
###### 接口功能
|
||||||
|
> 发送小程序(待完善,不稳定),相关参数可以参考示例的滴滴小程序的内容自行组装。
|
||||||
|
|
||||||
|
###### 接口地址
|
||||||
|
> [/api/sendApplet](/api/sendApplet)
|
||||||
|
|
||||||
|
###### HTTP请求方式
|
||||||
|
> POST JSON
|
||||||
|
|
||||||
|
###### 请求参数
|
||||||
|
|参数|必选|类型|说明|
|
||||||
|
|---|---|---|---|
|
||||||
|
|wxid|string|接收人wxid|
|
||||||
|
|waidConcat|string|app的wxid与回调信息之类绑定的拼接字符串,伪造的数据可以随意|
|
||||||
|
|appletWxid|string|app的wxid|
|
||||||
|
|jsonParam|string|相关参数|
|
||||||
|
|headImgUrl|string|头像url|
|
||||||
|
|mainImg|string|主图的本地路径,需要在小程序的临时目录下|
|
||||||
|
|indexPage|string|小程序的跳转页面|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###### 返回字段
|
||||||
|
|返回字段|字段类型|说明 |
|
||||||
|
|---|---|---|
|
||||||
|
|code|int|返回状态,大于0成功, -1失败|
|
||||||
|
|msg|string|成功提示|
|
||||||
|
|data|object|null|
|
||||||
|
|
||||||
|
###### 接口示例
|
||||||
|
|
||||||
|
入参:
|
||||||
|
``` javascript
|
||||||
|
|
||||||
|
{
|
||||||
|
"wxid":"filehelper",
|
||||||
|
"waidConcat":"wxaf35009675aa0b2a_118",
|
||||||
|
"waid":"wxaf35009675aa0b2a",
|
||||||
|
"appletWxid":"gh_7a5c4141778f@app",
|
||||||
|
"jsonParam":"{\"current_path\":\"home/pages/index.html\",\"current_title\":\"\",\"image_url\":\"https://ut-static.udache.com/webx/mini-pics/U7mDFxU2yh-2-r1BJ-J0X.png\",\"scene\":1001,\"scene_note\":\"\",\"sessionId\":\"SessionId@1672284921_1#1692848476899\"}",
|
||||||
|
"headImgUrl":"http://mmbiz.qpic.cn/sz_mmbiz_png/9n47wQlh4dH8afD9dQ9uQicibRm5mYz3lawXCLMjmnzFicribH51qsFYxjzPEcTGHGmgX4lkAkQ3jznia8UDEtqsX1w/640?wx_fmt=png&wxfrom=200",
|
||||||
|
"mainImg":"C:\\wxid_123123\\Applet\\wxaf35009675aa0b2a\\temp\\2.png",
|
||||||
|
"indexPage":"pages/index/index.html"
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
响应:
|
||||||
|
``` javascript
|
||||||
|
{
|
||||||
|
"code": 1,
|
||||||
|
"data": {},
|
||||||
|
"msg": "success"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### 35.拍一拍**
|
||||||
|
###### 接口功能
|
||||||
|
> 拍一拍
|
||||||
|
|
||||||
|
###### 接口地址
|
||||||
|
> [/api/sendPatMsg](/api/sendPatMsg)
|
||||||
|
|
||||||
|
###### HTTP请求方式
|
||||||
|
> POST JSON
|
||||||
|
|
||||||
|
###### 请求参数
|
||||||
|
|参数|必选|类型|说明|
|
||||||
|
|---|---|---|---|
|
||||||
|
|wxid|string|被拍人id|
|
||||||
|
|receiver|string|接收人id,可以是自己wxid,私聊好友wxid,群id|
|
||||||
|
|
||||||
|
|
||||||
|
###### 返回字段
|
||||||
|
|返回字段|字段类型|说明 |
|
||||||
|
|---|---|---|
|
||||||
|
|code|int|返回状态,大于0成功, -1失败|
|
||||||
|
|msg|string|成功提示|
|
||||||
|
|data|object|null|
|
||||||
|
|
||||||
|
###### 接口示例
|
||||||
|
|
||||||
|
入参:
|
||||||
|
``` javascript
|
||||||
|
|
||||||
|
{
|
||||||
|
"wxid":"wxid_1234",
|
||||||
|
"receiver":"wxid_1234",
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
```
|
||||||
|
响应:
|
||||||
|
``` javascript
|
||||||
|
{
|
||||||
|
"code": 1,
|
||||||
|
"data": {},
|
||||||
|
"msg": "success"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
#### 36.OCR**
|
||||||
|
###### 接口功能
|
||||||
|
> OCR识别文字,非0时再调用一次,一般需要调用2次
|
||||||
|
|
||||||
|
###### 接口地址
|
||||||
|
> [/api/ocr](/api/ocr)
|
||||||
|
|
||||||
|
###### HTTP请求方式
|
||||||
|
> POST JSON
|
||||||
|
|
||||||
|
###### 请求参数
|
||||||
|
|参数|必选|类型|说明|
|
||||||
|
|---|---|---|---|
|
||||||
|
|imagePath|string|图片全路径|
|
||||||
|
|
||||||
|
|
||||||
|
###### 返回字段
|
||||||
|
|返回字段|字段类型|说明 |
|
||||||
|
|---|---|---|
|
||||||
|
|code|int|返回状态,0成功, 非0时再调用一次|
|
||||||
|
|msg|string|成功提示|
|
||||||
|
|data|object|识别得结果|
|
||||||
|
|
||||||
|
###### 接口示例
|
||||||
|
|
||||||
|
入参:
|
||||||
|
``` javascript
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
"imagePath":"C:\\var\\123.jpg"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
响应:
|
||||||
|
``` javascript
|
||||||
|
{
|
||||||
|
"code": 0,
|
||||||
|
"data": "17 硬卧下铺别人能不能坐?12306回应\r\n18 中南财大被解聘女讲师已失联4个多月\r\n19 新一轮存款利率下调即将落地\r\n",
|
||||||
|
"msg": "success"
|
||||||
|
}
|
||||||
```
|
```
|
640
doc/postman.json
Normal file
640
doc/postman.json
Normal file
@ -0,0 +1,640 @@
|
|||||||
|
{
|
||||||
|
"info": {
|
||||||
|
"name": "Wechat Hook 395",
|
||||||
|
"_postman_id": "d2b6a4f2-6d7d-4a21-9bbf-65b5a5a3a5a",
|
||||||
|
"description": "A collection of Wechat Hook 395 API requests.",
|
||||||
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
||||||
|
},
|
||||||
|
"item": [
|
||||||
|
{
|
||||||
|
"name": "checkLogin",
|
||||||
|
"request": {
|
||||||
|
"url": {
|
||||||
|
"raw": "http://127.0.0.1:19088/api/checkLogin",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"127.0.0.1"
|
||||||
|
],
|
||||||
|
"port": "19088",
|
||||||
|
"path": [
|
||||||
|
"api",
|
||||||
|
"checkLogin"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to check login status."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "userInfo",
|
||||||
|
"request": {
|
||||||
|
"url": {
|
||||||
|
"raw": "http://127.0.0.1:19088/api/userInfo",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"127.0.0.1"
|
||||||
|
],
|
||||||
|
"port": "19088",
|
||||||
|
"path": [
|
||||||
|
"api",
|
||||||
|
"userInfo"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to get user information."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sendTextMsg",
|
||||||
|
"request": {
|
||||||
|
"url": {
|
||||||
|
"raw": "http://127.0.0.1:19088/api/sendTextMsg",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"127.0.0.1"
|
||||||
|
],
|
||||||
|
"port": "19088",
|
||||||
|
"path": [
|
||||||
|
"api",
|
||||||
|
"sendTextMsg"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"wxid\": \"filehelper\",\"msg\": \"12www\"}"
|
||||||
|
},
|
||||||
|
"description": "API to send text messages."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sendImagesMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/sendImagesMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"wxid\": \"filehelper\",\"imagePath\": \"C:\\pic.png\"}"
|
||||||
|
},
|
||||||
|
"description": "API to send image messages."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sendFileMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/sendFileMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"wxid\": \"filehelper\",\"filePath\": \"C:\\test.zip\"}"
|
||||||
|
},
|
||||||
|
"description": "API to send file messages."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hookSyncMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/hookSyncMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"port\": \"19099\",\"ip\": \"127.0.0.1\",\"url\": \"http://localhost:8080\",\"timeout\": \"3000\",\"enableHttp\": \"0\"}"
|
||||||
|
},
|
||||||
|
"description": "API to hook sync messages."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "unhookSyncMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/unhookSyncMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to unhook sync messages."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getContactList",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getContactList",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to get the contact list."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getDBInfo",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getDBInfo",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to get database information."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "execSql",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/execSql",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"dbHandle\": 1713425147584,\"sql\": \"select * from MSG where localId =100;\"}"
|
||||||
|
},
|
||||||
|
"description": "API to execute SQL queries."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getChatRoomDetailInfo",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getChatRoomDetailInfo",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"123333@chatroom\"}"
|
||||||
|
},
|
||||||
|
"description": "API to get chat room detail information."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "addMemberToChatRoom",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/addMemberToChatRoom",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"123@chatroom\",\"memberIds\": \"wxid_123\"}"
|
||||||
|
},
|
||||||
|
"description": "API to add member to chat room."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "delMemberFromChatRoom",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/delMemberFromChatRoom",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"21363231004@chatroom\",\"memberIds\": \"wxid_123\"}"
|
||||||
|
},
|
||||||
|
"description": "API to delete member from chat room."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "modifyNickname",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/modifyNickname",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"123@chatroom\",\"wxid\": \"wxid_123\",\"nickName\": \"test\"}"
|
||||||
|
},
|
||||||
|
"description": "API to modify a nickname in a chat room."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getMemberFromChatRoom",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getMemberFromChatRoom",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"123@chatroom\"}"
|
||||||
|
},
|
||||||
|
"description": "API to get members from a chat room."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "topMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/topMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"msgId\": 1222222}"
|
||||||
|
},
|
||||||
|
"description": "API to top a message."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "removeTopMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/removeTopMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"123@chatroom\",\"msgId\": 123}"
|
||||||
|
},
|
||||||
|
"description": "API to remove a topped message."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "InviteMemberToChatRoom",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/InviteMemberToChatRoom",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"123@chatroom\",\"memberIds\": \"wxid_123\"}"
|
||||||
|
},
|
||||||
|
"description": "API to invite members to a chat room."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "hookLog",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/hookLog",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to hook logs."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "unhookLog",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/unhookLog",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to unhook logs."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "createChatRoom",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/createChatRoom",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"memberIds\": \"wxid_8yn4k908tdqp22,wxid_oyb662qhop4422\"}"
|
||||||
|
},
|
||||||
|
"description": "API to create a chat room."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quitChatRoom",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/quitChatRoom",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"chatRoomId\": \"123@chatroom\"}"
|
||||||
|
},
|
||||||
|
"description": "API to quit a chat room."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "forwardMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/forwardMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"wxid\": \"filehelper\",\"msgId\": \"12331\"}"
|
||||||
|
},
|
||||||
|
"description": "API to forward a message."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getSNSFirstPage",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getSNSFirstPage",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": ""
|
||||||
|
},
|
||||||
|
"description": "API to get the first page of SNS data."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getSNSNextPage",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getSNSNextPage",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"snsId\": \"\"}"
|
||||||
|
},
|
||||||
|
"description": "API to get the next page of SNS data."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "addFavFromMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/addFavFromMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"msgId\": \"1222222\"}"
|
||||||
|
},
|
||||||
|
"description": "API to add a favorite from a message."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "addFavFromImage",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/addFavFromImage",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"wxid\": \"\",\"imagePath\": \"\"}"
|
||||||
|
},
|
||||||
|
"description": "API to add a favorite from an image."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getContactProfile",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getContactProfile",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"wxid\": \"\"}"
|
||||||
|
},
|
||||||
|
"description": "API to get contact profile."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "sendAtText",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/sendAtText",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"wxids\": \"notify@all\",\"chatRoomId\": \"123@chatroom\",\"msg\": \"你好啊\"}"
|
||||||
|
},
|
||||||
|
"description": "API to send an at-text message."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "forwardPublicMsg",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/forwardPublicMsg",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"appName\": \"\",\"userName\": \"\",\"title\": \"\",\"url\": \"\",\"thumbUrl\": \"\",\"digest\": \"\",\"wxid\": \"filehelper\"}"
|
||||||
|
},
|
||||||
|
"description": "API to forward a public message."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "forwardPublicMsgByMsgId",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/forwardPublicMsgByMsgId",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"msgId\": 123,\"wxid\": \"filehelper\"}"
|
||||||
|
},
|
||||||
|
"description": "API to forward a public message by message ID."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "downloadAttach",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/downloadAttach",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"msgId\": 123}"
|
||||||
|
},
|
||||||
|
"description": "API to download an attachment."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "decodeImage",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/decodeImage",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"filePath\": \"C:\\66664816980131.dat\",\"storeDir\": \"C:\\test\"}"
|
||||||
|
},
|
||||||
|
"description": "API to decode an image."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "getVoiceByMsgId",
|
||||||
|
"request": {
|
||||||
|
"url": "http://127.0.0.1:19088/api/getVoiceByMsgId",
|
||||||
|
"method": "POST",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"value": "application/json",
|
||||||
|
"description": "Specify that the request body is in JSON format."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"body": {
|
||||||
|
"mode": "raw",
|
||||||
|
"raw": "{\"msgId\": 7880439644200,\"storeDir\": \"c:\\test\"}"
|
||||||
|
},
|
||||||
|
"description": "API to get voice by message ID."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
11
go_client/main.go
Normal file
11
go_client/main.go
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go_client/tcpserver"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
log.SetFlags(log.LstdFlags | log.Lshortfile)
|
||||||
|
tcpserver.Listen(19099)
|
||||||
|
}
|
44
go_client/tcpserver/tcpserver.go
Normal file
44
go_client/tcpserver/tcpserver.go
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
package tcpserver
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bufio"
|
||||||
|
"log"
|
||||||
|
"net"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Listen(port int) {
|
||||||
|
p := strconv.Itoa(port)
|
||||||
|
adress := "127.0.0.1:" + p
|
||||||
|
ln, err := net.Listen("tcp", adress)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
defer ln.Close()
|
||||||
|
log.Println("tcp server started")
|
||||||
|
for {
|
||||||
|
conn, err := ln.Accept()
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
go handle(conn)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func handle(conn net.Conn) {
|
||||||
|
defer func() {
|
||||||
|
if err := recover(); err != nil {
|
||||||
|
log.Println("发生了未处理的异常", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
defer conn.Close()
|
||||||
|
scanner := bufio.NewScanner(conn)
|
||||||
|
for scanner.Scan() {
|
||||||
|
line := scanner.Bytes()
|
||||||
|
log.Println("收到消息:", string(line))
|
||||||
|
}
|
||||||
|
if err := scanner.Err(); err != nil {
|
||||||
|
log.Println("错误:", err)
|
||||||
|
}
|
||||||
|
}
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.1.0</version>
|
<version>3.2.2</version>
|
||||||
<relativePath/> <!-- lookup parent from repository -->
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>com.example</groupId>
|
<groupId>com.example</groupId>
|
||||||
@ -14,7 +14,8 @@
|
|||||||
<name>wxhk</name>
|
<name>wxhk</name>
|
||||||
<description>wxhk</description>
|
<description>wxhk</description>
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>17</java.version>
|
<java.version>21</java.version>
|
||||||
|
<vertx-web-client.version>4.5.3</vertx-web-client.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -39,7 +40,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
<artifactId>netty-all</artifactId>
|
<artifactId>netty-all</artifactId>
|
||||||
<version>4.1.92.Final</version>
|
<version>4.1.105.Final</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.squareup.okhttp3</groupId>
|
<groupId>com.squareup.okhttp3</groupId>
|
||||||
@ -50,22 +51,22 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.vertx</groupId>
|
<groupId>io.vertx</groupId>
|
||||||
<artifactId>vertx-core</artifactId>
|
<artifactId>vertx-core</artifactId>
|
||||||
<version>4.4.2</version>
|
<version>${vertx-web-client.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.vertx</groupId>
|
<groupId>io.vertx</groupId>
|
||||||
<artifactId>vertx-web</artifactId>
|
<artifactId>vertx-web</artifactId>
|
||||||
<version>4.4.2</version>
|
<version>${vertx-web-client.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.vertx</groupId>
|
<groupId>io.vertx</groupId>
|
||||||
<artifactId>vertx-web-client</artifactId>
|
<artifactId>vertx-web-client</artifactId>
|
||||||
<version>4.4.2</version>
|
<version>${vertx-web-client.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.vertx</groupId>
|
<groupId>io.vertx</groupId>
|
||||||
<artifactId>vertx-mysql-client</artifactId>
|
<artifactId>vertx-mysql-client</artifactId>
|
||||||
<version>4.4.2</version>
|
<version>${vertx-web-client.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
@ -42,6 +42,11 @@ public class PrivateChatMsg implements Serializable {
|
|||||||
private String signature;
|
private String signature;
|
||||||
private String time;
|
private String time;
|
||||||
private Integer timestamp;
|
private Integer timestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对用户,如果是文件助手是filehelper
|
||||||
|
*/
|
||||||
|
private String toUser;
|
||||||
/**
|
/**
|
||||||
* 类型
|
* 类型
|
||||||
*/
|
*/
|
||||||
|
@ -15,4 +15,17 @@ import lombok.experimental.Accessors;
|
|||||||
public class OpenHook implements SendMsg<OpenHook> {
|
public class OpenHook implements SendMsg<OpenHook> {
|
||||||
String port;
|
String port;
|
||||||
String ip;
|
String ip;
|
||||||
|
/**
|
||||||
|
* 0/1 :1.启用http 0.不启用http
|
||||||
|
*/
|
||||||
|
boolean enableHttp;
|
||||||
|
/**
|
||||||
|
* 超时时间,单位ms
|
||||||
|
*/
|
||||||
|
String timeout;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* http的请求地址,enableHttp=1时,不能为空
|
||||||
|
*/
|
||||||
|
String url;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import org.w3c.dom.NodeList;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
@ -50,7 +51,12 @@ public class WxMsgHandle {
|
|||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
add(chatMsg -> {
|
add(chatMsg -> {
|
||||||
wxSmgServer.私聊(chatMsg);
|
if(Objects.equals(chatMsg.getToUser(), FILEHELPER)){
|
||||||
|
wxSmgServer.文件助手(chatMsg);
|
||||||
|
}else{
|
||||||
|
wxSmgServer.私聊(chatMsg);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}, WxMsgType.私聊信息);
|
}, WxMsgType.私聊信息);
|
||||||
add(chatMsg -> {
|
add(chatMsg -> {
|
||||||
@ -174,8 +180,8 @@ public class WxMsgHandle {
|
|||||||
if (monery.startsWith("¥")) {
|
if (monery.startsWith("¥")) {
|
||||||
String substring = monery.substring(1);
|
String substring = monery.substring(1);
|
||||||
BigDecimal decimal = new BigDecimal(substring);
|
BigDecimal decimal = new BigDecimal(substring);
|
||||||
log.info("收款:{},付款人:{},付款备注:{}", decimal.stripTrailingZeros().toPlainString(), chatMsg.getFromUser(), remark);
|
log.info("收款:{},付款人:{},付款备注:{}", decimal.stripTrailingZeros().toPlainString(), receiver_username, remark);
|
||||||
wxSmgServer.收款之后(new PayoutInformation(chatMsg.getFromUser(), decimal, remark));
|
wxSmgServer.收款之后(new PayoutInformation(receiver_username, decimal, remark));
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -32,12 +32,14 @@ public class WxSmgServerImpl implements com.example.wxhk.server.WxSmgServer {
|
|||||||
public void 私聊(PrivateChatMsg chatMsg) {
|
public void 私聊(PrivateChatMsg chatMsg) {
|
||||||
if (Objects.equals(chatMsg.getIsSendMsg(), 1) && Objects.equals(chatMsg.getIsSendByPhone(), 1)) {
|
if (Objects.equals(chatMsg.getIsSendMsg(), 1) && Objects.equals(chatMsg.getIsSendByPhone(), 1)) {
|
||||||
log.info("手机端对:{}发出:{}", chatMsg.getFromUser(), chatMsg.getContent());
|
log.info("手机端对:{}发出:{}", chatMsg.getFromUser(), chatMsg.getContent());
|
||||||
|
}else{
|
||||||
|
log.info("收到私聊{}",chatMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void 文件助手(PrivateChatMsg chatMsg) {
|
public void 文件助手(PrivateChatMsg chatMsg) {
|
||||||
|
log.info("文件助手:{}",chatMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2,7 +2,8 @@ package com.example.wxhk.tcp.vertx;
|
|||||||
|
|
||||||
import com.example.wxhk.WxhkApplication;
|
import com.example.wxhk.WxhkApplication;
|
||||||
import com.example.wxhk.constant.WxMsgType;
|
import com.example.wxhk.constant.WxMsgType;
|
||||||
import com.example.wxhk.util.HttpAsyncUtil;
|
import com.example.wxhk.model.request.OpenHook;
|
||||||
|
import com.example.wxhk.util.HttpSendUtil;
|
||||||
import io.vertx.core.AbstractVerticle;
|
import io.vertx.core.AbstractVerticle;
|
||||||
import io.vertx.core.DeploymentOptions;
|
import io.vertx.core.DeploymentOptions;
|
||||||
import io.vertx.core.Future;
|
import io.vertx.core.Future;
|
||||||
@ -75,7 +76,10 @@ public class VertxTcp extends AbstractVerticle implements CommandLineRunner {
|
|||||||
listen.onComplete(event -> {
|
listen.onComplete(event -> {
|
||||||
boolean succeeded = event.succeeded();
|
boolean succeeded = event.succeeded();
|
||||||
if (succeeded) {
|
if (succeeded) {
|
||||||
HttpAsyncUtil.exec(HttpAsyncUtil.Type.开启hook, new JsonObject().put("port", InitWeChat.getVertxPort().toString()).put("ip", "127.0.0.1"));
|
HttpSendUtil.开启hook(new OpenHook().setPort(InitWeChat.getVertxPort().toString()).setIp("127.0.0.1")
|
||||||
|
.setEnableHttp(false)
|
||||||
|
.setTimeout("5000"));
|
||||||
|
// HttpAsyncUtil.exec(HttpAsyncUtil.Type.开启hook, new JsonObject().put("port", InitWeChat.getVertxPort().toString()).put("ip", "127.0.0.1"));
|
||||||
startPromise.complete();
|
startPromise.complete();
|
||||||
} else {
|
} else {
|
||||||
startPromise.fail(event.cause());
|
startPromise.fail(event.cause());
|
||||||
|
@ -24,7 +24,7 @@ public class HttpAsyncUtil {
|
|||||||
protected static final Log log = Log.get();
|
protected static final Log log = Log.get();
|
||||||
|
|
||||||
public static Future<HttpResponse<Buffer>> exec(Type type, JsonObject object) {
|
public static Future<HttpResponse<Buffer>> exec(Type type, JsonObject object) {
|
||||||
return client.post(InitWeChat.wxPort, "localhost", "/api/?type=" + type.getType())
|
return client.post(InitWeChat.wxPort, "localhost", "/api/" + type.getType())
|
||||||
.sendJsonObject(object)
|
.sendJsonObject(object)
|
||||||
.onSuccess(event ->
|
.onSuccess(event ->
|
||||||
{
|
{
|
||||||
@ -36,7 +36,7 @@ public class HttpAsyncUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Future<HttpResponse<Buffer>> exec(Type type, JsonObject object, Handler<AsyncResult<HttpResponse<Buffer>>> handler) {
|
public static Future<HttpResponse<Buffer>> exec(Type type, JsonObject object, Handler<AsyncResult<HttpResponse<Buffer>>> handler) {
|
||||||
return client.post(InitWeChat.wxPort, "localhost", "/api/?type=" + type.getType())
|
return client.post(InitWeChat.wxPort, "localhost", "/api/" + type.getType())
|
||||||
.sendJsonObject(object)
|
.sendJsonObject(object)
|
||||||
.onComplete(handler)
|
.onComplete(handler)
|
||||||
;
|
;
|
||||||
@ -45,22 +45,31 @@ public class HttpAsyncUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public enum Type {
|
public enum Type {
|
||||||
检查微信登陆("0"),
|
检查微信登陆("checkLogin"),
|
||||||
获取登录信息("1"),
|
获取登录信息("userInfo"),
|
||||||
发送文本("2"),
|
发送文本("sendTextMsg"),
|
||||||
发送at文本("3"),
|
转发消息("forwardMsg"),
|
||||||
|
发送at文本("sendAtText"),
|
||||||
发送图片("5"),
|
发送图片("5"),
|
||||||
发送文件("6"),
|
发送文件("sendFileMsg"),
|
||||||
开启hook("9"),
|
开启hook("hookSyncMsg"),
|
||||||
关闭hook("10"),
|
关闭hook("unhookSyncMsg"),
|
||||||
添加好友("20"),
|
添加好友("20"),
|
||||||
通过好友申请("23"),
|
通过好友申请("23"),
|
||||||
获取群成员("25"),
|
获取群成员("getMemberFromChatRoom"),
|
||||||
获取群成员昵称("26"),
|
获取群成员基础信息("getContactProfile"),
|
||||||
删除群成员("27"),
|
获取群详情("getChatRoomDetailInfo"),
|
||||||
|
添加群成员("addMemberToChatRoom"),
|
||||||
|
修改群昵称("modifyNickname"),
|
||||||
|
删除群成员("delMemberFromChatRoom"),
|
||||||
|
置顶群消息("topMsg"),
|
||||||
|
取消置顶群消息("removeTopMsg"),
|
||||||
|
邀请入群("InviteMemberToChatRoom"),
|
||||||
确认收款("45"),
|
确认收款("45"),
|
||||||
联系人列表("46"),
|
联系人列表("getContactList"),
|
||||||
查询微信信息("55"),
|
查询微信信息("55"),
|
||||||
|
下载附件("downloadAttach"),
|
||||||
|
解码("decodeImage"),
|
||||||
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
@ -27,7 +27,7 @@ public class HttpSyncUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static JsonObject exec(HttpAsyncUtil.Type type, JsonObject obj) {
|
public static JsonObject exec(HttpAsyncUtil.Type type, JsonObject obj) {
|
||||||
String post = engine.send(Request.of("http://localhost:" + InitWeChat.wxPort + "/api/?type=" + type.getType()).method(Method.POST).body(obj.encode())).bodyStr();
|
String post = engine.send(Request.of("http://localhost:" + InitWeChat.wxPort + "/api/" + type.getType()).method(Method.POST).body(obj.encode())).bodyStr();
|
||||||
if (log.isDebugEnabled()) {
|
if (log.isDebugEnabled()) {
|
||||||
log.debug("type:{},{}", type.getType(), post);
|
log.debug("type:{},{}", type.getType(), post);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
wx.path=D:\\Program Files (x86)\\Tencent\\WeChat\\[3.9.2.23]\\WeChat.exe
|
wx.path=D:\\Program Files (x86)\\Tencent\\WeChat\\WeChat.exe
|
||||||
wx.port=19088
|
wx.port=19088
|
||||||
spring.profiles.active=local
|
spring.profiles.active=local
|
||||||
vertx.port=8080
|
vertx.port=8080
|
Binary file not shown.
Binary file not shown.
@ -7,6 +7,8 @@ import org.dromara.hutool.core.lang.Console;
|
|||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@ -41,5 +43,7 @@ class HttpSendUtilTest {
|
|||||||
void 获取群成员() {
|
void 获取群成员() {
|
||||||
GroupMembers 获取群成员 = HttpSendUtil.获取群成员(new GetGroupMembers().setChatRoomId("24964676359@chatroom"));
|
GroupMembers 获取群成员 = HttpSendUtil.获取群成员(new GetGroupMembers().setChatRoomId("24964676359@chatroom"));
|
||||||
Console.log(获取群成员);
|
Console.log(获取群成员);
|
||||||
|
|
||||||
|
Duration between = Duration.between(LocalDateTime.now(), LocalDateTime.now());
|
||||||
}
|
}
|
||||||
}
|
}
|
26
nodejs_client/tcp_server.js
Normal file
26
nodejs_client/tcp_server.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
const net = require('net')
|
||||||
|
|
||||||
|
const server = net.createServer(socket => {
|
||||||
|
console.log('New client connected')
|
||||||
|
|
||||||
|
let data = Buffer.from('')
|
||||||
|
|
||||||
|
socket.on('data', data => {
|
||||||
|
data = Buffer.concat([data, chunk])
|
||||||
|
console.log(`Received data: ${data}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.on('end', () => {
|
||||||
|
const decodedData = data.toString('utf8')
|
||||||
|
console.log(`Received data: ${decodedData}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.on('close', () => {
|
||||||
|
console.log('Client disconnected')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
const port = 19099
|
||||||
|
server.listen(port, () => {
|
||||||
|
console.log(`Server listening on port ${port}`)
|
||||||
|
})
|
@ -526,7 +526,7 @@ DWORD GetPIDForProcess(wchar_t* process)
|
|||||||
if (!hSnapshot) {
|
if (!hSnapshot) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
pe32.dwSize = sizeof(PROCESSENTRY32);
|
pe32.dwSize = sizeof(PROCESSENTRY32W);
|
||||||
for (working = Process32FirstW(hSnapshot, &pe32); working; working = Process32NextW(hSnapshot, &pe32))
|
for (working = Process32FirstW(hSnapshot, &pe32); working; working = Process32NextW(hSnapshot, &pe32))
|
||||||
{
|
{
|
||||||
if (!wcscmp(pe32.szExeFile, process))
|
if (!wcscmp(pe32.szExeFile, process))
|
||||||
@ -933,7 +933,7 @@ int InjectDll(wchar_t* szPName, wchar_t* szDllPath)
|
|||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DWORD dErrorCode = GetLastError();
|
DWORD dErrorCode = GetLastError();
|
||||||
printf("dll inject fail");
|
printf("dll inject fail");
|
||||||
printf("error code : %d ", dErrorCode);
|
printf("error code : %d ", dErrorCode);
|
||||||
|
@ -560,6 +560,48 @@ std::string HttpDispatch(struct mg_connection *c, struct mg_http_message *hm) {
|
|||||||
{"code", success}, {"msg", "success"}, {"data", {}}};
|
{"code", success}, {"msg", "success"}, {"data", {}}};
|
||||||
ret = ret_data.dump();
|
ret = ret_data.dump();
|
||||||
return ret;
|
return ret;
|
||||||
|
} else if (mg_http_match_uri(hm, "/api/sendApplet")) {
|
||||||
|
std::wstring wxid = GetWStringParam(j_param, "wxid");
|
||||||
|
std::wstring waid_concat = GetWStringParam(j_param, "waidConcat");
|
||||||
|
std::string waid = GetStringParam(j_param, "waid");
|
||||||
|
std::string app_wxid = GetStringParam(j_param, "appletWxid");
|
||||||
|
std::string json_param = GetStringParam(j_param, "jsonParam");
|
||||||
|
std::string head_url = GetStringParam(j_param, "headImgUrl");
|
||||||
|
std::string main_img = GetStringParam(j_param, "mainImg");
|
||||||
|
std::string index_page = GetStringParam(j_param, "indexPage");
|
||||||
|
|
||||||
|
std::wstring waid_w = wxhelper::Utils::UTF8ToWstring(waid);
|
||||||
|
|
||||||
|
INT64 success = wxhelper::GlobalContext::GetInstance().mgr->SendApplet(
|
||||||
|
wxid, waid_concat, waid_w, waid, app_wxid, json_param, head_url,
|
||||||
|
main_img, index_page);
|
||||||
|
nlohmann::json ret_data = {
|
||||||
|
{"code", success}, {"msg", "success"}, {"data", {}}};
|
||||||
|
ret = ret_data.dump();
|
||||||
|
return ret;
|
||||||
|
} else if (mg_http_match_uri(hm, "/api/sendPatMsg")) {
|
||||||
|
std::wstring room_id = GetWStringParam(j_param, "receiver");
|
||||||
|
std::wstring wxid = GetWStringParam(j_param, "wxid");
|
||||||
|
INT64 success =
|
||||||
|
wxhelper::GlobalContext::GetInstance().mgr->SendPatMsg(room_id, wxid);
|
||||||
|
nlohmann::json ret_data = {
|
||||||
|
{"code", success}, {"msg", "success"}, {"data", {}}};
|
||||||
|
ret = ret_data.dump();
|
||||||
|
return ret;
|
||||||
|
} else if (mg_http_match_uri(hm, "/api/ocr")) {
|
||||||
|
std::wstring image_path = GetWStringParam(j_param, "imagePath");
|
||||||
|
std::string text("");
|
||||||
|
INT64 success = wxhelper::GlobalContext::GetInstance().mgr->DoOCRTask(image_path,text);
|
||||||
|
nlohmann::json ret_data = {
|
||||||
|
{"code", success}, {"msg", "success"}, {"data", text}};
|
||||||
|
ret = ret_data.dump();
|
||||||
|
return ret;
|
||||||
|
} else if (mg_http_match_uri(hm, "/api/test")) {
|
||||||
|
INT64 success = wxhelper::GlobalContext::GetInstance().mgr->Test();
|
||||||
|
nlohmann::json ret_data = {
|
||||||
|
{"code", success}, {"msg", "success"}, {"data", {}}};
|
||||||
|
ret = ret_data.dump();
|
||||||
|
return ret;
|
||||||
} else {
|
} else {
|
||||||
nlohmann::json ret_data = {
|
nlohmann::json ret_data = {
|
||||||
{"code", 200}, {"data", {}}, {"msg", "not support url"}};
|
{"code", 200}, {"data", {}}, {"msg", "not support url"}};
|
||||||
|
180
src/manager.cc
180
src/manager.cc
@ -28,7 +28,19 @@ prototype::WeChatString * BuildWechatString(const std::wstring &ws){
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
Manager::Manager(UINT64 base) : base_addr_(base) {}
|
prototype::WeChatStr * BuildWechatStr(const std::string &str){
|
||||||
|
prototype::WeChatStr *p = Utils::WxHeapAlloc<prototype::WeChatStr>(
|
||||||
|
sizeof(prototype::WeChatStr));
|
||||||
|
char *p_chat_room_id = Utils::WxHeapAlloc<char>(str.size() + 1);
|
||||||
|
memcpy(p_chat_room_id, str.c_str(), str.size() + 1);
|
||||||
|
p->ptr = p_chat_room_id;
|
||||||
|
p->len = static_cast<DWORD>(str.size());
|
||||||
|
p->maxlen = static_cast<DWORD>(str.size());
|
||||||
|
p->buf = NULL;
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
Manager::Manager(UINT64 base) : base_addr_(base),js_api_addr_(0) {}
|
||||||
Manager::~Manager() {}
|
Manager::~Manager() {}
|
||||||
INT64 Manager::CheckLogin() {
|
INT64 Manager::CheckLogin() {
|
||||||
INT64 success = -1;
|
INT64 success = -1;
|
||||||
@ -1095,4 +1107,168 @@ INT64 Manager::SendCustomEmotion(const std::wstring &file_path,
|
|||||||
reinterpret_cast<UINT64>(temp));
|
reinterpret_cast<UINT64>(temp));
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
} // namespace wxhelper
|
|
||||||
|
INT64 Manager::SendApplet(const std::wstring &recv_wxid,
|
||||||
|
const std::wstring &waid_suff,
|
||||||
|
const std::wstring &waid_w, const std::string &waid_s,
|
||||||
|
const std::string &wa_wxid,
|
||||||
|
const std::string &json_param,
|
||||||
|
const std::string &head_image,
|
||||||
|
const std::string &big_image,
|
||||||
|
const std::string &index_page) {
|
||||||
|
INT64 success = -1;
|
||||||
|
if (js_api_addr_ == 0) {
|
||||||
|
auto vec2 = Utils::QWordScan(base_addr_ + 0x32D1318, 0x1000, 0x8);
|
||||||
|
for (int i = 0; i < vec2.size(); i++) {
|
||||||
|
INT64 ptr = vec2.at(i);
|
||||||
|
if (*(INT64 *)ptr == base_addr_ + 0x32D1318) {
|
||||||
|
js_api_addr_ = ptr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (js_api_addr_ == 0) {
|
||||||
|
success = -2;
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT64 share_app_msg_addr = base_addr_ + offset::kNewJsApiShareAppMessage;
|
||||||
|
func::__JsApiShareAppMessage share_app_msg =
|
||||||
|
(func::__JsApiShareAppMessage)share_app_msg_addr;
|
||||||
|
|
||||||
|
UINT64 init_addr = base_addr_ + offset::kInitJsConfig;
|
||||||
|
func::__InitJsConfig init = (func::__InitJsConfig)init_addr;
|
||||||
|
|
||||||
|
UINT64 send_applet_addr = base_addr_ + offset::kSendApplet;
|
||||||
|
func::__SendApplet send_applet = (func::__SendApplet)send_applet_addr;
|
||||||
|
|
||||||
|
UINT64 get_by_waid_addr = base_addr_ + offset::kGetAppInfoByWaid;
|
||||||
|
func::__GetAppInfoByWaid get_app_info =
|
||||||
|
(func::__GetAppInfoByWaid)get_by_waid_addr;
|
||||||
|
|
||||||
|
UINT64 copy_app_req_addr = base_addr_ + offset::kCopyShareAppMessageRequest;
|
||||||
|
func::__CopyShareAppMessageRequest copy_app_req =
|
||||||
|
(func::__CopyShareAppMessageRequest)copy_app_req_addr;
|
||||||
|
|
||||||
|
UINT64 new_wa_msg_addr = base_addr_ + offset::kNewWAUpdatableMsgInfo;
|
||||||
|
func::__NewWAUpdatableMsgInfo new_wa_msg =
|
||||||
|
(func::__NewWAUpdatableMsgInfo)new_wa_msg_addr;
|
||||||
|
|
||||||
|
UINT64 free_wa_msg_addr = base_addr_ + offset::kFreeWAUpdatableMsgInfo;
|
||||||
|
func::__FreeWAUpdatableMsgInfo free_wa_msg =
|
||||||
|
(func::__FreeWAUpdatableMsgInfo)free_wa_msg_addr;
|
||||||
|
|
||||||
|
std::vector<prototype::WeChatString> *temp =
|
||||||
|
Utils::WxHeapAlloc<std::vector<prototype::WeChatString>>(0x20);
|
||||||
|
// std::vector<prototype::WeChatString>* temp = new
|
||||||
|
// std::vector<prototype::WeChatString>();
|
||||||
|
common::VectorInner *list = (common::VectorInner *)temp;
|
||||||
|
|
||||||
|
prototype::WeChatString *member = BuildWechatString(recv_wxid);
|
||||||
|
#ifdef _DEBUG
|
||||||
|
list->head = reinterpret_cast<UINT64>(member);
|
||||||
|
#endif
|
||||||
|
list->start = reinterpret_cast<UINT64>(member);
|
||||||
|
list->finsh = reinterpret_cast<UINT64>(member) + 0x20;
|
||||||
|
list->end = reinterpret_cast<UINT64>(member) + 0x20;
|
||||||
|
|
||||||
|
INT64 head = reinterpret_cast<UINT64>(&(list->start));
|
||||||
|
|
||||||
|
prototype::WeChatString *waid_cat = BuildWechatString(waid_suff);
|
||||||
|
prototype::WeChatString *waid = BuildWechatString(waid_w);
|
||||||
|
|
||||||
|
prototype::WeChatString *waid_2 = BuildWechatString(waid_suff);
|
||||||
|
|
||||||
|
prototype::WeChatStr *waid_str = BuildWechatStr(waid_s);
|
||||||
|
prototype::WeChatStr *app_wxid = BuildWechatStr(wa_wxid);
|
||||||
|
prototype::WeChatStr *json_str = BuildWechatStr(json_param);
|
||||||
|
prototype::WeChatStr *head_image_url = BuildWechatStr(head_image);
|
||||||
|
prototype::WeChatStr *image = BuildWechatStr(big_image);
|
||||||
|
prototype::WeChatStr *index = BuildWechatStr(index_page);
|
||||||
|
|
||||||
|
UINT64 app_msg = js_api_addr_;
|
||||||
|
|
||||||
|
UINT64 data = *(UINT64 *)(app_msg + 0x8);
|
||||||
|
char *share_req = Utils::WxHeapAlloc<char>(0x2000);
|
||||||
|
|
||||||
|
char *mid_ptr = Utils::WxHeapAlloc<char>(0x18);
|
||||||
|
memcpy(mid_ptr, &share_req, sizeof(INT64));
|
||||||
|
memcpy(mid_ptr + 0x8, &share_req, sizeof(INT64));
|
||||||
|
memcpy(mid_ptr + 0x10, &share_req, sizeof(INT64));
|
||||||
|
|
||||||
|
memcpy((void *)data, mid_ptr, 0x18);
|
||||||
|
|
||||||
|
memcpy(share_req, (void *)(app_msg + 0x8), sizeof(UINT64));
|
||||||
|
memcpy(share_req + 0x8, (void *)(app_msg + 0x8), sizeof(UINT64));
|
||||||
|
memcpy(share_req + 0x10, (void *)(app_msg + 0x8), sizeof(UINT64));
|
||||||
|
memcpy(share_req + 0x20, waid_2, sizeof(prototype::WeChatString));
|
||||||
|
memcpy(share_req + 0x48, waid_str, sizeof(prototype::WeChatStr));
|
||||||
|
memcpy(share_req + 0x98, app_wxid, sizeof(prototype::WeChatStr));
|
||||||
|
memcpy(share_req + 0xF8, json_str, sizeof(prototype::WeChatStr));
|
||||||
|
memcpy(share_req + 0x178, head_image_url, sizeof(prototype::WeChatStr));
|
||||||
|
memcpy(share_req + 0x198, image, sizeof(prototype::WeChatStr));
|
||||||
|
memcpy(share_req + 0x1c0, index, sizeof(prototype::WeChatStr));
|
||||||
|
|
||||||
|
success = send_applet(app_msg, reinterpret_cast<UINT64>(waid_cat), head, 0);
|
||||||
|
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT64 Manager::SendPatMsg(const std::wstring &room_id,
|
||||||
|
const std::wstring &wxid) {
|
||||||
|
INT64 success = -1;
|
||||||
|
UINT64 send_pat_msg_addr = base_addr_ + offset::kSendPatMsg;
|
||||||
|
func::__SendPatMsg send_pat_msg =(func::__SendPatMsg)send_pat_msg_addr;
|
||||||
|
prototype::WeChatString chat_room(room_id);
|
||||||
|
prototype::WeChatString target(wxid);
|
||||||
|
success = send_pat_msg(reinterpret_cast<UINT64>(&chat_room),reinterpret_cast<UINT64>(&target));
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT64 Manager::DoOCRTask(const std::wstring &img_path, std::string &result) {
|
||||||
|
INT64 success = -1;
|
||||||
|
UINT64 ocr_manager_addr = base_addr_ + offset::kGetOCRManager;
|
||||||
|
func::__GetOCRManager ocr_manager = (func::__GetOCRManager)ocr_manager_addr;
|
||||||
|
|
||||||
|
UINT64 do_ocr_task_addr = base_addr_ + offset::kDoOCRTask;
|
||||||
|
func::__DoOCRTask do_ocr_task = (func::__DoOCRTask)do_ocr_task_addr;
|
||||||
|
|
||||||
|
prototype::WeChatString img(img_path);
|
||||||
|
std::vector<INT64> *temp = Utils::WxHeapAlloc<std::vector<INT64>>(0x20);
|
||||||
|
INT64 unkonwn = 0;
|
||||||
|
common::VectorInner *list = (common::VectorInner *)temp;
|
||||||
|
list->start = reinterpret_cast<INT64>(&list->start);
|
||||||
|
list->finsh = list->start;
|
||||||
|
char buff[0x28] = {0};
|
||||||
|
memcpy(buff, &list->start, sizeof(INT64));
|
||||||
|
UINT64 mgr = ocr_manager();
|
||||||
|
success = do_ocr_task(mgr, reinterpret_cast<UINT64>(&img),1,
|
||||||
|
reinterpret_cast<UINT64>(buff),reinterpret_cast<UINT64>(&unkonwn));
|
||||||
|
INT64 number = *(INT64 *)(buff + 0x8);
|
||||||
|
if (number > 0) {
|
||||||
|
INT64 header = *(INT64 *)(buff);
|
||||||
|
for (unsigned int i = 0; i < number; i++) {
|
||||||
|
INT64 content = *(INT64 *)header;
|
||||||
|
result += Utils::ReadWstringThenConvert(content + 0x28);
|
||||||
|
result += "\r\n";
|
||||||
|
header = content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT64 Manager::Test() {
|
||||||
|
auto vec = Utils::QWordScan(base_addr_ + 0x32D1318, 0x1, L"WeChatWin.dll");
|
||||||
|
for (int i = 0; i < vec.size(); i++) {
|
||||||
|
INT64 re = vec.at(i);
|
||||||
|
SPDLOG_INFO("scan result :{},{}", i, re);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto vec2 = Utils::QWordScan(base_addr_ + 0x32D1318, 0x1000, 0x8);
|
||||||
|
for (int i = 0; i < vec2.size(); i++) {
|
||||||
|
INT64 re = vec2.at(i);
|
||||||
|
SPDLOG_INFO("scan2 result :{},{}", i, re);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
} // namespace wxhelper
|
||||||
|
@ -56,9 +56,18 @@ class Manager {
|
|||||||
INT64 GetVoiceByDB(ULONG64 msg_id, const std::wstring& dir);
|
INT64 GetVoiceByDB(ULONG64 msg_id, const std::wstring& dir);
|
||||||
INT64 SendCustomEmotion(const std::wstring& file_path,
|
INT64 SendCustomEmotion(const std::wstring& file_path,
|
||||||
const std::wstring& wxid);
|
const std::wstring& wxid);
|
||||||
|
INT64 SendApplet(
|
||||||
|
const std::wstring& recv_wxid, const std::wstring& waid_suff,
|
||||||
|
const std::wstring& waid_w, const std::string& waid_s,
|
||||||
|
const std::string& wa_wxid, const std::string& json_param,
|
||||||
|
const std::string& head_image, const std::string& big_image,
|
||||||
|
const std::string& index_page);
|
||||||
|
INT64 SendPatMsg(const std::wstring& room_id, const std::wstring& wxid);
|
||||||
|
INT64 DoOCRTask(const std::wstring& img_path, std::string &result);
|
||||||
|
INT64 Test();
|
||||||
private:
|
private:
|
||||||
UINT64 base_addr_;
|
UINT64 base_addr_;
|
||||||
|
UINT64 js_api_addr_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace wxhelper
|
} // namespace wxhelper
|
||||||
|
59
src/utils.cc
59
src/utils.cc
@ -1,6 +1,7 @@
|
|||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include <winternl.h>
|
#include <winternl.h>
|
||||||
|
#include <Psapi.h>
|
||||||
#define BUFSIZE 1024
|
#define BUFSIZE 1024
|
||||||
#define JPEG0 0xFF
|
#define JPEG0 0xFF
|
||||||
#define JPEG1 0xD8
|
#define JPEG1 0xD8
|
||||||
@ -398,4 +399,62 @@ INT64 Utils::DecodeImage(const wchar_t* file_path,const wchar_t* save_dir){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<INT64> Utils::QWordScan(INT64 value, int align,
|
||||||
|
const wchar_t *module) {
|
||||||
|
MODULEINFO module_info;
|
||||||
|
std::vector<INT64> result;
|
||||||
|
if (GetModuleInformation(GetCurrentProcess(), GetModuleHandleW(module),
|
||||||
|
&module_info, sizeof(module_info))) {
|
||||||
|
auto start = static_cast<const char *>(module_info.lpBaseOfDll);
|
||||||
|
const auto end = start + module_info.SizeOfImage - 0x8;
|
||||||
|
|
||||||
|
auto current_addr = start;
|
||||||
|
while (current_addr < end) {
|
||||||
|
if (*(INT64*)current_addr == value) {
|
||||||
|
result.push_back(reinterpret_cast<INT64>(current_addr));
|
||||||
|
}
|
||||||
|
start += align;
|
||||||
|
current_addr = start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<INT64> Utils::QWordScan(INT64 value, INT64 start,int align) {
|
||||||
|
SYSTEM_INFO sys_info;
|
||||||
|
GetSystemInfo(&sys_info);
|
||||||
|
std::vector<INT64> result;
|
||||||
|
INT64 min_addr =
|
||||||
|
reinterpret_cast<INT64>(sys_info.lpMinimumApplicationAddress);
|
||||||
|
INT64 max_addr =
|
||||||
|
reinterpret_cast<INT64>(sys_info.lpMaximumApplicationAddress);
|
||||||
|
const INT64 page_size = sys_info.dwPageSize;
|
||||||
|
min_addr = min_addr > start ? min_addr : start;
|
||||||
|
|
||||||
|
auto current_addr = min_addr;
|
||||||
|
MEMORY_BASIC_INFORMATION mem_info = {};
|
||||||
|
HANDLE handle = GetCurrentProcess();
|
||||||
|
while (current_addr < max_addr) {
|
||||||
|
VirtualQueryEx(handle, reinterpret_cast<LPVOID>(current_addr), &mem_info,
|
||||||
|
sizeof(MEMORY_BASIC_INFORMATION));
|
||||||
|
|
||||||
|
if ((INT64)mem_info.RegionSize <= 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
INT64 region_size = mem_info.RegionSize;
|
||||||
|
if ((mem_info.State & MEM_COMMIT) == MEM_COMMIT &&
|
||||||
|
(mem_info.Protect & PAGE_GUARD) != PAGE_GUARD &&
|
||||||
|
(mem_info.Protect & PAGE_NOACCESS) != PAGE_NOACCESS) {
|
||||||
|
for (INT64 i = 0; i < region_size; i += align) {
|
||||||
|
if (value == *(INT64 *)current_addr) {
|
||||||
|
result.push_back(current_addr);
|
||||||
|
}
|
||||||
|
current_addr += align;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
current_addr += region_size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
} // namespace wxhelper
|
} // namespace wxhelper
|
@ -60,6 +60,10 @@ class Utils {
|
|||||||
|
|
||||||
static INT64 DecodeImage(const wchar_t* file_path,const wchar_t* save_dir);
|
static INT64 DecodeImage(const wchar_t* file_path,const wchar_t* save_dir);
|
||||||
|
|
||||||
|
static std::vector<INT64> QWordScan(INT64 value, int align,
|
||||||
|
const wchar_t *module);
|
||||||
|
|
||||||
|
static std::vector<INT64> QWordScan(INT64 value, INT64 start,int align);
|
||||||
template <typename T1, typename T2>
|
template <typename T1, typename T2>
|
||||||
static std::vector<T1> split(T1 str, T2 letter) {
|
static std::vector<T1> split(T1 str, T2 letter) {
|
||||||
std::vector<T1> arr;
|
std::vector<T1> arr;
|
||||||
|
@ -274,6 +274,17 @@ typedef UINT64 (*__GetPreDownLoadMgr)();
|
|||||||
typedef UINT64 (*__PushAttachTask)(UINT64,UINT64,UINT64,UINT64);
|
typedef UINT64 (*__PushAttachTask)(UINT64,UINT64,UINT64,UINT64);
|
||||||
typedef UINT64 (*__GetCustomSmileyMgr)();
|
typedef UINT64 (*__GetCustomSmileyMgr)();
|
||||||
typedef UINT64 (*__SendCustomEmotion)(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
|
typedef UINT64 (*__SendCustomEmotion)(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
|
||||||
|
typedef UINT64 (*__JsApiShareAppMessage)(UINT64);
|
||||||
|
typedef UINT64 (*__InitJsConfig)(UINT64,UINT64);
|
||||||
|
typedef UINT64 (*__SendApplet)(UINT64,UINT64,UINT64,UINT64);
|
||||||
|
typedef UINT64 (*__SendAppletSecond)(UINT64,UINT64,UINT64,UINT64,UINT64,UINT64);
|
||||||
|
typedef UINT64 (*__GetAppInfoByWaid)(UINT64,UINT64);
|
||||||
|
typedef UINT64 (*__CopyShareAppMessageRequest)(UINT64,UINT64);
|
||||||
|
typedef UINT64 (*__NewWAUpdatableMsgInfo)(UINT64);
|
||||||
|
typedef UINT64 (*__FreeWAUpdatableMsgInfo)(UINT64);
|
||||||
|
typedef UINT64 (*__SendPatMsg)(UINT64,UINT64);
|
||||||
|
typedef UINT64 (*__GetOCRManager)();
|
||||||
|
typedef UINT64 (*__DoOCRTask)(UINT64,UINT64,UINT64,UINT64,UINT64);
|
||||||
|
|
||||||
|
|
||||||
} // namespace function
|
} // namespace function
|
||||||
@ -313,6 +324,26 @@ struct WeChatString {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct WeChatStr{
|
||||||
|
char * ptr;
|
||||||
|
INT64 buf;
|
||||||
|
INT64 len;
|
||||||
|
INT64 maxlen;
|
||||||
|
|
||||||
|
WeChatStr(const char* p) {
|
||||||
|
ptr = (char *)p;
|
||||||
|
buf = 0;
|
||||||
|
len = strlen(p);
|
||||||
|
maxlen = len | 0xF;
|
||||||
|
}
|
||||||
|
WeChatStr() {
|
||||||
|
ptr = NULL;
|
||||||
|
buf = 0;
|
||||||
|
len = 0;
|
||||||
|
maxlen = 0xF;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace prototype
|
} // namespace prototype
|
||||||
namespace offset {
|
namespace offset {
|
||||||
const UINT64 kGetAccountServiceMgr = 0x8c1230;
|
const UINT64 kGetAccountServiceMgr = 0x8c1230;
|
||||||
@ -404,6 +435,17 @@ const UINT64 kGetPreDownLoadMgr = 0x9996f0;
|
|||||||
const UINT64 kPushAttachTask = 0x9c0080;
|
const UINT64 kPushAttachTask = 0x9c0080;
|
||||||
const UINT64 kGetCustomSmileyMgr = 0x915c00;
|
const UINT64 kGetCustomSmileyMgr = 0x915c00;
|
||||||
const UINT64 kSendCustomEmotion = 0xec0a40;
|
const UINT64 kSendCustomEmotion = 0xec0a40;
|
||||||
|
const UINT64 kNewJsApiShareAppMessage = 0x13be1a0;
|
||||||
|
const UINT64 kInitJsConfig = 0x137bc00;
|
||||||
|
const UINT64 kSendApplet = 0x13c0920;
|
||||||
|
const UINT64 kSendAppletSecond = 0x13c1150;
|
||||||
|
const UINT64 kGetAppInfoByWaid = 0x13c5790;
|
||||||
|
const UINT64 kCopyShareAppMessageRequest = 0x13c0670;
|
||||||
|
const UINT64 kNewWAUpdatableMsgInfo = 0x919ca0;
|
||||||
|
const UINT64 kFreeWAUpdatableMsgInfo = 0x8fc230;
|
||||||
|
const UINT64 kSendPatMsg = 0x195f340;
|
||||||
|
const UINT64 kGetOCRManager = 0x999780;
|
||||||
|
const UINT64 kDoOCRTask = 0x190b2a0;
|
||||||
|
|
||||||
} // namespace offset
|
} // namespace offset
|
||||||
} // namespace V3_9_5_81
|
} // namespace V3_9_5_81
|
||||||
|
Loading…
x
Reference in New Issue
Block a user