Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
被猫吃掉的鱼Z
ComWeChatRobot
提交
00678b2f
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,发现更多精彩内容 >>
提交
00678b2f
编写于
3月 17, 2022
作者:
L
ljc545w
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
解决部分已知Bug
上级
0ff0830a
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
40 addition
and
24 deletion
+40
-24
CWeChatRobot/FriendList.cpp
CWeChatRobot/FriendList.cpp
+3
-1
CWeChatRobot/InjertDll.cpp
CWeChatRobot/InjertDll.cpp
+1
-1
CWeChatRobot/SelfInfo.cpp
CWeChatRobot/SelfInfo.cpp
+1
-1
CWeChatRobot/SendArticle.cpp
CWeChatRobot/SendArticle.cpp
+3
-3
CWeChatRobot/SendCard.cpp
CWeChatRobot/SendCard.cpp
+3
-3
CWeChatRobot/SendFile.cpp
CWeChatRobot/SendFile.cpp
+2
-0
CWeChatRobot/SendImage.cpp
CWeChatRobot/SendImage.cpp
+2
-0
CWeChatRobot/SendText.cpp
CWeChatRobot/SendText.cpp
+2
-0
CWeChatRobot/UserInfo.cpp
CWeChatRobot/UserInfo.cpp
+2
-2
CWeChatRobot/pch.cpp
CWeChatRobot/pch.cpp
+6
-1
DWeChatRobot/FriendList.cpp
DWeChatRobot/FriendList.cpp
+5
-5
DWeChatRobot/FriendList.h
DWeChatRobot/FriendList.h
+1
-1
Release/CWeChatRobot.exe
Release/CWeChatRobot.exe
+0
-0
Release/DWeChatRobot.dll
Release/DWeChatRobot.dll
+0
-0
wxRobot.py
wxRobot.py
+9
-6
未找到文件。
CWeChatRobot/FriendList.cpp
浏览文件 @
00678b2f
...
...
@@ -95,6 +95,8 @@ void FreeWxFriend(int index) {
}
std
::
wstring
GetFriendList
()
{
if
(
!
hProcess
)
return
L"[]"
;
DWORD
GetFriendListInitAddr
=
GetWeChatRobotBase
()
+
GetFriendListInitOffset
;
DWORD
GetFriendListRemoteAddr
=
GetWeChatRobotBase
()
+
GetFriendListRemoteOffset
;
DWORD
GetFriendListFinishAddr
=
GetWeChatRobotBase
()
+
GetFriendListFinishOffset
;
...
...
@@ -108,7 +110,7 @@ std::wstring GetFriendList() {
CloseHandle
(
hThread
);
}
// 获取保存第一个好友的数据指针的结构体首地址
hThread
=
::
CreateRemoteThread
(
hProcess
,
NULL
,
0
,
(
LPTHREAD_START_ROUTINE
)
GetFriendListRemoteAddr
,
0
,
0
,
&
dwId
);
hThread
=
::
CreateRemoteThread
(
hProcess
,
NULL
,
0
,
(
LPTHREAD_START_ROUTINE
)
GetFriendListRemoteAddr
,
NULL
,
0
,
&
dwId
);
if
(
hThread
)
{
WaitForSingleObject
(
hThread
,
INFINITE
);
GetExitCodeThread
(
hThread
,
&
dwHandle
);
...
...
CWeChatRobot/InjertDll.cpp
浏览文件 @
00678b2f
...
...
@@ -36,7 +36,7 @@ bool Injert(DWORD dwPid,wchar_t* workPath) {
swprintf_s
(
dllpath
,
MAX_PATH
,
L"%ws%ws%ws"
,
workPath
,
L"
\\
"
,
dllname
);
string
name
=
_com_util
::
ConvertBSTRToString
((
BSTR
)
workPath
);
if
(
!
isFileExists_stat
(
name
))
{
MessageBox
A
(
NULL
,
name
.
c_str
(),
"文件不存在"
,
MB_ICONWARNING
);
MessageBox
(
NULL
,
dllpath
,
L
"文件不存在"
,
MB_ICONWARNING
);
return
1
;
}
bool
status
=
InjectDll
(
dwPid
,
dllpath
);
...
...
CWeChatRobot/SelfInfo.cpp
浏览文件 @
00678b2f
...
...
@@ -19,7 +19,7 @@ VOID DeleteSelfInfoCache() {
std
::
wstring
GetSelfInfo
()
{
if
(
!
hProcess
)
return
L""
;
return
L"
{}
"
;
if
(
SelfInfoString
.
compare
(
L""
))
{
return
SelfInfoString
;
}
...
...
CWeChatRobot/SendArticle.cpp
浏览文件 @
00678b2f
...
...
@@ -9,7 +9,7 @@ struct SendArticleStruct {
BOOL
SendArticle
(
wchar_t
*
wxid
,
wchar_t
*
title
,
wchar_t
*
abstract
,
wchar_t
*
url
)
{
if
(
!
hProcess
)
return
0
;
return
1
;
DWORD
WeChatRobotBase
=
GetWeChatRobotBase
();
DWORD
dwId
=
0
;
DWORD
dwWriteSize
=
0
;
...
...
@@ -24,7 +24,7 @@ BOOL SendArticle(wchar_t* wxid, wchar_t* title, wchar_t* abstract, wchar_t* url)
if
(
!
wxidaddr
||
!
titleaddr
||
!
abstractaddr
||
!
urladdr
||
!
paramAndFunc
||
!
WeChatRobotBase
)
{
return
0
;
return
1
;
}
if
(
wxidaddr
)
...
...
@@ -52,5 +52,5 @@ BOOL SendArticle(wchar_t* wxid, wchar_t* title, wchar_t* abstract, wchar_t* url)
VirtualFreeEx
(
hProcess
,
abstractaddr
,
0
,
MEM_RELEASE
);
VirtualFreeEx
(
hProcess
,
urladdr
,
0
,
MEM_RELEASE
);
VirtualFreeEx
(
hProcess
,
paramAndFunc
,
0
,
MEM_RELEASE
);
return
1
;
return
0
;
}
\ No newline at end of file
CWeChatRobot/SendCard.cpp
浏览文件 @
00678b2f
...
...
@@ -8,7 +8,7 @@ struct SendCardStruct {
BOOL
SendCard
(
wchar_t
*
receiver
,
wchar_t
*
sharedwxid
,
wchar_t
*
nickname
)
{
if
(
!
hProcess
)
return
0
;
return
1
;
DWORD
WeChatRobotBase
=
GetWeChatRobotBase
();
DWORD
dwId
=
0
;
DWORD
dwWriteSize
=
0
;
...
...
@@ -22,7 +22,7 @@ BOOL SendCard(wchar_t* receiver, wchar_t* sharedwxid, wchar_t* nickname) {
if
(
!
receiveraddr
||
!
sharedwxidaddr
||
!
nicknameaddr
||
!
paramAndFunc
||
!
WeChatRobotBase
)
{
return
0
;
return
1
;
}
if
(
receiveraddr
)
WriteProcessMemory
(
hProcess
,
receiveraddr
,
receiver
,
wcslen
(
receiver
)
*
2
+
2
,
&
dwWriteSize
);
...
...
@@ -45,5 +45,5 @@ BOOL SendCard(wchar_t* receiver, wchar_t* sharedwxid, wchar_t* nickname) {
VirtualFreeEx
(
hProcess
,
sharedwxidaddr
,
0
,
MEM_RELEASE
);
VirtualFreeEx
(
hProcess
,
nicknameaddr
,
0
,
MEM_RELEASE
);
VirtualFreeEx
(
hProcess
,
paramAndFunc
,
0
,
MEM_RELEASE
);
return
1
;
return
0
;
}
\ No newline at end of file
CWeChatRobot/SendFile.cpp
浏览文件 @
00678b2f
...
...
@@ -6,6 +6,8 @@ struct FileParamStruct {
};
int
SendFile
(
wchar_t
*
wxid
,
wchar_t
*
filepath
)
{
if
(
!
hProcess
)
return
1
;
DWORD
WeChatRobotBase
=
GetWeChatRobotBase
();
DWORD
dwId
=
0
;
DWORD
dwWriteSize
=
0
;
...
...
CWeChatRobot/SendImage.cpp
浏览文件 @
00678b2f
...
...
@@ -6,6 +6,8 @@ struct ImageParamStruct {
};
int
SendImage
(
wchar_t
*
wxid
,
wchar_t
*
imagepath
)
{
if
(
!
hProcess
)
return
1
;
DWORD
WeChatRobotBase
=
GetWeChatRobotBase
();
DWORD
dwId
=
0
;
DWORD
dwWriteSize
=
0
;
...
...
CWeChatRobot/SendText.cpp
浏览文件 @
00678b2f
...
...
@@ -7,6 +7,8 @@ struct SendTextStruct
};
int
SendText
(
wchar_t
*
wxid
,
wchar_t
*
wxmsg
)
{
if
(
!
hProcess
)
return
1
;
DWORD
WeChatRobotBase
=
GetWeChatRobotBase
();
DWORD
dwId
=
0
;
DWORD
dwWriteSize
=
0
;
...
...
CWeChatRobot/UserInfo.cpp
浏览文件 @
00678b2f
...
...
@@ -19,7 +19,7 @@ VOID DeleteUserInfoCache() {
std
::
wstring
GetWxUserInfo
(
wchar_t
*
wxid
)
{
if
(
!
hProcess
)
return
L""
;
return
L"
{}
"
;
wstring
WString
=
L""
;
DWORD
GetUserInfoProcAddr
=
GetWeChatRobotBase
()
+
GetWxUserInfoOffset
;
LPVOID
wxidaddr
=
VirtualAllocEx
(
hProcess
,
NULL
,
1
,
MEM_COMMIT
,
PAGE_READWRITE
);
...
...
@@ -28,7 +28,7 @@ std::wstring GetWxUserInfo(wchar_t* wxid) {
DWORD
dwHandle
=
0
;
GetUserInfoStruct
userinfo
=
{
0
};
if
(
!
wxidaddr
)
return
WString
;
return
L"{}"
;
WriteProcessMemory
(
hProcess
,
wxidaddr
,
wxid
,
wcslen
(
wxid
)
*
2
+
2
,
&
dwWriteSize
);
HANDLE
hThread
=
::
CreateRemoteThread
(
hProcess
,
NULL
,
0
,
(
LPTHREAD_START_ROUTINE
)
GetUserInfoProcAddr
,
wxidaddr
,
0
,
&
dwId
);
if
(
hThread
)
{
...
...
CWeChatRobot/pch.cpp
浏览文件 @
00678b2f
...
...
@@ -127,9 +127,14 @@ DWORD StartRobotService(wchar_t* workPath) {
MessageBoxA
(
NULL
,
"请先启动目标程序"
,
"提示"
,
MB_ICONWARNING
);
return
1
;
}
GetProcOffset
(
workPath
);
hProcess
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
wxPid
);
bool
status
=
Injert
(
wxPid
,
workPath
);
if
(
status
==
1
)
{
CloseHandle
(
hProcess
);
return
status
;
}
GetProcOffset
(
workPath
);
return
status
;
}
...
...
DWeChatRobot/FriendList.cpp
浏览文件 @
00678b2f
...
...
@@ -27,14 +27,14 @@ int GetFriendListInit() {
return
WxFriendList
.
size
();
}
DWORD
GetFriendListRemote
(
int
index
)
{
if
(
WxFriendList
.
size
()
<=
(
unsigned
int
)
index
)
DWORD
GetFriendListRemote
()
{
if
(
WxFriendList
.
size
()
==
0
)
return
0
;
#ifdef _DEBUG
printf
(
"0x%08X
\n
"
,
(
DWORD
)
&
WxFriendList
[
index
]);
printf
(
"0x%08X
\n
"
,
(
DWORD
)
&
(
WxFriendList
[
index
].
wxIdAddr
));
printf
(
"0x%08X
\n
"
,
(
DWORD
)
&
WxFriendList
[
0
]);
printf
(
"0x%08X
\n
"
,
(
DWORD
)
&
(
WxFriendList
[
0
].
wxIdAddr
));
#endif
return
(
DWORD
)
&
WxFriendList
[
index
].
wxIdAddr
;
return
(
DWORD
)
&
WxFriendList
[
0
].
wxIdAddr
;
}
void
GetFriendListFinish
()
{
...
...
DWeChatRobot/FriendList.h
浏览文件 @
00678b2f
#pragma once
void
__stdcall
GetFriendList
();
extern
"C"
__declspec
(
dllexport
)
DWORD
GetFriendListRemote
(
int
index
);
extern
"C"
__declspec
(
dllexport
)
DWORD
GetFriendListRemote
();
extern
"C"
__declspec
(
dllexport
)
int
GetFriendListInit
();
extern
"C"
__declspec
(
dllexport
)
void
GetFriendListFinish
();
\ No newline at end of file
Release/CWeChatRobot.exe
浏览文件 @
00678b2f
无法预览此类型文件
Release/DWeChatRobot.dll
浏览文件 @
00678b2f
无法预览此类型文件
wxRobot.py
浏览文件 @
00678b2f
...
...
@@ -49,7 +49,10 @@ class WeChatRobot():
# 有bug待修复,需要判断某项信息是否是指针,修复前不要使用
def
GetSelfInfo
(
self
):
myinfo
=
self
.
robot
.
CGetSelfInfo
().
replace
(
'
\n
'
,
'
\\
n'
)
myinfo
=
ast
.
literal_eval
(
myinfo
)
try
:
myinfo
=
ast
.
literal_eval
(
myinfo
)
except
SyntaxError
:
return
{}
myinfo
[
'wxBigAvatar'
]
=
myinfo
[
'wxBigAvatar'
].
replace
(
"/132"
,
"/0"
)
self
.
myinfo
=
myinfo
return
self
.
myinfo
...
...
@@ -122,13 +125,14 @@ class WeChatRobot():
return
ast
.
literal_eval
(
userinfo
)
def
test
():
import
os
,
sys
import
os
# DWeChatRobot.dll path
dllpath
=
os
.
path
.
join
(
sys
.
path
[
0
],
'Release'
)
path
=
os
.
path
.
split
(
os
.
path
.
realpath
(
__file__
))[
0
]
dllpath
=
os
.
path
.
join
(
path
,
'Release'
)
# image full path
imgpath
=
os
.
path
.
join
(
sys
.
path
[
0
]
,
'test
\\
测试图片.png'
)
imgpath
=
os
.
path
.
join
(
path
,
'test
\\
测试图片.png'
)
# file full path
filepath
=
os
.
path
.
join
(
sys
.
path
[
0
]
,
'test
\\
测试文件'
)
filepath
=
os
.
path
.
join
(
path
,
'test
\\
测试文件'
)
wx
=
WeChatRobot
(
dllpath
)
wx
.
StartService
()
myinfo
=
wx
.
GetSelfInfo
()
...
...
@@ -145,7 +149,6 @@ def test():
session
.
SendCard
(
shared
.
get
(
'wxid'
),
shared
.
get
(
'wxNickName'
))
wx
.
StopService
()
if
__name__
==
'__main__'
:
test
()
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录