Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
honey05917
ComWeChatRobot
提交
2ca3a9dd
C
ComWeChatRobot
项目概览
honey05917
/
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,体验更适合开发者的 AI 搜索 >>
提交
2ca3a9dd
编写于
4月 12, 2022
作者:
L
ljc545w
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加获取群成员列表接口
上级
a2e576e5
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
266 addition
and
7 deletion
+266
-7
CWeChatRobot/GetChatRoomMembers.cpp
CWeChatRobot/GetChatRoomMembers.cpp
+55
-0
CWeChatRobot/GetChatRoomMembers.h
CWeChatRobot/GetChatRoomMembers.h
+3
-0
CWeChatRobot/WeChatRobot.cpp
CWeChatRobot/WeChatRobot.cpp
+12
-0
CWeChatRobot/WeChatRobot.h
CWeChatRobot/WeChatRobot.h
+1
-0
CWeChatRobot/WeChatRobotCOM.idl
CWeChatRobot/WeChatRobotCOM.idl
+1
-0
CWeChatRobot/WeChatRobotCOM.vcxproj
CWeChatRobot/WeChatRobotCOM.vcxproj
+2
-0
CWeChatRobot/WeChatRobotCOM.vcxproj.filters
CWeChatRobot/WeChatRobotCOM.vcxproj.filters
+12
-0
CWeChatRobot/WeChatRobotCOM_i.h
CWeChatRobot/WeChatRobotCOM_i.h
+12
-0
CWeChatRobot/WeChatRobotCOM_p.c
CWeChatRobot/WeChatRobotCOM_p.c
+44
-5
CWeChatRobot/pch.cpp
CWeChatRobot/pch.cpp
+5
-0
CWeChatRobot/robotdata.h
CWeChatRobot/robotdata.h
+6
-1
DWeChatRobot/DWeChatRobot.vcxproj
DWeChatRobot/DWeChatRobot.vcxproj
+2
-0
DWeChatRobot/DWeChatRobot.vcxproj.filters
DWeChatRobot/DWeChatRobot.vcxproj.filters
+12
-0
DWeChatRobot/GetChatRoomMembers.h
DWeChatRobot/GetChatRoomMembers.h
+5
-0
DWeChatRobot/GetChatRoomMemebers.cpp
DWeChatRobot/GetChatRoomMemebers.cpp
+79
-0
DWeChatRobot/dllmain.cpp
DWeChatRobot/dllmain.cpp
+1
-0
DWeChatRobot/pch.h
DWeChatRobot/pch.h
+1
-0
Release/CWeChatRobot.exe
Release/CWeChatRobot.exe
+0
-0
Release/DWeChatRobot.dll
Release/DWeChatRobot.dll
+0
-0
wxRobot.py
wxRobot.py
+13
-1
未找到文件。
CWeChatRobot/GetChatRoomMembers.cpp
0 → 100644
浏览文件 @
2ca3a9dd
#include "pch.h"
struct
ChatRoomInfoStruct
{
DWORD
members
;
DWORD
length
;
};
SAFEARRAY
*
GetChatRoomMembers
(
wchar_t
*
chatroomid
)
{
if
(
!
hProcess
)
return
NULL
;
DWORD
WeChatRobotBase
=
GetWeChatRobotBase
();
DWORD
dwId
=
0
;
DWORD
dwWriteSize
=
0
;
DWORD
dwHandle
=
0
;
HRESULT
hr
=
S_OK
;
ChatRoomInfoStruct
chatroominfo
=
{
0
};
LPVOID
chatroomidaddr
=
VirtualAllocEx
(
hProcess
,
NULL
,
1
,
MEM_COMMIT
,
PAGE_READWRITE
);
if
(
!
chatroomidaddr
||
!
WeChatRobotBase
)
{
return
NULL
;
}
else
{
WriteProcessMemory
(
hProcess
,
chatroomidaddr
,
chatroomid
,
wcslen
(
chatroomid
)
*
2
+
2
,
&
dwWriteSize
);
}
DWORD
GetChatRoomMembersRemoteAddr
=
WeChatRobotBase
+
GetChatRoomMembersRemoteOffset
;
HANDLE
hThread
=
::
CreateRemoteThread
(
hProcess
,
NULL
,
0
,
(
LPTHREAD_START_ROUTINE
)
GetChatRoomMembersRemoteAddr
,
(
LPVOID
)
chatroomidaddr
,
0
,
&
dwId
);
if
(
hThread
)
{
WaitForSingleObject
(
hThread
,
INFINITE
);
GetExitCodeThread
(
hThread
,
&
dwHandle
);
}
else
{
return
NULL
;
}
if
(
!
dwHandle
)
return
NULL
;
ReadProcessMemory
(
hProcess
,(
LPCVOID
)
dwHandle
,
&
chatroominfo
,
sizeof
(
ChatRoomInfoStruct
),
0
);
wchar_t
*
members
=
new
wchar_t
[
chatroominfo
.
length
+
1
];
ZeroMemory
(
members
,
(
chatroominfo
.
length
+
1
)
*
2
);
ReadProcessMemory
(
hProcess
,
(
LPCVOID
)
chatroominfo
.
members
,
members
,
chatroominfo
.
length
*
2
,
0
);
cout
<<
members
<<
endl
;
SAFEARRAYBOUND
rgsaBound
[
2
]
=
{
{
2
,
0
},{
2
,
0
}
};
SAFEARRAY
*
psaValue
=
SafeArrayCreate
(
VT_VARIANT
,
2
,
rgsaBound
);
long
keyIndex
[
2
]
=
{
0
,
0
};
keyIndex
[
0
]
=
0
;
keyIndex
[
1
]
=
0
;
hr
=
SafeArrayPutElement
(
psaValue
,
keyIndex
,
&
(
_variant_t
)
L"chatroomid"
);
keyIndex
[
0
]
=
0
;
keyIndex
[
1
]
=
1
;
hr
=
SafeArrayPutElement
(
psaValue
,
keyIndex
,
&
(
_variant_t
)
chatroomid
);
keyIndex
[
0
]
=
1
;
keyIndex
[
1
]
=
0
;
hr
=
SafeArrayPutElement
(
psaValue
,
keyIndex
,
&
(
_variant_t
)
L"members"
);
keyIndex
[
0
]
=
1
;
keyIndex
[
1
]
=
1
;
hr
=
SafeArrayPutElement
(
psaValue
,
keyIndex
,
&
(
_variant_t
)
members
);
delete
[]
members
;
members
=
NULL
;
return
psaValue
;
}
\ No newline at end of file
CWeChatRobot/GetChatRoomMembers.h
0 → 100644
浏览文件 @
2ca3a9dd
#pragma once
#include<windows.h>
SAFEARRAY
*
GetChatRoomMembers
(
wchar_t
*
chatroomid
);
\ No newline at end of file
CWeChatRobot/WeChatRobot.cpp
浏览文件 @
2ca3a9dd
...
...
@@ -186,4 +186,16 @@ STDMETHODIMP CWeChatRobot::CReceiveMessage(VARIANT* __result) {
STDMETHODIMP
CWeChatRobot
::
CStopReceiveMessage
(
int
*
__result
)
{
*
__result
=
StopReceiveMessage
();
return
S_OK
;
}
/*
* 参数1:群聊ID
* 参数2:预返回的值,调用时无需提供
*/
STDMETHODIMP
CWeChatRobot
::
CGetChatRoomMembers
(
BSTR
chatroomid
,
VARIANT
*
__result
)
{
VARIANT
vsaValue
;
vsaValue
.
vt
=
VT_ARRAY
|
VT_VARIANT
;
V_ARRAY
(
&
vsaValue
)
=
GetChatRoomMembers
(
chatroomid
);
*
__result
=
vsaValue
;
return
S_OK
;
}
\ No newline at end of file
CWeChatRobot/WeChatRobot.h
浏览文件 @
2ca3a9dd
...
...
@@ -70,6 +70,7 @@ public:
STDMETHODIMP
CStartReceiveMessage
(
int
*
__result
);
STDMETHODIMP
CReceiveMessage
(
VARIANT
*
__result
);
STDMETHODIMP
CStopReceiveMessage
(
int
*
__result
);
STDMETHODIMP
CGetChatRoomMembers
(
BSTR
chatroomid
,
VARIANT
*
__result
);
};
OBJECT_ENTRY_AUTO
(
__uuidof
(
WeChatRobot
),
CWeChatRobot
)
CWeChatRobot/WeChatRobotCOM.idl
浏览文件 @
2ca3a9dd
...
...
@@ -35,6 +35,7 @@ interface IWeChatRobot : IDispatch
[
id
(
17
)
]
HRESULT
CReceiveMessage
(
[
out
,
retval
]
VARIANT
*
__result
)
;
[
id
(
18
)
]
HRESULT
CStopReceiveMessage
(
[
out
,
retval
]
int
*
__result
)
;
[
id
(
19
)
]
HRESULT
CSendAtText
(
[
in
]
BSTR
chatroomid
,
[
in
]
BSTR
wxid
,
[
in
]
BSTR
wxmsg
,
[
out
,
retval
]
int
*
__result
)
;
[
id
(
20
)
]
HRESULT
CGetChatRoomMembers
(
[
in
]
BSTR
chatroomid
,
[
out
,
retval
]
VARIANT
*
__result
)
;
}
;
[
uuid
(
721
abb35
-
141
a
-
4
aa2
-
94
f2
-
762
e2833fa6c
),
...
...
CWeChatRobot/WeChatRobotCOM.vcxproj
浏览文件 @
2ca3a9dd
...
...
@@ -214,6 +214,7 @@
<ClInclude
Include=
"CheckFriendStatus.h"
/>
<ClInclude
Include=
"framework.h"
/>
<ClInclude
Include=
"FriendList.h"
/>
<ClInclude
Include=
"GetChatRoomMembers.h"
/>
<ClInclude
Include=
"InjertDll.h"
/>
<ClInclude
Include=
"pch.h"
/>
<ClInclude
Include=
"ReceiveMessage.h"
/>
...
...
@@ -235,6 +236,7 @@
<ItemGroup>
<ClCompile
Include=
"CheckFriendStatus.cpp"
/>
<ClCompile
Include=
"FriendList.cpp"
/>
<ClCompile
Include=
"GetChatRoomMembers.cpp"
/>
<ClCompile
Include=
"InjertDll.cpp"
/>
<ClCompile
Include=
"pch.cpp"
>
<PrecompiledHeader
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Create
</PrecompiledHeader>
...
...
CWeChatRobot/WeChatRobotCOM.vcxproj.filters
浏览文件 @
2ca3a9dd
...
...
@@ -59,6 +59,12 @@
<Filter
Include=
"发送消息\发送艾特"
>
<UniqueIdentifier>
{ee92dda5-7326-49ad-a09b-b339eedbb518}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"群相关"
>
<UniqueIdentifier>
{2f19dd43-78d1-4a4b-8aad-fb047f4274e6}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"群相关\获取群成员"
>
<UniqueIdentifier>
{dce4ab67-7d14-41b1-8e89-cbf9a8315a3a}
</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"framework.h"
>
...
...
@@ -121,6 +127,9 @@
<ClInclude
Include=
"SendAtText.h"
>
<Filter>
发送消息\发送艾特
</Filter>
</ClInclude>
<ClInclude
Include=
"GetChatRoomMembers.h"
>
<Filter>
群相关\获取群成员
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile
Include=
"WeChatRobotCOM.cpp"
>
...
...
@@ -174,6 +183,9 @@
<ClCompile
Include=
"SendAtText.cpp"
>
<Filter>
发送消息\发送艾特
</Filter>
</ClCompile>
<ClCompile
Include=
"GetChatRoomMembers.cpp"
>
<Filter>
群相关\获取群成员
</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile
Include=
"WeChatRobotCOM.rc"
>
...
...
CWeChatRobot/WeChatRobotCOM_i.h
浏览文件 @
2ca3a9dd
...
...
@@ -163,6 +163,10 @@ EXTERN_C const IID IID_IWeChatRobot;
/* [in] */
BSTR
wxmsg
,
/* [retval][out] */
int
*
__result
)
=
0
;
virtual
/* [id] */
HRESULT
STDMETHODCALLTYPE
CGetChatRoomMembers
(
/* [in] */
BSTR
chatroomid
,
/* [retval][out] */
VARIANT
*
__result
)
=
0
;
};
...
...
@@ -315,6 +319,11 @@ EXTERN_C const IID IID_IWeChatRobot;
/* [in] */
BSTR
wxmsg
,
/* [retval][out] */
int
*
__result
);
/* [id] */
HRESULT
(
STDMETHODCALLTYPE
*
CGetChatRoomMembers
)(
IWeChatRobot
*
This
,
/* [in] */
BSTR
chatroomid
,
/* [retval][out] */
VARIANT
*
__result
);
END_INTERFACE
}
IWeChatRobotVtbl
;
...
...
@@ -408,6 +417,9 @@ EXTERN_C const IID IID_IWeChatRobot;
#define IWeChatRobot_CSendAtText(This,chatroomid,wxid,wxmsg,__result) \
(
(
This
)
->
lpVtbl
->
CSendAtText
(
This
,
chatroomid
,
wxid
,
wxmsg
,
__result
)
)
#define IWeChatRobot_CGetChatRoomMembers(This,chatroomid,__result) \
(
(
This
)
->
lpVtbl
->
CGetChatRoomMembers
(
This
,
chatroomid
,
__result
)
)
#endif
/* COBJMACROS */
...
...
CWeChatRobot/WeChatRobotCOM_p.c
浏览文件 @
2ca3a9dd
...
...
@@ -49,7 +49,7 @@
#include "WeChatRobotCOM_i.h"
#define TYPE_FORMAT_STRING_SIZE 1221
#define PROC_FORMAT_STRING_SIZE
793
#define PROC_FORMAT_STRING_SIZE
835
#define EXPR_FORMAT_STRING_SIZE 1
#define TRANSMIT_AS_TABLE_SIZE 0
#define WIRE_MARSHAL_TABLE_SIZE 2
...
...
@@ -798,6 +798,42 @@ static const WeChatRobotCOM_MIDL_PROC_FORMAT_STRING WeChatRobotCOM__MIDL_ProcFor
/* 790 */
0x8
,
/* FC_LONG */
0x0
,
/* 0 */
/* Procedure CGetChatRoomMembers */
/* 792 */
0x33
,
/* FC_AUTO_HANDLE */
0x6c
,
/* Old Flags: object, Oi2 */
/* 794 */
NdrFcLong
(
0x0
),
/* 0 */
/* 798 */
NdrFcShort
(
0x1a
),
/* 26 */
/* 800 */
NdrFcShort
(
0x10
),
/* x86 Stack size/offset = 16 */
/* 802 */
NdrFcShort
(
0x0
),
/* 0 */
/* 804 */
NdrFcShort
(
0x8
),
/* 8 */
/* 806 */
0x47
,
/* Oi2 Flags: srv must size, clt must size, has return, has ext, */
0x3
,
/* 3 */
/* 808 */
0x8
,
/* 8 */
0x47
,
/* Ext Flags: new corr desc, clt corr check, srv corr check, has range on conformance */
/* 810 */
NdrFcShort
(
0x1
),
/* 1 */
/* 812 */
NdrFcShort
(
0x1
),
/* 1 */
/* 814 */
NdrFcShort
(
0x0
),
/* 0 */
/* Parameter chatroomid */
/* 816 */
NdrFcShort
(
0x8b
),
/* Flags: must size, must free, in, by val, */
/* 818 */
NdrFcShort
(
0x4
),
/* x86 Stack size/offset = 4 */
/* 820 */
NdrFcShort
(
0x2a
),
/* Type Offset=42 */
/* Parameter __result */
/* 822 */
NdrFcShort
(
0x4113
),
/* Flags: must size, must free, out, simple ref, srv alloc size=16 */
/* 824 */
NdrFcShort
(
0x8
),
/* x86 Stack size/offset = 8 */
/* 826 */
NdrFcShort
(
0x4ac
),
/* Type Offset=1196 */
/* Return value */
/* 828 */
NdrFcShort
(
0x70
),
/* Flags: out, return, base type, */
/* 830 */
NdrFcShort
(
0xc
),
/* x86 Stack size/offset = 12 */
/* 832 */
0x8
,
/* FC_LONG */
0x0
,
/* 0 */
0x0
}
};
...
...
@@ -1649,7 +1685,8 @@ static const unsigned short IWeChatRobot_FormatStringOffsetTable[] =
630
,
666
,
702
,
738
738
,
792
};
static
const
MIDL_STUBLESS_PROXY_INFO
IWeChatRobot_ProxyInfo
=
...
...
@@ -1673,7 +1710,7 @@ static const MIDL_SERVER_INFO IWeChatRobot_ServerInfo =
0
,
0
,
0
};
CINTERFACE_PROXY_VTABLE
(
2
6
)
_IWeChatRobotProxyVtbl
=
CINTERFACE_PROXY_VTABLE
(
2
7
)
_IWeChatRobotProxyVtbl
=
{
&
IWeChatRobot_ProxyInfo
,
&
IID_IWeChatRobot
,
...
...
@@ -1702,7 +1739,8 @@ CINTERFACE_PROXY_VTABLE(26) _IWeChatRobotProxyVtbl =
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CStartReceiveMessage */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CReceiveMessage */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CStopReceiveMessage */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CSendAtText */
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CSendAtText */
,
(
void
*
)
(
INT_PTR
)
-
1
/* IWeChatRobot::CGetChatRoomMembers */
};
...
...
@@ -1730,6 +1768,7 @@ static const PRPC_STUB_FUNCTION IWeChatRobot_table[] =
NdrStubCall2
,
NdrStubCall2
,
NdrStubCall2
,
NdrStubCall2
,
NdrStubCall2
};
...
...
@@ -1737,7 +1776,7 @@ CInterfaceStubVtbl _IWeChatRobotStubVtbl =
{
&
IID_IWeChatRobot
,
&
IWeChatRobot_ServerInfo
,
2
6
,
2
7
,
&
IWeChatRobot_table
[
-
3
],
CStdStubBuffer_DELEGATING_METHODS
};
...
...
CWeChatRobot/pch.cpp
浏览文件 @
2ca3a9dd
...
...
@@ -29,6 +29,8 @@ DWORD UnHookReceiveMessageRemoteOffset = 0x0;
DWORD
GetHeadMessageRemoteOffset
=
0x0
;
DWORD
PopHeadMessageRemoteOffset
=
0x0
;
DWORD
GetChatRoomMembersRemoteOffset
=
0x0
;
wstring
SelfInfoString
=
L""
;
HANDLE
hProcess
=
NULL
;
...
...
@@ -134,6 +136,9 @@ void GetProcOffset(wchar_t* workPath) {
DWORD
PopHeadMessageRemoteAddr
=
(
DWORD
)
GetProcAddress
(
hd
,
PopHeadMessageRemote
);
PopHeadMessageRemoteOffset
=
PopHeadMessageRemoteAddr
-
WeChatBase
;
DWORD
GetChatRoomMembersRemoteAddr
=
(
DWORD
)
GetProcAddress
(
hd
,
GetChatRoomMembersRemote
);
GetChatRoomMembersRemoteOffset
=
GetChatRoomMembersRemoteAddr
-
WeChatBase
;
FreeLibrary
(
hd
);
delete
[]
dllpath
;
dllpath
=
NULL
;
...
...
CWeChatRobot/robotdata.h
浏览文件 @
2ca3a9dd
...
...
@@ -11,6 +11,7 @@
#include "SelfInfo.h"
#include "CheckFriendStatus.h"
#include "ReceiveMessage.h"
#include "GetChatRoomMembers.h"
extern
HANDLE
hProcess
;
extern
DWORD
SendImageOffset
;
...
...
@@ -40,6 +41,8 @@ extern DWORD UnHookReceiveMessageRemoteOffset;
extern
DWORD
GetHeadMessageRemoteOffset
;
extern
DWORD
PopHeadMessageRemoteOffset
;
extern
DWORD
GetChatRoomMembersRemoteOffset
;
#define dllname L"DWeChatRobot.dll"
...
...
@@ -67,4 +70,6 @@ extern DWORD PopHeadMessageRemoteOffset;
#define HookReceiveMessageRemote "HookReceiveMessage"
#define UnHookReceiveMessageRemote "UnHookReceiveMessage"
#define GetHeadMessageRemote "GetHeadMessage"
#define PopHeadMessageRemote "PopHeadMessage"
\ No newline at end of file
#define PopHeadMessageRemote "PopHeadMessage"
#define GetChatRoomMembersRemote "GetChatRoomMembersRemote"
\ No newline at end of file
DWeChatRobot/DWeChatRobot.vcxproj
浏览文件 @
2ca3a9dd
...
...
@@ -157,6 +157,7 @@
<ClInclude
Include=
"CheckFriendStatus.h"
/>
<ClInclude
Include=
"framework.h"
/>
<ClInclude
Include=
"FriendList.h"
/>
<ClInclude
Include=
"GetChatRoomMembers.h"
/>
<ClInclude
Include=
"LogMsgInfo.h"
/>
<ClInclude
Include=
"pch.h"
/>
<ClInclude
Include=
"ReceiveMessage.h"
/>
...
...
@@ -173,6 +174,7 @@
<ClCompile
Include=
"CheckFriendStatus.cpp"
/>
<ClCompile
Include=
"dllmain.cpp"
/>
<ClCompile
Include=
"FriendList.cpp"
/>
<ClCompile
Include=
"GetChatRoomMemebers.cpp"
/>
<ClCompile
Include=
"pch.cpp"
>
<PrecompiledHeader
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
Create
</PrecompiledHeader>
<PrecompiledHeader
Condition=
"'$(Configuration)|$(Platform)'=='Debug|x64'"
>
Create
</PrecompiledHeader>
...
...
DWeChatRobot/DWeChatRobot.vcxproj.filters
浏览文件 @
2ca3a9dd
...
...
@@ -58,6 +58,12 @@
<Filter
Include=
"发送消息\发送艾特"
>
<UniqueIdentifier>
{15310114-64cf-4426-a4ef-3c889824d2de}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"群相关"
>
<UniqueIdentifier>
{5bb967a4-4dc2-4b95-a3da-2795edc30b1b}
</UniqueIdentifier>
</Filter>
<Filter
Include=
"群相关\获取群成员"
>
<UniqueIdentifier>
{fabe98aa-4f28-4bc6-b368-68808145a135}
</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude
Include=
"framework.h"
>
...
...
@@ -102,6 +108,9 @@
<ClInclude
Include=
"SendAtText.h"
>
<Filter>
发送消息\发送艾特
</Filter>
</ClInclude>
<ClInclude
Include=
"GetChatRoomMembers.h"
>
<Filter>
群相关\获取群成员
</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile
Include=
"dllmain.cpp"
>
...
...
@@ -146,5 +155,8 @@
<ClCompile
Include=
"SendAtText.cpp"
>
<Filter>
发送消息\发送艾特
</Filter>
</ClCompile>
<ClCompile
Include=
"GetChatRoomMemebers.cpp"
>
<Filter>
群相关\获取群成员
</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
DWeChatRobot/GetChatRoomMembers.h
0 → 100644
浏览文件 @
2ca3a9dd
#pragma once
#include<windows.h>
BOOL
__stdcall
GetChatRoomMembers
(
wchar_t
*
chatroomid
);
extern
"C"
__declspec
(
dllexport
)
DWORD
GetChatRoomMembersRemote
(
LPVOID
lparameter
);
\ No newline at end of file
DWeChatRobot/GetChatRoomMemebers.cpp
0 → 100644
浏览文件 @
2ca3a9dd
#include "pch.h"
#define GetChatRoomMembersCall1Offset 0x6246BBB0 - 0x61E20000
#define GetChatRoomMembersCall2Offset 0x61EDF550 - 0x61E20000
#define GetChatRoomMembersCall3Offset 0x622046D0 - 0x61E20000
#define DeleteGetChatRoomMembersCacheCallOffset 0x6246BDD0 - 0x61E20000
struct
ChatRoomInfoStruct
{
wchar_t
*
members
=
NULL
;
DWORD
length
=
0
;
};
ChatRoomInfoStruct
chatroominfo
=
{
0
};
DWORD
GetChatRoomMembersRemote
(
LPVOID
lparameter
)
{
wchar_t
*
chatroomid
=
(
WCHAR
*
)
lparameter
;
if
(
chatroominfo
.
members
!=
NULL
)
{
delete
[]
chatroominfo
.
members
;
chatroominfo
.
members
=
NULL
;
chatroominfo
.
length
=
0
;
}
if
(
GetChatRoomMembers
(
chatroomid
))
{
#ifdef _DEBUG
wcout
<<
chatroominfo
.
members
<<
endl
;
#endif
return
(
DWORD
)
&
chatroominfo
.
members
;
}
else
{
return
0
;
}
return
0
;
}
BOOL
__stdcall
GetChatRoomMembers
(
wchar_t
*
chatroomid
)
{
DWORD
WeChatWinBase
=
GetWeChatWinBase
();
DWORD
GetChatRoomMembersCall1
=
WeChatWinBase
+
GetChatRoomMembersCall1Offset
;
DWORD
GetChatRoomMembersCall2
=
WeChatWinBase
+
GetChatRoomMembersCall2Offset
;
DWORD
GetChatRoomMembersCall3
=
WeChatWinBase
+
GetChatRoomMembersCall3Offset
;
DWORD
DeleteGetChatRoomMembersCacheCall
=
WeChatWinBase
+
DeleteGetChatRoomMembersCacheCallOffset
;
WxBaseStruct
wsChatRoomId
(
chatroomid
);
char
buffer
[
0x1B0
]
=
{
0
};
DWORD
isSuccess
=
0x0
;
DWORD
DataAddr
=
0x0
;
__asm
{
pushad
;
pushfd
;
lea
ecx
,
buffer
;
mov
DataAddr
,
ecx
;
call
GetChatRoomMembersCall1
;
call
GetChatRoomMembersCall2
;
lea
eax
,
buffer
;
push
eax
;
lea
edi
,
wsChatRoomId
;
push
edi
;
call
GetChatRoomMembersCall3
;
mov
isSuccess
,
eax
;
popfd
;
popad
;
}
if
(
isSuccess
)
{
char
*
members
=
(
char
*
)(
*
(
DWORD
*
)(
DataAddr
+
0x1C
));
wchar_t
*
wmembers
=
new
wchar_t
[
strlen
(
members
)
+
1
];
ZeroMemory
(
wmembers
,
(
strlen
(
members
)
+
1
)
*
2
);
MultiByteToWideChar
(
CP_ACP
,
0
,
members
,
-
1
,
wmembers
,
strlen
(
members
)
+
1
);
chatroominfo
.
members
=
wmembers
;
chatroominfo
.
length
=
wcslen
(
wmembers
);
}
__asm
{
pushad
;
pushfd
;
lea
ecx
,
buffer
;
call
DeleteGetChatRoomMembersCacheCall
;
popfd
;
popad
;
}
return
isSuccess
;
}
\ No newline at end of file
DWeChatRobot/dllmain.cpp
浏览文件 @
2ca3a9dd
...
...
@@ -21,6 +21,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
printf
(
"SendArticle 0x%08X
\n
"
,
(
DWORD
)
SendArticle
);
printf
(
"SendCard 0x%08X
\n
"
,
(
DWORD
)
SendCard
);
printf
(
"CheckFriendStatus 0x%08X
\n
"
,
(
DWORD
)
CheckFriendStatus
);
printf
(
"GetChatRoomMembers 0x%08X
\n
"
,
(
DWORD
)
GetChatRoomMembers
);
#endif
break
;
}
...
...
DWeChatRobot/pch.h
浏览文件 @
2ca3a9dd
...
...
@@ -23,6 +23,7 @@
#include "LogMsgInfo.h"
#include "ReceiveMessage.h"
#include "SendAtText.h"
#include "GetChatRoomMembers.h"
#endif //PCH_H
using
namespace
std
;
...
...
Release/CWeChatRobot.exe
浏览文件 @
2ca3a9dd
无法预览此类型文件
Release/DWeChatRobot.dll
浏览文件 @
2ca3a9dd
无法预览此类型文件
wxRobot.py
浏览文件 @
2ca3a9dd
...
...
@@ -134,6 +134,18 @@ class WeChatRobot():
userinfo
=
self
.
robot
.
CGetWxUserInfo
(
wxid
).
replace
(
'
\n
'
,
'
\\
n'
)
return
ast
.
literal_eval
(
userinfo
)
def
GetChatRoomMembers
(
self
,
chatroomid
):
info
=
dict
(
self
.
robot
.
CGetChatRoomMembers
(
chatroomid
))
if
not
info
:
return
None
members
=
info
[
'members'
].
split
(
'^G'
)
data
=
self
.
GetWxUserInfo
(
chatroomid
)
data
[
'members'
]
=
[]
for
member
in
members
:
memberinfo
=
self
.
GetWxUserInfo
(
member
)
data
[
'members'
].
append
(
memberinfo
)
return
data
def
CheckFriendStatusInit
(
self
):
return
self
.
robot
.
CCheckFriendStatusInit
()
...
...
@@ -246,7 +258,7 @@ def test_ReceiveMessage():
wx
.
StartReceiveMessage
(
CallBackFunc
=
ReceiveMessageCallBack
)
try
:
while
True
:
pass
time
.
sleep
(
1
)
except
KeyboardInterrupt
:
pass
wx
.
StopService
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录