Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_71398851
ComWeChatRobot
提交
4ec54372
C
ComWeChatRobot
项目概览
m0_71398851
/
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,发现更多精彩内容 >>
提交
4ec54372
编写于
7月 03, 2022
作者:
L
ljc545w
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增获取登录状态接口
上级
24f986c8
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
141 addition
and
24 deletion
+141
-24
CWeChatRobot/SelfInfo.cpp
CWeChatRobot/SelfInfo.cpp
+14
-0
CWeChatRobot/SelfInfo.h
CWeChatRobot/SelfInfo.h
+2
-1
CWeChatRobot/WeChatRobot.cpp
CWeChatRobot/WeChatRobot.cpp
+9
-1
CWeChatRobot/WeChatRobot.h
CWeChatRobot/WeChatRobot.h
+1
-0
CWeChatRobot/WeChatRobotCOM.idl
CWeChatRobot/WeChatRobotCOM.idl
+1
-0
CWeChatRobot/WeChatRobotCOM_i.h
CWeChatRobot/WeChatRobotCOM_i.h
+10
-0
CWeChatRobot/WeChatRobotCOM_p.c
CWeChatRobot/WeChatRobotCOM_p.c
+55
-21
CWeChatRobot/pch.cpp
CWeChatRobot/pch.cpp
+3
-0
CWeChatRobot/robotdata.h
CWeChatRobot/robotdata.h
+2
-0
DWeChatRobot/SelfInfo.cpp
DWeChatRobot/SelfInfo.cpp
+29
-1
DWeChatRobot/SelfInfo.h
DWeChatRobot/SelfInfo.h
+3
-0
Python/wxRobot.py
Python/wxRobot.py
+12
-0
Release/CWeChatRobot.exe
Release/CWeChatRobot.exe
+0
-0
Release/DWeChatRobot.dll
Release/DWeChatRobot.dll
+0
-0
Release/socket/SWeChatRobot.dll
Release/socket/SWeChatRobot.dll
+0
-0
未找到文件。
CWeChatRobot/SelfInfo.cpp
浏览文件 @
4ec54372
...
...
@@ -47,4 +47,18 @@ std::wstring GetSelfInfo() {
DeleteSelfInfoCache
();
return
SelfInfoString
;
}
BOOL
isWxLogin
()
{
if
(
!
hProcess
)
return
false
;
DWORD
isWxLoginAddr
=
GetWeChatRobotBase
()
+
isWxLoginOffset
;
DWORD
dwId
,
dwRet
=
0
;
HANDLE
hThread
=
::
CreateRemoteThread
(
hProcess
,
NULL
,
0
,
(
LPTHREAD_START_ROUTINE
)
isWxLoginAddr
,
NULL
,
0
,
&
dwId
);
if
(
hThread
)
{
WaitForSingleObject
(
hThread
,
INFINITE
);
GetExitCodeThread
(
hThread
,
&
dwRet
);
CloseHandle
(
hThread
);
}
return
dwRet
==
1
;
}
\ No newline at end of file
CWeChatRobot/SelfInfo.h
浏览文件 @
4ec54372
...
...
@@ -2,4 +2,5 @@
#include <windows.h>
#include <iostream>
using
namespace
std
;
std
::
wstring
GetSelfInfo
();
\ No newline at end of file
std
::
wstring
GetSelfInfo
();
BOOL
isWxLogin
();
\ No newline at end of file
CWeChatRobot/WeChatRobot.cpp
浏览文件 @
4ec54372
...
...
@@ -341,9 +341,17 @@ STDMETHODIMP CWeChatRobot::CSendAppMsg(BSTR wxid,BSTR appid,int* __result) {
/*
* 参数1:要删除的人wxid
* 参数
3
:预返回的值,调用时无需提供
* 参数
2
:预返回的值,调用时无需提供
*/
STDMETHODIMP
CWeChatRobot
::
CDeleteUser
(
BSTR
wxid
,
int
*
__result
)
{
*
__result
=
DeleteUser
(
wxid
);
return
S_OK
;
}
/*
* 参数1:预返回的值,调用时无需提供
*/
STDMETHODIMP
CWeChatRobot
::
CIsWxLogin
(
int
*
__result
)
{
*
__result
=
isWxLogin
();
return
S_OK
;
}
\ No newline at end of file
CWeChatRobot/WeChatRobot.h
浏览文件 @
4ec54372
...
...
@@ -85,6 +85,7 @@ public:
STDMETHODIMP
CChangeWeChatVer
(
BSTR
verStr
,
int
*
__result
);
STDMETHODIMP
CSendAppMsg
(
BSTR
wxid
,
BSTR
appid
,
int
*
__result
);
STDMETHODIMP
CDeleteUser
(
BSTR
wxid
,
int
*
__result
);
STDMETHODIMP
CIsWxLogin
(
int
*
__result
);
};
OBJECT_ENTRY_AUTO
(
__uuidof
(
WeChatRobot
),
CWeChatRobot
)
CWeChatRobot/WeChatRobotCOM.idl
浏览文件 @
4ec54372
...
...
@@ -50,6 +50,7 @@ interface IWeChatRobot : IDispatch
[
id
(
35
),
helpstring
(
"修改微信版本号"
)
]
HRESULT
CChangeWeChatVer
(
[
in
]
BSTR
verStr
,
[
out
,
retval
]
int
*
__result
)
;
[
id
(
36
),
helpstring
(
"发送小程序"
)
]
HRESULT
CSendAppMsg
(
[
in
]
BSTR
wxid
,
[
in
]
BSTR
appid
,
[
out
,
retval
]
int
*
__result
)
;
[
id
(
37
),
helpstring
(
"删除好友"
)
]
HRESULT
CDeleteUser
(
[
in
]
BSTR
wxid
,
[
out
,
retval
]
int
*
__result
)
;
[
id
(
38
),
helpstring
(
"获取登录状态"
)
]
HRESULT
CIsWxLogin
(
[
out
,
retval
]
int
*
__result
)
;
}
;
[
object
,
...
...
CWeChatRobot/WeChatRobotCOM_i.h
浏览文件 @
4ec54372
...
...
@@ -257,6 +257,9 @@ EXTERN_C const IID IID_IWeChatRobot;
/* [in] */
BSTR
wxid
,
/* [retval][out] */
int
*
__result
)
=
0
;
virtual
/* [helpstring][id] */
HRESULT
STDMETHODCALLTYPE
CIsWxLogin
(
/* [retval][out] */
int
*
__result
)
=
0
;
};
...
...
@@ -492,6 +495,10 @@ EXTERN_C const IID IID_IWeChatRobot;
/* [in] */
BSTR
wxid
,
/* [retval][out] */
int
*
__result
);
/* [helpstring][id] */
HRESULT
(
STDMETHODCALLTYPE
*
CIsWxLogin
)(
IWeChatRobot
*
This
,
/* [retval][out] */
int
*
__result
);
END_INTERFACE
}
IWeChatRobotVtbl
;
...
...
@@ -630,6 +637,9 @@ EXTERN_C const IID IID_IWeChatRobot;
#define IWeChatRobot_CDeleteUser(This,wxid,__result) \
(
(
This
)
->
lpVtbl
->
CDeleteUser
(
This
,
wxid
,
__result
)
)
#define IWeChatRobot_CIsWxLogin(This,__result) \
(
(
This
)
->
lpVtbl
->
CIsWxLogin
(
This
,
__result
)
)
#endif
/* COBJMACROS */
...
...
CWeChatRobot/WeChatRobotCOM_p.c
浏览文件 @
4ec54372
...
...
@@ -49,7 +49,7 @@
#include "WeChatRobotCOM_i.h"
#define TYPE_FORMAT_STRING_SIZE 1239
#define PROC_FORMAT_STRING_SIZE 15
13
#define PROC_FORMAT_STRING_SIZE 15
49
#define EXPR_FORMAT_STRING_SIZE 1
#define TRANSMIT_AS_TABLE_SIZE 0
#define WIRE_MARSHAL_TABLE_SIZE 2
...
...
@@ -1409,41 +1409,72 @@ static const WeChatRobotCOM_MIDL_PROC_FORMAT_STRING WeChatRobotCOM__MIDL_ProcFor
/* 1468 */
0x8
,
/* FC_LONG */
0x0
,
/* 0 */
/* Procedure C
PostMessage
*/
/* Procedure C
IsWxLogin
*/
/* 1470 */
0x33
,
/* FC_AUTO_HANDLE */
0x6c
,
/* Old Flags: object, Oi2 */
/* 1472 */
NdrFcLong
(
0x0
),
/* 0 */
/* 1476 */
NdrFcShort
(
0x
7
),
/* 7
*/
/* 1478 */
NdrFcShort
(
0x
10
),
/* x86 Stack size/offset = 16
*/
/* 1476 */
NdrFcShort
(
0x
29
),
/* 41
*/
/* 1478 */
NdrFcShort
(
0x
c
),
/* x86 Stack size/offset = 12
*/
/* 1480 */
NdrFcShort
(
0x0
),
/* 0 */
/* 1482 */
NdrFcShort
(
0x24
),
/* 36 */
/* 1484 */
0x4
6
,
/* Oi2 Flags: clt must size,
has return, has ext, */
0x
3
,
/* 3
*/
/* 1484 */
0x4
4
,
/* Oi2 Flags:
has return, has ext, */
0x
2
,
/* 2
*/
/* 1486 */
0x8
,
/* 8 */
0x4
5
,
/* Ext Flags: new corr desc, srv corr check
, has range on conformance */
0x4
1
,
/* Ext Flags: new corr desc
, has range on conformance */
/* 1488 */
NdrFcShort
(
0x0
),
/* 0 */
/* 1490 */
NdrFcShort
(
0x
1
),
/* 1
*/
/* 1490 */
NdrFcShort
(
0x
0
),
/* 0
*/
/* 1492 */
NdrFcShort
(
0x0
),
/* 0 */
/* Parameter
msg
*/
/* Parameter
__result
*/
/* 1494 */
NdrFcShort
(
0x
10b
),
/* Flags: must size, must free, in, simple ref,
*/
/* 1494 */
NdrFcShort
(
0x
2150
),
/* Flags: out, base type, simple ref, srv alloc size=8
*/
/* 1496 */
NdrFcShort
(
0x4
),
/* x86 Stack size/offset = 4 */
/* 1498 */
NdrFcShort
(
0x4cc
),
/* Type Offset=1228 */
/* 1498 */
0x8
,
/* FC_LONG */
0x0
,
/* 0 */
/*
Parameter __result
*/
/*
Return value
*/
/* 1500 */
NdrFcShort
(
0x
2150
),
/* Flags: out, base type, simple ref, srv alloc size=8
*/
/* 1500 */
NdrFcShort
(
0x
70
),
/* Flags: out, return, base type,
*/
/* 1502 */
NdrFcShort
(
0x8
),
/* x86 Stack size/offset = 8 */
/* 1504 */
0x8
,
/* FC_LONG */
0x0
,
/* 0 */
/* Procedure CPostMessage */
/* 1506 */
0x33
,
/* FC_AUTO_HANDLE */
0x6c
,
/* Old Flags: object, Oi2 */
/* 1508 */
NdrFcLong
(
0x0
),
/* 0 */
/* 1512 */
NdrFcShort
(
0x7
),
/* 7 */
/* 1514 */
NdrFcShort
(
0x10
),
/* x86 Stack size/offset = 16 */
/* 1516 */
NdrFcShort
(
0x0
),
/* 0 */
/* 1518 */
NdrFcShort
(
0x24
),
/* 36 */
/* 1520 */
0x46
,
/* Oi2 Flags: clt must size, has return, has ext, */
0x3
,
/* 3 */
/* 1522 */
0x8
,
/* 8 */
0x45
,
/* Ext Flags: new corr desc, srv corr check, has range on conformance */
/* 1524 */
NdrFcShort
(
0x0
),
/* 0 */
/* 1526 */
NdrFcShort
(
0x1
),
/* 1 */
/* 1528 */
NdrFcShort
(
0x0
),
/* 0 */
/* Parameter msg */
/* 1530 */
NdrFcShort
(
0x10b
),
/* Flags: must size, must free, in, simple ref, */
/* 1532 */
NdrFcShort
(
0x4
),
/* x86 Stack size/offset = 4 */
/* 1534 */
NdrFcShort
(
0x4cc
),
/* Type Offset=1228 */
/* Parameter __result */
/* 1536 */
NdrFcShort
(
0x2150
),
/* Flags: out, base type, simple ref, srv alloc size=8 */
/* 1538 */
NdrFcShort
(
0x8
),
/* x86 Stack size/offset = 8 */
/* 1540 */
0x8
,
/* FC_LONG */
0x0
,
/* 0 */
/* Return value */
/* 15
06
*/
NdrFcShort
(
0x70
),
/* Flags: out, return, base type, */
/* 15
08
*/
NdrFcShort
(
0xc
),
/* x86 Stack size/offset = 12 */
/* 15
10
*/
0x8
,
/* FC_LONG */
/* 15
42
*/
NdrFcShort
(
0x70
),
/* Flags: out, return, base type, */
/* 15
44
*/
NdrFcShort
(
0xc
),
/* x86 Stack size/offset = 12 */
/* 15
46
*/
0x8
,
/* FC_LONG */
0x0
,
/* 0 */
0x0
...
...
@@ -2324,7 +2355,8 @@ static const unsigned short IWeChatRobot_FormatStringOffsetTable[] =
1302
,
1338
,
1380
,
1428
1428
,
1470
};
static
const
MIDL_STUBLESS_PROXY_INFO
IWeChatRobot_ProxyInfo
=
...
...
@@ -2348,7 +2380,7 @@ static const MIDL_SERVER_INFO IWeChatRobot_ServerInfo =
0
,
0
,
0
};
CINTERFACE_PROXY_VTABLE
(
4
1
)
_IWeChatRobotProxyVtbl
=
CINTERFACE_PROXY_VTABLE
(
4
2
)
_IWeChatRobotProxyVtbl
=
{
&
IWeChatRobot_ProxyInfo
,
&
IID_IWeChatRobot
,
...
...
@@ -2392,7 +2424,8 @@ CINTERFACE_PROXY_VTABLE(41) _IWeChatRobotProxyVtbl =
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CUnHookImageMsg */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CChangeWeChatVer */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CSendAppMsg */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CDeleteUser */
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CDeleteUser */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CIsWxLogin */
};
...
...
@@ -2435,6 +2468,7 @@ static const PRPC_STUB_FUNCTION IWeChatRobot_table[] =
NdrStubCall2
,
NdrStubCall2
,
NdrStubCall2
,
NdrStubCall2
,
NdrStubCall2
};
...
...
@@ -2442,7 +2476,7 @@ CInterfaceStubVtbl _IWeChatRobotStubVtbl =
{
&
IID_IWeChatRobot
,
&
IWeChatRobot_ServerInfo
,
4
1
,
4
2
,
&
IWeChatRobot_table
[
-
3
],
CStdStubBuffer_DELEGATING_METHODS
};
...
...
@@ -2458,7 +2492,7 @@ static const unsigned short IRobotEvent_FormatStringOffsetTable[] =
(
unsigned
short
)
-
1
,
(
unsigned
short
)
-
1
,
(
unsigned
short
)
-
1
,
1
470
1
506
};
static
const
MIDL_STUBLESS_PROXY_INFO
IRobotEvent_ProxyInfo
=
...
...
CWeChatRobot/pch.cpp
浏览文件 @
4ec54372
...
...
@@ -21,6 +21,7 @@ DWORD DeleteUserInfoCacheOffset = 0x0;
DWORD
GetSelfInfoOffset
=
0x0
;
DWORD
DeleteSelfInfoCacheOffset
=
0x0
;
DWORD
SearchContactByNetRemoteOffset
=
0x0
;
DWORD
isWxLoginOffset
=
0
;
DWORD
VerifyFriendApplyOffset
=
0x0
;
...
...
@@ -144,6 +145,8 @@ BOOL GetProcOffset(wchar_t* workPath) {
DeleteSelfInfoCacheOffset
=
DeleteSelfInfoCacheProcAddr
-
WeChatBase
;
DWORD
SearchContactByNetRemoteAddr
=
(
DWORD
)
GetProcAddress
(
hd
,
SearchContactByNetRemote
);
SearchContactByNetRemoteOffset
=
SearchContactByNetRemoteAddr
-
WeChatBase
;
DWORD
isWxLoginAddr
=
(
DWORD
)
GetProcAddress
(
hd
,
isWxLoginRemote
);
isWxLoginOffset
=
isWxLoginAddr
-
WeChatBase
;
DWORD
CheckFriendStatusRemoteAddr
=
(
DWORD
)
GetProcAddress
(
hd
,
CheckFriendStatusRemote
);
CheckFriendStatusRemoteOffset
=
CheckFriendStatusRemoteAddr
-
WeChatBase
;
...
...
CWeChatRobot/robotdata.h
浏览文件 @
4ec54372
...
...
@@ -43,6 +43,7 @@ extern DWORD VerifyFriendApplyOffset;
extern
DWORD
GetSelfInfoOffset
;
extern
DWORD
DeleteSelfInfoCacheOffset
;
extern
wstring
SelfInfoString
;
extern
DWORD
isWxLoginOffset
;
extern
DWORD
CheckFriendStatusRemoteOffset
;
...
...
@@ -89,6 +90,7 @@ extern DWORD ChangeWeChatVerRemoteOffset;
#define GetSelfInfoRemote "GetSelfInfoRemote"
#define DeleteSelfInfoCacheRemote "DeleteSelfInfoCacheRemote"
#define SearchContactByNetRemote "SearchContactByNetRemote"
#define isWxLoginRemote "isWxLogin"
#define VerifyFriendApplyRemote "VerifyFriendApplyRemote"
...
...
DWeChatRobot/SelfInfo.cpp
浏览文件 @
4ec54372
#include "pch.h"
#include <vector>
#define CheckLoginOffset 0x2366538
/*
* 外部调用时的返回类型
* message:selfinfo.c_str()
...
...
@@ -40,6 +42,7 @@ wstring GetSelfInfo() {
WeChatWinBase
+
0x236607C
,
WeChatWinBase
+
0x2366548
,
WeChatWinBase
+
0x23660F4
,
WeChatWinBase
+
0x23661F8
,
*
(
DWORD
*
)(
WeChatWinBase
+
0x236622C
),
*
(
DWORD
*
)(
WeChatWinBase
+
0x23A111C
),
*
(
DWORD
*
)(
WeChatWinBase
+
0x23663D4
),
...
...
@@ -53,6 +56,7 @@ wstring GetSelfInfo() {
L"
\"
wxId
\"
"
,
L"
\"
wxNumber
\"
"
,
L"
\"
wxNickName
\"
"
,
L"
\"
Sex
\"
"
,
L"
\"
wxSignature
\"
"
,
L"
\"
wxBigAvatar
\"
"
,
L"
\"
wxSmallAvatar
\"
"
,
...
...
@@ -88,10 +92,29 @@ wstring GetSelfInfo() {
temp
=
(
char
*
)
SelfInfoAddr
[
i
];
}
}
else
if
(
!
SelfInfoKey
[
i
].
compare
(
L"
\"
Sex
\"
"
))
{
int
sex
=
*
(
int
*
)
SelfInfoAddr
[
i
];
switch
(
sex
)
{
case
1
:
{
selfinfo
=
selfinfo
+
L"男
\"
,"
;
break
;
}
case
2
:
{
selfinfo
=
selfinfo
+
L"女
\"
,"
;
break
;
}
default:
{
selfinfo
=
selfinfo
+
L"未知
\"
,"
;
break
;
}
}
continue
;
}
else
{
temp
=
(
char
*
)
SelfInfoAddr
[
i
];
if
(
temp
==
NULL
||
strlen
(
temp
)
==
0
)
if
(
temp
==
NULL
||
strlen
(
temp
)
==
0
)
{
temp
=
(
char
*
)
"null"
;
}
}
wchar_t
*
wtemp
=
new
wchar_t
[
strlen
(
temp
)
+
1
];
ZeroMemory
(
wtemp
,
(
strlen
(
temp
)
+
1
)
*
2
);
...
...
@@ -112,6 +135,11 @@ wstring GetSelfInfo() {
return
selfinfo
;
}
BOOL
isWxLogin
()
{
DWORD
CheckLoginAddr
=
GetWeChatWinBase
()
+
CheckLoginOffset
;
return
*
(
BOOL
*
)
CheckLoginAddr
;
}
/*
* 删除个人信息缓存
* return:void
...
...
DWeChatRobot/SelfInfo.h
浏览文件 @
4ec54372
...
...
@@ -6,4 +6,7 @@ wstring GetSelfInfo();
#ifndef USE_SOCKET
extern
"C"
__declspec
(
dllexport
)
DWORD
GetSelfInfoRemote
();
extern
"C"
__declspec
(
dllexport
)
VOID
DeleteSelfInfoCacheRemote
();
extern
"C"
__declspec
(
dllexport
)
BOOL
isWxLogin
();
#else
BOOL
isWxLogin
();
#endif
\ No newline at end of file
Python/wxRobot.py
浏览文件 @
4ec54372
...
...
@@ -134,6 +134,18 @@ class WeChatRobot():
"""
status
=
self
.
robot
.
CStartRobotService
()
return
status
def
IsWxLogin
(
self
)
->
int
:
"""
获取微信登录状态
Returns
-------
bool
微信登录状态.
"""
return
self
.
robot
.
CIsWxLogin
()
def
SendText
(
self
,
receiver
:
str
,
msg
:
str
)
->
int
:
"""
...
...
Release/CWeChatRobot.exe
浏览文件 @
4ec54372
无法预览此类型文件
Release/DWeChatRobot.dll
浏览文件 @
4ec54372
无法预览此类型文件
Release/socket/SWeChatRobot.dll
浏览文件 @
4ec54372
无法预览此类型文件
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录