Skip to content

Commit

Permalink
修复info_filePath
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoyaoo committed Dec 11, 2023
1 parent cdce82f commit 98430b7
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 6 deletions.
12 changes: 11 additions & 1 deletion doc/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,14 @@
- ### 十一、参数无效
1. 请检查参数是否正确,如果正确,请检查是否使用了中文输入法,如果使用了中文输入法,请切换为英文输入法
2. 检查路径是否正确,如果路径中有空格,请使用英文双引号包裹路径
2. 检查路径是否正确,如果路径中有空格,请使用英文双引号包裹路径
- ### 十二、如何获取微信数据库路径/数据库目录是什么/数据库在哪
1. 打开微信电脑版,登录微信
2. 打开微信
3. 打开设置
4. 选择文件管理
5. 点打开文件夹
6. 进入MSG文件夹
7. 就是这个文件夹就是微信数据库目录
24 changes: 19 additions & 5 deletions pywxdump/wx_info/get_wx_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
# 打开注册表路径
Expand Down
31 changes: 31 additions & 0 deletions tests/flassk_demo.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 98430b7

Please sign in to comment.