Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
java-徐
ComWeChatRobot
提交
6e2ece38
C
ComWeChatRobot
项目概览
java-徐
/
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,体验更适合开发者的 AI 搜索 >>
提交
6e2ece38
编写于
4月 18, 2022
作者:
L
ljc545w
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复部分已知Bug
上级
6c267e45
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
10 deletion
+13
-10
CWeChatRobot/DbBackup.cpp
CWeChatRobot/DbBackup.cpp
+4
-4
DWeChatRobot/DbBackup.cpp
DWeChatRobot/DbBackup.cpp
+7
-4
DWeChatRobot/SelfInfo.cpp
DWeChatRobot/SelfInfo.cpp
+1
-1
DWeChatRobot/dllmain.cpp
DWeChatRobot/dllmain.cpp
+1
-1
Release/CWeChatRobot.exe
Release/CWeChatRobot.exe
+0
-0
Release/DWeChatRobot.dll
Release/DWeChatRobot.dll
+0
-0
未找到文件。
CWeChatRobot/DbBackup.cpp
浏览文件 @
6e2ece38
...
...
@@ -8,14 +8,14 @@ struct BackupParams {
BOOL
BackupSQLiteDB
(
DWORD
DbHandle
,
BSTR
savepath
)
{
if
(
!
hProcess
)
return
0
;
return
1
;
DWORD
dwHandle
=
0x0
;
DWORD
dwId
=
0x0
;
DWORD
dwWriteSize
=
0x0
;
LPVOID
savepathAddr
=
VirtualAllocEx
(
hProcess
,
NULL
,
1
,
MEM_COMMIT
,
PAGE_READWRITE
);
BackupParams
*
paramAndFunc
=
(
BackupParams
*
)
::
VirtualAllocEx
(
hProcess
,
0
,
sizeof
(
BackupParams
),
MEM_COMMIT
,
PAGE_READWRITE
);
if
(
!
savepathAddr
||
!
paramAndFunc
)
return
0
;
return
1
;
char
*
a_savepath
=
_com_util
::
ConvertBSTRToString
(
savepath
);
if
(
savepathAddr
)
WriteProcessMemory
(
hProcess
,
savepathAddr
,
a_savepath
,
strlen
(
a_savepath
)
+
1
,
&
dwWriteSize
);
...
...
@@ -34,9 +34,9 @@ BOOL BackupSQLiteDB(DWORD DbHandle, BSTR savepath) {
CloseHandle
(
hThread
);
}
else
{
return
0
;
return
1
;
}
VirtualFreeEx
(
hProcess
,
savepathAddr
,
0
,
MEM_RELEASE
);
VirtualFreeEx
(
hProcess
,
paramAndFunc
,
0
,
MEM_RELEASE
);
return
dwHandle
==
1
;
return
dwHandle
;
}
\ No newline at end of file
DWeChatRobot/DbBackup.cpp
浏览文件 @
6e2ece38
...
...
@@ -34,6 +34,7 @@
#define IDA_BASE 0x10000000
BOOL
SQLite3_Backup_Init_Patched
=
FALSE
;
DWORD
lpAddressBackupDB
=
0x0
;
typedef
int
(
__cdecl
*
Sqlite3_open
)(
const
char
*
,
DWORD
*
);
typedef
DWORD
(
__cdecl
*
Sqlite3_backup_init
)(
DWORD
,
const
char
*
,
DWORD
,
const
char
*
);
...
...
@@ -45,7 +46,6 @@ typedef int(__cdecl* Sqlite3_backup_finish)(DWORD);
typedef
int
(
__cdecl
*
Sqlite3_errcode
)(
DWORD
);
typedef
int
(
__cdecl
*
Sqlite3_close
)(
DWORD
);
DWORD
OffsetFromIdaAddr
(
DWORD
idaAddr
)
{
return
idaAddr
-
IDA_BASE
;
}
...
...
@@ -130,8 +130,9 @@ int BackupSQLiteDB(DWORD DbHandle,const char* BackupFile)
{
DWORD
wxBaseAddress
=
GetWeChatWinBase
();
PatchSQLite3_Backup_Init
();
// 请不要注释掉这一行,也不要对其做任何改动,如果你不希望备份完成后微信崩溃
#ifdef _DEBUG
cout
<<
"开始备份,文件保存至: "
<<
BackupFile
<<
endl
;
#endif
DWORD
address_sqlite3_open
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x1138ACD0
);
DWORD
address_sqlite3_backup_init
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x1131C110
);
DWORD
address_sqlite3_backup_step
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x1131C510
);
...
...
@@ -140,7 +141,7 @@ int BackupSQLiteDB(DWORD DbHandle,const char* BackupFile)
DWORD
address_sqlite3_close
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x113880A0
);
DWORD
address_sqlite3_backup_remaining
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x1131CC50
);
DWORD
address_sqlite3_backup_pagecount
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x1131CC60
);
DWORD
address_sqlite3_errcode
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x113
565
70
);
DWORD
address_sqlite3_errcode
=
wxBaseAddress
+
OffsetFromIdaAddr
(
0x113
899
70
);
const
char
*
myMain
=
"main"
;
int
rc
=
backupDb
(
DbHandle
,
...
...
@@ -156,8 +157,10 @@ int BackupSQLiteDB(DWORD DbHandle,const char* BackupFile)
address_sqlite3_errcode
,
address_sqlite3_close
,
XProgress
);
#ifdef _DEBUG
cout
<<
"备份完成: "
<<
BackupFile
<<
endl
;
return
rc
==
1
;
#endif
return
rc
;
}
BOOL
BackupSQLiteDBRemote
(
LPVOID
lpParameter
)
{
...
...
DWeChatRobot/SelfInfo.cpp
浏览文件 @
6e2ece38
...
...
@@ -67,7 +67,7 @@ DWORD GetSelfInfoRemote() {
}
else
{
temp
=
(
char
*
)
SelfInfoAddr
[
i
];
if
(
strlen
(
temp
)
==
0
)
if
(
temp
==
NULL
||
strlen
(
temp
)
==
0
)
temp
=
(
char
*
)
"null"
;
}
wchar_t
*
wtemp
=
new
wchar_t
[
strlen
(
temp
)
+
1
];
...
...
DWeChatRobot/dllmain.cpp
浏览文件 @
6e2ece38
...
...
@@ -23,7 +23,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
printf
(
"CheckFriendStatus 0x%08X
\n
"
,
(
DWORD
)
CheckFriendStatus
);
printf
(
"GetChatRoomMembers 0x%08X
\n
"
,
(
DWORD
)
GetChatRoomMembers
);
printf
(
"ExecuteSql 0x%08X
\n
"
,
(
DWORD
)
ExecuteSQL
);
printf
(
"BackupSQLiteDB 0x%08X
\n
"
,
(
DWORD
)
BackupSQLiteDB
);
printf
(
"BackupSQLiteDB 0x%08X
\n
"
,
(
DWORD
)
BackupSQLiteDB
Remote
);
#endif
break
;
}
...
...
Release/CWeChatRobot.exe
浏览文件 @
6e2ece38
无法预览此类型文件
Release/DWeChatRobot.dll
浏览文件 @
6e2ece38
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录