Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
被猫吃掉的鱼Z
ComWeChatRobot
提交
9ed83376
C
ComWeChatRobot
项目概览
被猫吃掉的鱼Z
/
ComWeChatRobot
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ComWeChatRobot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9ed83376
编写于
4月 21, 2022
作者:
L
ljc545w
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加获取公众号数据库句柄
上级
6e2ece38
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
4 deletion
+21
-4
DWeChatRobot/GetDbHandles.cpp
DWeChatRobot/GetDbHandles.cpp
+20
-3
Python/test.py
Python/test.py
+1
-1
Release/DWeChatRobot.dll
Release/DWeChatRobot.dll
+0
-0
未找到文件。
DWeChatRobot/GetDbHandles.cpp
浏览文件 @
9ed83376
#include "pch.h"
#define SqlHandleBaseOffset 0x6704F3FC - 0x64E20000
// 联系人相关库
#define SqlHandleMicroMsgOffset 0x222F3FC
// 公众号相关库
#define SqlHandlePublicMsgOffset 0x22553D0
vector
<
DbInfoStruct
>
dbs
;
...
...
@@ -23,9 +26,10 @@ DWORD GetDbHandlesRemote() {
void
GetDbHandles
()
{
dbs
.
clear
();
DWORD
WeChatWinBase
=
GetWeChatWinBase
();
DWORD
SqlHandleBaseAddr
=
WeChatWinBase
+
SqlHandle
Base
Offset
;
DWORD
SqlHandleBaseAddr
=
WeChatWinBase
+
SqlHandle
MicroMsg
Offset
;
DWORD
SqlHandleBeginAddr
=
0x0
;
DWORD
SqlHandleEndAddr
=
0x0
;
DWORD
SqlHandlePublicMsgAddr
=
*
(
DWORD
*
)(
WeChatWinBase
+
SqlHandlePublicMsgOffset
);
__asm
{
mov
eax
,
[
SqlHandleBaseAddr
];
mov
ecx
,
[
eax
];
...
...
@@ -35,9 +39,10 @@ void GetDbHandles() {
mov
eax
,
[
ecx
+
0x4
];
mov
SqlHandleEndAddr
,
eax
;
}
DWORD
dwHandle
=
0x0
;
wstring
dbnames
=
L""
;
while
(
SqlHandleBeginAddr
<
SqlHandleEndAddr
)
{
DWORD
dwHandle
=
*
(
DWORD
*
)
SqlHandleBeginAddr
;
dwHandle
=
*
(
DWORD
*
)
SqlHandleBeginAddr
;
SqlHandleBeginAddr
+=
0x4
;
if
(
SqlHandleBeginAddr
==
SqlHandleEndAddr
)
break
;
...
...
@@ -51,6 +56,18 @@ void GetDbHandles() {
ExecuteSQL
(
*
(
DWORD
*
)(
dwHandle
+
0x64
),
"select * from sqlite_master where type=
\"
table
\"
;"
,(
DWORD
)
GetDbInfo
,
&
db
);
dbs
.
push_back
(
db
);
}
for
(
int
i
=
1
;
i
<
4
;
i
++
)
{
dwHandle
=
*
((
DWORD
*
)(
SqlHandlePublicMsgAddr
+
i
*
0x4
));
if
(
dbnames
.
find
((
wchar_t
*
)(
*
(
DWORD
*
)(
dwHandle
+
0x78
)),
0
)
!=
wstring
::
npos
)
continue
;
DbInfoStruct
db
=
{
0
};
dbnames
+=
(
wchar_t
*
)(
*
(
DWORD
*
)(
dwHandle
+
0x78
));
db
.
dbname
=
(
wchar_t
*
)(
*
(
DWORD
*
)(
dwHandle
+
0x78
));
db
.
l_dbname
=
wcslen
(
db
.
dbname
);
db
.
handle
=
*
(
DWORD
*
)(
dwHandle
+
0x64
);
ExecuteSQL
(
*
(
DWORD
*
)(
dwHandle
+
0x64
),
"select * from sqlite_master where type=
\"
table
\"
;"
,
(
DWORD
)
GetDbInfo
,
&
db
);
dbs
.
push_back
(
db
);
}
// 添加一个空结构体,作为读取结束标志
DbInfoStruct
db_end
=
{
0
};
dbs
.
push_back
(
db_end
);
...
...
Python/test.py
浏览文件 @
9ed83376
...
...
@@ -112,4 +112,4 @@ def test_BackupDb():
wx
.
StopService
()
if
__name__
==
'__main__'
:
test_BackupDb
()
\ No newline at end of file
test_ExecuteSQL
()
\ No newline at end of file
Release/DWeChatRobot.dll
浏览文件 @
9ed83376
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录