修改wxid获取方式,修复部分bug

This commit is contained in:
xaoyo 2023-11-28 16:58:29 +08:00
parent a273cf9f3e
commit 8ae144cd6d
3 changed files with 18 additions and 15 deletions

View File

@ -16,6 +16,7 @@
<details> <details>
<summary><strong>更新日志(点击展开)</strong></summary> <summary><strong>更新日志(点击展开)</strong></summary>
* 2023.11.28 修改wxid获取方式修复部分bug
* 2023.11.27 解决相对导入包的问题,完善错误提示 * 2023.11.27 解决相对导入包的问题,完善错误提示
* 2023.11.25 聊天记录查看工具bootstrap更换国内cdn * 2023.11.25 聊天记录查看工具bootstrap更换国内cdn
* 2023.11.22 添加all命令中解密错误数据日志写入文件,修复部分bug * 2023.11.22 添加all命令中解密错误数据日志写入文件,修复部分bug
@ -57,7 +58,8 @@
* 4.生成年度可视化报告 * 4.生成年度可视化报告
* 5.创建GUI图形界面方便使用 * 5.创建GUI图形界面方便使用
* 6.查看群聊中具体发言成员的ID [#31](https://github.com/xaoyaoo/PyWxDump/issues/31) * 6.查看群聊中具体发言成员的ID [#31](https://github.com/xaoyaoo/PyWxDump/issues/31)
* 7.完善操作文档,增加更多的使用方法 * 7.完善操作文档,增加更多的使用说明
* 8.增加数据库合并功能,方便查看
注: 欢迎大家提供更多的想法或者提供代码一起完善这个项目欢迎加入交流qq群577704006。 注: 欢迎大家提供更多的想法或者提供代码一起完善这个项目欢迎加入交流qq群577704006。
![img.png](./doc/img.png) ![img.png](./doc/img.png)

View File

@ -44,21 +44,21 @@ def pattern_scan_all(handle, pattern, *, return_multiple=False):
return page_found return page_found
if page_found: if page_found:
found += page_found found += page_found
if not return_multiple: if len(found) > 100:
return None break
return found return found
def get_info_wxid(h_process, n_size=64): def get_info_wxid(h_process, n_size=19):
pm = pymem.Pymem("WeChat.exe") # addrs = pymem.pattern.pattern_scan_all(h_process, b'wxid_', return_multiple=True)
# addrs = pymem.pattern.pattern_scan_all(pm.process_handle, b'wxid_', return_multiple=True) addrs = pattern_scan_all(h_process, b'wxid_', return_multiple=True)
addrs = pattern_scan_all(pm.process_handle, b'wxid_', return_multiple=True) wxids = []
for addr in addrs: for addr in addrs[0:100]:
wxidtmp = get_info_without_key(h_process, addr, n_size) wxidtmp = get_info_without_key(h_process, addr, n_size)
if wxidtmp.startswith("wxid_") and r'\FileStorage\MsgAttach' in wxidtmp: if wxidtmp.startswith("wxid_"):
wxid = wxidtmp.split(r'\FileStorage\MsgAttach')[0] wxids.append(wxidtmp.split('\\')[0])
return wxid wxid = max(wxids, key=wxids.count) if wxids else "None"
return "None" return wxid
# 读取内存中的key # 读取内存中的key
@ -122,7 +122,7 @@ def read_info(version_list, is_logging=False):
tmp_rd['mobile'] = get_info_without_key(Handle, mobile_baseaddr, 64) if bias_list[2] != 0 else "None" tmp_rd['mobile'] = get_info_without_key(Handle, mobile_baseaddr, 64) if bias_list[2] != 0 else "None"
tmp_rd['name'] = get_info_without_key(Handle, name_baseaddr, 64) if bias_list[0] != 0 else "None" tmp_rd['name'] = get_info_without_key(Handle, name_baseaddr, 64) if bias_list[0] != 0 else "None"
tmp_rd['mail'] = get_info_without_key(Handle, mail_baseaddr, 64) if bias_list[3] != 0 else "None" tmp_rd['mail'] = get_info_without_key(Handle, mail_baseaddr, 64) if bias_list[3] != 0 else "None"
tmp_rd['wxid'] = get_info_wxid(Handle, 64) tmp_rd['wxid'] = get_info_wxid(Handle)
tmp_rd['key'] = get_key(Handle, key_baseaddr, addrLen) if bias_list[4] != 0 else "None" tmp_rd['key'] = get_key(Handle, key_baseaddr, addrLen) if bias_list[4] != 0 else "None"
result.append(tmp_rd) result.append(tmp_rd)

View File

@ -3,7 +3,7 @@ from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh: with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read() long_description = fh.read()
version = "2.2.12" version = "2.2.13"
install_requires = [ install_requires = [
"psutil", "psutil",
@ -14,7 +14,8 @@ install_requires = [
"pyaudio", "pyaudio",
"requests", "requests",
"pillow", "pillow",
"pyahocorasick" "pyahocorasick",
"flask",
] ]
setup( setup(