mirror of
https://github.com/ttttupup/wxhelper.git
synced 2024-11-23 02:39:25 +08:00
341 lines
8.1 KiB
Markdown
341 lines
8.1 KiB
Markdown
#### 编译构建
|
||
环境:
|
||
cl.exe目录= c:/cl.exe
|
||
ml64.exe目录 =c:/ml64.exe
|
||
vcpkg目录 = c:/vcpkg
|
||
wxhelper目录 = c:/wxhelper
|
||
```
|
||
|
||
cd wxhelper/app/3rdparty
|
||
git clone https://github.com/microsoft/Detours.git
|
||
git clone https://github.com/gabime/spdlog.git
|
||
git clone https://github.com/nlohmann/json.git
|
||
或者使用vcpkg 安装相应库
|
||
vcpkg install detours:x64-windows
|
||
vcpkg install nlohmann-json:x64-windows
|
||
vcpkg install spdlog:x64-windows
|
||
|
||
cd wxhelper/cmake
|
||
copy detours.cmake wxhelper/app/3rdparty/Detours/CMakeLists.txt
|
||
|
||
cd wxhelper
|
||
mkdir build
|
||
cd build
|
||
cmake -DCMAKE_C_COMPILER=cl.exe \
|
||
-DCMAKE_CXX_COMPILER=cl.exe \
|
||
-DCMAKE_ASM_MASM_COMPILER=ml64.exe \
|
||
-DCMAKE_BUILD_TYPE=Debug \
|
||
-DCMAKE_INSTALL_PREFIX=C:/wxhelper/install/x64-debug \
|
||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=C:/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||
-SC:c:/wxhelper \
|
||
-BC:c:/wxhelper/build/x64-debug\
|
||
-G Ninja
|
||
cmake --build ..
|
||
```
|
||
如果有错误按错误提示修正即可。
|
||
|
||
## 3.9.9.43版本,http接口文档,文档仅供参考。
|
||
|
||
### 简单说明:
|
||
所有接口只支持post方法。
|
||
全部使用json格式。
|
||
格式: http://host:port/api/xxxx
|
||
host: 绑定的host
|
||
port: 监听的端口
|
||
xxxx: 对应的功能路径
|
||
返回结构的json格式:
|
||
``` javascript
|
||
{
|
||
"code": 1,
|
||
"data": {},
|
||
"msg": "success"
|
||
}
|
||
```
|
||
code: 错误码
|
||
msg: 成功/错误信息
|
||
data: 接口返回的数据
|
||
|
||
### 配置文件
|
||
wechat目录下config.ini 配置文件的默认配置
|
||
// HiddenDll : 0.不隐藏注入dll 1.隐藏dll
|
||
// HttpServerPort :dll自身提供的http服务的端口
|
||
// HttpServerHost :dll自身提供的http服务的监听地址
|
||
// RecvMessageMode:开启消息hook时使用接收消息的方式. tcp | http
|
||
// tcp模式下通过tcp连接发送消息,http模式下通过http发送消息
|
||
// RecvTcpIp :接收消息绑定的ip
|
||
// RecvTcpPort:tcp模式下绑定的端口
|
||
// RecvHttpUrl:http模式下推送的接口地址
|
||
// RecvHttpTimeout: http模式下的超时时间
|
||
|
||
HiddenDll=0,
|
||
HttpServerPort=80,
|
||
HttpServerHost=http://0.0.0.0,
|
||
RecvMessageMode=tcp,
|
||
RecvTcpIp=127.0.0.1,
|
||
RecvTcpPort=19099,
|
||
RecvHttpUrl=127.0.0.1,
|
||
RecvHttpTimeout=3000,
|
||
|
||
|
||
|
||
#### 1.hook消息**
|
||
###### 接口功能
|
||
> hook接收文本消息,图片消息,群消息.该接口将hook的消息通过tcp回传给本地的端口。
|
||
enableHttp=1时,使用url,timeout参数配置服务端的接收地址。请求为post,Content-Type 为json。
|
||
enableHttp=0时,使用ip,port的tcp服务回传消息。
|
||
|
||
###### 接口地址
|
||
> [/api/hookSyncMsg](/api/hookSyncMsg)
|
||
|
||
###### HTTP请求方式
|
||
> POST JSON
|
||
|
||
###### 请求参数
|
||
|参数|必选|类型|说明|
|
||
|---|---|---|---|
|
||
|
||
|
||
###### 返回字段
|
||
|返回字段|字段类型|说明 |
|
||
|---|---|---|
|
||
|code|int|返回状态,0成功, 非0失败|
|
||
|data|object|null|
|
||
|msg|string|成功提示|
|
||
|
||
###### 接口示例
|
||
入参:
|
||
``` javascript
|
||
|
||
```
|
||
响应:
|
||
``` javascript
|
||
{"code":0,"msg":"success","data":null}
|
||
```
|
||
|
||
#### 2.取消hook消息**
|
||
###### 接口功能
|
||
> 取消hook消息
|
||
|
||
###### 接口地址
|
||
> [/api/unhookSyncMsg](/api/unhookSyncMsg)
|
||
|
||
###### HTTP请求方式
|
||
> POST JSON
|
||
|
||
###### 请求参数
|
||
|参数|必选|类型|说明|
|
||
|---|---|---|---|
|
||
|
||
|
||
###### 返回字段
|
||
|返回字段|字段类型|说明 |
|
||
|---|---|---|
|
||
|code|int|返回状态,0成功, 非0失败|
|
||
|data|object|null|
|
||
|msg|string|成功提示|
|
||
|
||
|
||
###### 接口示例
|
||
入参:
|
||
``` javascript
|
||
|
||
```
|
||
响应:
|
||
``` javascript
|
||
{"code":0,"msg":"success","data":null}
|
||
```
|
||
#### 3.获取数据库信息**
|
||
###### 接口功能
|
||
> 获取数据库信息和句柄
|
||
|
||
###### 接口地址
|
||
> [/api/getDBInfo](/api/getDBInfo)
|
||
|
||
###### HTTP请求方式
|
||
> POST JSON
|
||
|
||
###### 请求参数
|
||
|参数|必选|类型|说明|
|
||
|---|---|---|---|
|
||
|
||
|
||
###### 返回字段
|
||
|返回字段|字段类型|说明 |
|
||
|---|---|---|
|
||
|code|int|返回状态,0成功, 非0失败|
|
||
|msg|string|返回信息|
|
||
|data|array|好友信息|
|
||
|  databaseName|string|数据库名称|
|
||
|  handle|number|句柄|
|
||
|  tables|array|表信息|
|
||
|    name|string|表名|
|
||
|    rootpage|string|rootpage|
|
||
|    sql|string|ddl语句|
|
||
|    tableName|string|表名|
|
||
|
||
|
||
###### 接口示例
|
||
入参:
|
||
``` javascript
|
||
|
||
```
|
||
响应:
|
||
``` javascript
|
||
{
|
||
"code": 1,
|
||
"data": [
|
||
{
|
||
"databaseName": "MicroMsg.db",
|
||
"handle": 1755003930784,
|
||
"tables": [
|
||
{
|
||
"name": "Contact",
|
||
"rootpage": "2",
|
||
"sql": "CREATE TABLE Contact(UserName TEXT PRIMARY KEY ,Alias TEXT,EncryptUserName TEXT,DelFlag INTEGER DEFAULT 0,Type INTEGER DEFAULT 0,VerifyFlag INTEGER DEFAULT 0,Reserved1 INTEGER DEFAULT 0,Reserved2 INTEGER DEFAULT 0,Reserved3 TEXT,Reserved4 TEXT,Remark TEXT,NickName TEXT,LabelIDList TEXT,DomainList TEXT,ChatRoomType int,PYInitial TEXT,QuanPin TEXT,RemarkPYInitial TEXT,RemarkQuanPin TEXT,BigHeadImgUrl TEXT,SmallHeadImgUrl TEXT,HeadImgMd5 TEXT,ChatRoomNotify INTEGER DEFAULT 0,Reserved5 INTEGER DEFAULT 0,Reserved6 TEXT,Reserved7 TEXT,ExtraBuf BLOB,Reserved8 INTEGER DEFAULT 0,Reserved9 INTEGER DEFAULT 0,Reserved10 TEXT,Reserved11 TEXT)",
|
||
"tableName": "Contact"
|
||
}
|
||
]
|
||
}
|
||
],
|
||
"msg":"success"
|
||
}
|
||
```
|
||
|
||
|
||
#### 4.查询数据库**
|
||
###### 接口功能
|
||
> 查询数据库
|
||
|
||
###### 接口地址
|
||
> [/api/execSql](/api/execSql)
|
||
|
||
###### HTTP请求方式
|
||
> POST JSON
|
||
|
||
###### 请求参数
|
||
|参数|必选|类型|说明|
|
||
|---|---|---|---|
|
||
|dbHandle |true |number| |
|
||
|sql |true |string| 执行的sql |
|
||
|
||
###### 返回字段
|
||
|返回字段|字段类型|说明 |
|
||
|---|---|---|
|
||
|code|int|返回状态,0成功, 非0失败|
|
||
|msg|string|返回信息|
|
||
|data|array|sqlite返回的结果|
|
||
|
||
|
||
|
||
###### 接口示例
|
||
入参:
|
||
``` javascript
|
||
{
|
||
"dbHandle":2006119800400,
|
||
"sql":"select * from MSG where localId =301;"
|
||
}
|
||
```
|
||
响应:
|
||
``` javascript
|
||
{
|
||
"code": 1,
|
||
"data": [
|
||
[
|
||
"localId",
|
||
"TalkerId",
|
||
"MsgSvrID",
|
||
"Type",
|
||
"SubType",
|
||
"IsSender",
|
||
"CreateTime",
|
||
"Sequence",
|
||
"StatusEx",
|
||
"FlagEx",
|
||
"Status",
|
||
"MsgServerSeq",
|
||
"MsgSequence",
|
||
"StrTalker",
|
||
"StrContent",
|
||
"DisplayContent",
|
||
"Reserved0",
|
||
"Reserved1",
|
||
"Reserved2",
|
||
"Reserved3",
|
||
"Reserved4",
|
||
"Reserved5",
|
||
"Reserved6",
|
||
"CompressContent",
|
||
"BytesExtra",
|
||
"BytesTrans"
|
||
],
|
||
[
|
||
"301",
|
||
"1",
|
||
"8824834301214701891",
|
||
"1",
|
||
"0",
|
||
"0",
|
||
"1685401473",
|
||
"1685401473000",
|
||
"0",
|
||
"0",
|
||
"2",
|
||
"1",
|
||
"795781866",
|
||
"wxid_123",
|
||
"testtest",
|
||
"",
|
||
"0",
|
||
"2",
|
||
"",
|
||
"",
|
||
"",
|
||
"",
|
||
"",
|
||
"",
|
||
"CgQIEBAAGo0BCAcSiAE8bXNnc291cmNlPJPHNpZ25hdHVyZT52MV9wd12bTZyRzwvc2lnbmF0dXJPgoJPHRtcF9ub2RlPgoJCTxwsaXNoZXItaWQ+Jmx0OyFbQ0RBVEFbXV0mZ3Q7PC9wdWJsaXNoZXItaWQ+Cgk8L3RtcF9ub2RlPgo8L21zZ3NvdXJjZT4KGiQIAhIgNDE1MDA0NjRhZTRmMjk2NjhjMzY2ZjFkOTdmMjAwNDg=",
|
||
""
|
||
]
|
||
],
|
||
"msg": "success"
|
||
}
|
||
```
|
||
|
||
|
||
#### 5.发送文本消息**
|
||
###### 接口功能
|
||
> 发送文本消息
|
||
|
||
###### 接口地址
|
||
> [/api/sendTextMsg](/api/sendTextMsg)
|
||
|
||
###### HTTP请求方式
|
||
> POST JSON
|
||
|
||
###### 请求参数
|
||
|参数|必选|类型|说明|
|
||
|---|---|---|---|
|
||
|wxid |true |string| 接收人wxid |
|
||
|msg|true |string|消息文本内容|
|
||
|
||
###### 返回字段
|
||
|返回字段|字段类型|说明 |
|
||
|---|---|---|
|
||
|code|int|返回状态,不为0成功, 0失败|
|
||
|msg|string|成功提示|
|
||
|data|object|null|
|
||
|
||
|
||
###### 接口示例
|
||
|
||
入参:
|
||
``` javascript
|
||
{
|
||
"wxid": "filehelper",
|
||
"msg": "1112222"
|
||
}
|
||
```
|
||
响应:
|
||
``` javascript
|
||
{"code":345686720,"msg":"success","data":null}
|
||
``` |