修复info_filePath

This commit is contained in:
xaoyaoo 2023-12-11 13:26:46 +08:00
parent cdce82f92f
commit 98430b75fe
3 changed files with 61 additions and 6 deletions

View File

@ -78,4 +78,14 @@
- ### 十一、参数无效
1. 请检查参数是否正确,如果正确,请检查是否使用了中文输入法,如果使用了中文输入法,请切换为英文输入法
2. 检查路径是否正确,如果路径中有空格,请使用英文双引号包裹路径
2. 检查路径是否正确,如果路径中有空格,请使用英文双引号包裹路径
- ### 十二、如何获取微信数据库路径/数据库目录是什么/数据库在哪
1. 打开微信电脑版,登录微信
2. 打开微信
3. 打开设置
4. 选择文件管理
5. 点打开文件夹
6. 进入MSG文件夹
7. 就是这个文件夹就是微信数据库目录

View File

@ -107,15 +107,29 @@ def get_info_wxid(h_process):
def get_info_filePath(wxid="all"):
if not wxid:
return "None"
w_dir = "MyDocument:"
is_w_dir = False
try:
user_profile = os.environ.get("USERPROFILE")
path_3ebffe94 = os.path.join(user_profile, "AppData", "Roaming", "Tencent", "WeChat", "All Users", "config",
"3ebffe94.ini")
with open(path_3ebffe94, "r", encoding="utf-8") as f:
w_dir = f.read()
key = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r"Software\Tencent\WeChat", 0, winreg.KEY_READ)
value, _ = winreg.QueryValueEx(key, "FileSavePath")
winreg.CloseKey(key)
w_dir = value
is_w_dir = True
except Exception as e:
w_dir = "MyDocument:"
if not is_w_dir:
try:
user_profile = os.environ.get("USERPROFILE")
path_3ebffe94 = os.path.join(user_profile, "AppData", "Roaming", "Tencent", "WeChat", "All Users", "config",
"3ebffe94.ini")
with open(path_3ebffe94, "r", encoding="utf-8") as f:
w_dir = f.read()
is_w_dir = True
except Exception as e:
w_dir = "MyDocument:"
if w_dir == "MyDocument:":
try:
# 打开注册表路径

31
tests/flassk_demo.py Normal file
View File

@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-#
# -------------------------------------------------------------------------------
# Name: flassk_demo.py
# Description:
# Author: xaoyaoo
# Date: 2023/12/11
# -------------------------------------------------------------------------------
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/api/demo', methods=["get",'POST'])
def demo():
# 模拟不同的API情况
# 0: 请求成功
r_data = {
'code': 0,
'body': {
'message': 'Success!',
'data': {
'key': 'value'
}
},
'msg': 'success',
'extra': {}
}
return jsonify(r_data)
if __name__ == '__main__':
app.run(debug=True)