Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
888H355
ComWeChatRobot
提交
f40e2afd
C
ComWeChatRobot
项目概览
888H355
/
ComWeChatRobot
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
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,发现更多精彩内容 >>
未验证
提交
f40e2afd
编写于
7月 27, 2022
作者:
J
Jack Li
提交者:
GitHub
7月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #65 from amchii/fix-multiprocess
修复多开微信情况下获取个人信息共用字符串的问题
上级
4048e380
e127ae85
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
24 addition
and
17 deletion
+24
-17
.gitignore
.gitignore
+5
-0
CWeChatRobot/SelfInfo.cpp
CWeChatRobot/SelfInfo.cpp
+5
-4
CWeChatRobot/pch.cpp
CWeChatRobot/pch.cpp
+11
-11
CWeChatRobot/pch.h
CWeChatRobot/pch.h
+2
-1
CWeChatRobot/robotdata.h
CWeChatRobot/robotdata.h
+1
-1
Release/CWeChatRobot.exe
Release/CWeChatRobot.exe
+0
-0
未找到文件。
.gitignore
浏览文件 @
f40e2afd
...
...
@@ -18,3 +18,8 @@
packages
mongoose.c
mongoose.h
# VSCode
.vscode
# JetBrians IDE
.idea
CWeChatRobot/SelfInfo.cpp
浏览文件 @
f40e2afd
...
...
@@ -20,8 +20,9 @@ VOID DeleteSelfInfoCache(DWORD pid,HANDLE hProcess) {
}
std
::
wstring
GetSelfInfo
(
DWORD
pid
)
{
if
(
SelfInfoString
.
compare
(
L""
))
{
return
SelfInfoString
;
if
(
PidToSelfInfoString
.
count
(
pid
)
!=
0
)
{
return
PidToSelfInfoString
[
pid
];
}
HANDLE
hProcess
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
pid
);
if
(
!
hProcess
)
...
...
@@ -48,14 +49,14 @@ std::wstring GetSelfInfo(DWORD pid) {
wchar_t
*
wmessage
=
new
wchar_t
[
selfinfo
.
length
+
1
];
ZeroMemory
(
wmessage
,
(
selfinfo
.
length
+
1
)
*
2
);
ReadProcessMemory
(
hProcess
,
(
LPCVOID
)
selfinfo
.
message
,
wmessage
,
selfinfo
.
length
*
2
,
&
dwWriteSize
);
SelfInfoString
+
=
wmessage
;
PidToSelfInfoString
[
pid
]
=
wmessage
;
delete
[]
wmessage
;
wmessage
=
NULL
;
}
DeleteSelfInfoCache
(
pid
,
hProcess
);
CloseHandle
(
hProcess
);
return
SelfInfoString
;
return
PidToSelfInfoString
[
pid
]
;
}
BOOL
isWxLogin
(
DWORD
pid
)
{
...
...
CWeChatRobot/pch.cpp
浏览文件 @
f40e2afd
// pch.cpp: 与预编译标头对应的源文件
// pch.cpp: 与预编译标头对应的源文件
#include "pch.h"
//
当使用预编译的头时,需要使用此源文件,编译才能成功。
//
当使用预编译的头时,需要使用此源文件,编译才能成功。
DWORD
SendImageOffset
=
0x0
;
DWORD
SendTextOffset
=
0x0
;
DWORD
SendFileOffset
=
0x0
;
...
...
@@ -56,7 +56,7 @@ DWORD UnHookVoiceMsgRemoteOffset = 0x0;
DWORD
ChangeWeChatVerRemoteOffset
=
0x0
;
wstring
SelfInfoString
=
L""
;
map
<
DWORD
,
wstring
>
PidToSelfInfoString
;
BOOL
isFileExists_stat
(
string
&
name
)
{
struct
stat
buffer
;
...
...
@@ -132,7 +132,7 @@ BOOL GetProcOffset(wchar_t* workPath) {
swprintf_s
(
dllpath
,
MAX_PATH
,
L"%ws%ws%ws"
,
workPath
,
L"
\\
"
,
dllname
);
string
name
=
_com_util
::
ConvertBSTRToString
((
BSTR
)
dllpath
);
if
(
!
isFileExists_stat
(
name
))
{
MessageBoxA
(
NULL
,
name
.
c_str
(),
"
文件不存在"
,
MB_ICONWARNING
);
MessageBoxA
(
NULL
,
name
.
c_str
(),
"
文件不存在
"
,
MB_ICONWARNING
);
return
0
;
}
HMODULE
hd
=
LoadLibrary
(
dllpath
);
...
...
@@ -242,11 +242,11 @@ BOOL GetProcOffset(wchar_t* workPath) {
}
DWORD
GetWeChatPid
()
{
HWND
hCalc
=
FindWindow
(
NULL
,
L"
微信"
);
HWND
hCalc
=
FindWindow
(
NULL
,
L"
微信
"
);
DWORD
wxPid
=
0
;
GetWindowThreadProcessId
(
hCalc
,
&
wxPid
);
if
(
wxPid
==
0
)
{
hCalc
=
FindWindow
(
NULL
,
L"
微信测试版"
)
;
hCalc
=
FindWindow
(
NULL
,
L"
微信测试版
"
);
GetWindowThreadProcessId
(
hCalc
,
&
wxPid
);
}
return
wxPid
;
...
...
@@ -257,8 +257,8 @@ DWORD StartRobotService(DWORD pid) {
wchar_t
*
workPath
=
(
wchar_t
*
)
wworkPath
.
c_str
();
if
(
!
GetProcOffset
(
workPath
))
{
wchar_t
info
[
200
]
=
{
0
};
swprintf_s
(
info
,
200
,
L"COM
无法加载位于%ws的%ws
!"
,
workPath
,
dllname
);
MessageBox
(
NULL
,
info
,
L"
致命错误!"
,
MB_ICONWARNING
);
swprintf_s
(
info
,
200
,
L"COM
无法加载位于%ws的
%ws!"
,
workPath
,
dllname
);
MessageBox
(
NULL
,
info
,
L"
致命错误
!"
,
MB_ICONWARNING
);
return
1
;
};
bool
status
=
Inject
(
pid
,
workPath
);
...
...
@@ -270,7 +270,7 @@ DWORD StopRobotService(DWORD pid) {
if
(
pid
==
0
)
return
cpid
;
RemoveDll
(
pid
);
ZeroMemory
((
wchar_t
*
)
SelfInfoString
.
c_str
(),
SelfInfoString
.
length
()
*
2
+
2
);
PidToSelfInfoString
.
erase
(
pid
);
return
0
;
}
...
...
@@ -279,7 +279,7 @@ wstring GetComWorkPath() {
GetModuleFileName
(
NULL
,
szFilePath
,
MAX_PATH
);
wstring
wpath
=
szFilePath
;
int
pos
=
wpath
.
find_last_of
(
L"
\\
"
);
wpath
=
wpath
.
substr
(
0
,
pos
);
wpath
=
wpath
.
substr
(
0
,
pos
);
return
wpath
;
}
...
...
@@ -324,7 +324,7 @@ tstring GetWeChatVerStr() {
return
verStr
;
}
static
bool
CloseAllWxProcessMutexHandle
()
static
bool
CloseAllWxProcessMutexHandle
()
{
HANDLE
hsnapshot
=
CreateToolhelp32Snapshot
(
TH32CS_SNAPPROCESS
,
0
);
if
(
hsnapshot
==
INVALID_HANDLE_VALUE
)
...
...
CWeChatRobot/pch.h
浏览文件 @
f40e2afd
...
...
@@ -15,13 +15,14 @@
#include "stdlib.h"
#include <tchar.h>
#include <stdio.h>
#include <
w
indows.h>
#include <
W
indows.h>
#include <TlHelp32.h>
#include <atlconv.h>
#include <tchar.h>
#include <sys/stat.h>
#include <direct.h>
#include <vector>
#include <map>
#include <comutil.h>
#pragma comment(lib, "comsuppw.lib")
...
...
CWeChatRobot/robotdata.h
浏览文件 @
f40e2afd
...
...
@@ -50,7 +50,7 @@ extern DWORD VerifyFriendApplyOffset;
extern
DWORD
GetSelfInfoOffset
;
extern
DWORD
DeleteSelfInfoCacheOffset
;
extern
wstring
SelfInfoString
;
extern
map
<
DWORD
,
wstring
>
PidTo
SelfInfoString
;
extern
DWORD
isWxLoginOffset
;
extern
DWORD
CheckFriendStatusRemoteOffset
;
...
...
Release/CWeChatRobot.exe
浏览文件 @
f40e2afd
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录