daenwxhook
时间: 2023-08-01 09:08:51 浏览: 210
xHook
3星 · 编辑精心推荐
DaenWxHook是一个注入器,用于将DaenWxHook.dll模块注入到指定的进程中。通过调用别人写好的模块,注入器的代码并不多。为了方便使用,可以在注入器中添加一行代码,自动填写DaenWxHook.dll的位置,只需要将注入器和dll放在同一目录下即可。\[1\]
对于发送消息功能,可以使用以下代码往指定的端口(默认为8055)发送post消息:
```python
import json
import requests
def send_msg(wxid, is_img, msg):
if is_img:
payload = {"type": "Q0010", "data": {"wxid": wxid, "path": msg}}
else:
payload = {"type": "Q0001", "data": {"wxid": wxid, "msg": msg}}
headers = {
'User-Agent': 'apifox/1.0.0 (https://www.apifox.cn)',
'Content-Type': 'application/json'
}
url = 'http://127.0.0.1:8055/DaenWxHook/client/'
response = requests.post(url, json=payload, headers=headers)
print('状态码:', response.status_code)
print('响应头信息:', response.headers)
print('响应正文:', response.text)
def send_txt_msg(wxid, txt):
send_msg(wxid, False, txt)
def send_img_msg(wxid, img_path):
send_msg(wxid, True, img_path)
```
\[2\]
需要注意的是,使用DaenWxHook.dll时需要设置callBackUrl和port参数。callBackUrl是一个用于接收微信数据的服务器,DaenWxHook.dll会向其推送数据。而port参数则是DaenWxHook.dll启动的用于获取微信操作指令的http服务器的端口号。\[3\]
#### 引用[.reference_title]
- *1* *3* [PC端微信HOOK并与Python对接](https://blog.csdn.net/as604049322/article/details/126386213)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Python基于PC版微信实现机器人](https://blog.csdn.net/huachao1001/article/details/126215530)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文