From 7994d4481764fb78f0ce5a0ca320a8467aa7aa88 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Fri, 26 Jan 2024 17:45:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/api/api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pywxdump/api/api.py b/pywxdump/api/api.py index 4646d07..923f8df 100644 --- a/pywxdump/api/api.py +++ b/pywxdump/api/api.py @@ -11,7 +11,7 @@ import os import time import shutil -from flask import Flask, request, render_template, g, Blueprint, send_file, make_response, session,send_file +from flask import Flask, request, render_template, g, Blueprint, send_file, make_response, session from pywxdump import analyzer, read_img_dat, read_audio, get_wechat_db, get_core_db from pywxdump.api.rjson import ReJson, RqJson from pywxdump.api.utils import read_session, save_session, error9999 @@ -248,15 +248,17 @@ def get_img(): return ReJson(0, out_bytes) else: return ReJson(1001, body=img_path_all) - + + @api.route('/api/video/', methods=["GET", 'POST']) def get_video(videoPath): wx_path = read_session(g.sf, "wx_path") - all_video_path = os.path.join(wx_path, videoPath) + all_video_path = os.path.join(wx_path, videoPath) if not os.path.exists(all_video_path): return ReJson(5002) return send_file(all_video_path) + @api.route('/api/audio/', methods=["GET", 'POST']) def get_audio(savePath): # savePath = request.args.get("savePath") From db6ffab06e184988fecfcbcab188fe721c1493e4 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Mon, 29 Jan 2024 11:44:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E8=AF=BB=E5=8F=96=E5=86=85=E5=AD=98=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/wx_info/get_wx_info.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pywxdump/wx_info/get_wx_info.py b/pywxdump/wx_info/get_wx_info.py index 99c67bb..c7e7c96 100644 --- a/pywxdump/wx_info/get_wx_info.py +++ b/pywxdump/wx_info/get_wx_info.py @@ -43,6 +43,21 @@ def get_info_wxid(h_process): return wxid +def get_info_filePath_base_wxid(h_process, wxid=""): + find_num = 10 + addrs = pattern_scan_all(h_process, wxid.encode() + br'\\Msg\\FTSContact', return_multiple=True, find_num=find_num) + filePath = [] + for addr in addrs: + win_addr_len = 260 + array = ctypes.create_string_buffer(win_addr_len) + if ReadProcessMemory(h_process, void_p(addr - win_addr_len + 50), array, win_addr_len, 0) == 0: return "None" + array = bytes(array).split(b"\\Msg")[0] + array = array.split(b"\00")[-1] + filePath.append(array.decode('utf-8', errors='ignore')) + filePath = max(filePath, key=filePath.count) if filePath else "None" + return filePath + + def get_info_filePath(wxid="all"): if not wxid: return "None" @@ -197,7 +212,9 @@ def read_info(version_list: dict = None, is_logging: bool = False, save_path: st addrLen = get_exe_bit(process.exe()) // 8 tmp_rd['wxid'] = get_info_wxid(Handle) - tmp_rd['filePath'] = get_info_filePath(tmp_rd['wxid']) if tmp_rd['wxid'] != "None" else "None" + tmp_rd['filePath'] = get_info_filePath_base_wxid(Handle, tmp_rd['wxid']) if tmp_rd['wxid'] != "None" else "None" + tmp_rd['filePath'] = get_info_filePath(tmp_rd['wxid']) if tmp_rd['wxid'] != "None" and tmp_rd[ + 'filePath'] == "None" else tmp_rd['filePath'] tmp_rd['key'] = get_key(tmp_rd['pid'], tmp_rd['filePath'], addrLen) if tmp_rd['filePath'] != "None" else "None" result.append(tmp_rd) From 23e3dd3c115b27f6ac2ef7ac9341a9f0d0f7cbd0 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Tue, 30 Jan 2024 00:21:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?session=E4=BF=9D=E5=AD=98=E6=9B=B4=E5=8A=A0?= =?UTF-8?q?=E5=90=88=E7=90=86=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/api/api.py | 4 ++-- pywxdump/server.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pywxdump/api/api.py b/pywxdump/api/api.py index 923f8df..43595a0 100644 --- a/pywxdump/api/api.py +++ b/pywxdump/api/api.py @@ -125,7 +125,7 @@ def contact_list(): limit = request.json.get("limit") contact_list = analyzer.get_contact_list(micro_path) - save_session(g.sf, "user_list", contact_list) + # save_session(g.sf, "user_list", contact_list) if limit: contact_list = contact_list[int(start):int(start) + int(limit)] return ReJson(0, contact_list) @@ -178,7 +178,7 @@ def contact_count_list(): # 降序 contact_list = sorted(contact_list, key=lambda x: x["chat_count"], reverse=True) - save_session(g.sf, "user_list", contact_list) + # save_session(g.sf, "user_list", contact_list) if word and word != "" and word != "undefined" and word != "null": contact_list = [contact for contact in contact_list if diff --git a/pywxdump/server.py b/pywxdump/server.py index 08bf6e1..c4ce292 100644 --- a/pywxdump/server.py +++ b/pywxdump/server.py @@ -32,7 +32,7 @@ def start_falsk(merge_path="", msg_path="", micro_path="", media_path="", wx_pat os.makedirs(tmp_path) print(f"[+] 创建临时文件夹:{tmp_path}") - session_file = os.path.join(tmp_path, "session") # 用于存放各种基础信息 + session_file = os.path.join(tmp_path, "session.conf") # 用于存放各种基础信息 from flask import Flask, g from flask_cors import CORS