提交 eb5dfe1f 编写于 作者: L ljc545w

增加wxid查询好友信息接口

上级 676f92f1
#pragma once
#include<windows.h>
#include<iostream>
using namespace std;
std::wstring GetFriendList();
\ No newline at end of file
#include "pch.h"
struct GetUserInfoStruct {
DWORD message;
DWORD length;
};
std::wstring GetWxUserInfo(wchar_t* wxid) {
wstring WString = L"";
DWORD GetUserInfoProcAddr = GetWeChatRobotBase() + GetWxUserInfoOffset;
LPVOID wxidaddr = VirtualAllocEx(hProcess, NULL, 1, MEM_COMMIT, PAGE_READWRITE);
DWORD dwWriteSize = 0;
DWORD dwId = 0;
DWORD dwHandle = 0;
GetUserInfoStruct userinfo = { 0 };
if (!wxidaddr)
return WString;
WriteProcessMemory(hProcess, wxidaddr, wxid, wcslen(wxid) * 2 + 2, &dwWriteSize);
HANDLE hThread = ::CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)GetUserInfoProcAddr, wxidaddr, 0, &dwId);
if (hThread) {
WaitForSingleObject(hThread, INFINITE);
GetExitCodeThread(hThread, &dwHandle);
CloseHandle(hThread);
}
if(dwHandle)
ReadProcessMemory(hProcess, (LPCVOID)dwHandle, &userinfo, sizeof(GetUserInfoStruct), &dwWriteSize);
if (userinfo.length) {
wchar_t* wmessage = new wchar_t[userinfo.length + 1];
ZeroMemory(wmessage, (userinfo.length + 1) * 2);
ReadProcessMemory(hProcess, (LPCVOID)userinfo.message, wmessage, userinfo.length * 2, &dwWriteSize);
WString += wmessage;
delete[] wmessage;
wmessage = NULL;
}
VirtualFreeEx(hProcess, wxidaddr, 0, MEM_RELEASE);
return WString;
}
\ No newline at end of file
#pragma once
#include <windows.h>
#include <iostream>
using namespace std;
std::wstring GetWxUserInfo(wchar_t* wxid);
\ No newline at end of file
......@@ -59,4 +59,14 @@ STDMETHODIMP CWeChatRobot::CGetFriendList(BSTR* __result) {
string smessage = _com_util::ConvertBSTRToString((BSTR)(GetFriendList().c_str()));
*__result = _com_util::ConvertStringToBSTR(smessage.c_str());
return S_OK;
}
/*
* 参数1:要查询的wxid
* 参数2:预返回的值,调用时无需提供
*/
STDMETHODIMP CWeChatRobot::CGetWxUserInfo(BSTR wxid,BSTR* __result) {
string smessage = _com_util::ConvertBSTRToString((BSTR)(GetWxUserInfo(wxid).c_str()));
*__result = _com_util::ConvertStringToBSTR(smessage.c_str());
return S_OK;
}
\ No newline at end of file
......@@ -57,6 +57,7 @@ public:
STDMETHODIMP CSendText(BSTR wxid, BSTR wxmsg, int* __result);
STDMETHODIMP CSendFile(BSTR wxid, BSTR filepath, int* __result);
STDMETHODIMP CGetFriendList(BSTR* __result);
STDMETHODIMP CGetWxUserInfo(BSTR wxid, BSTR* __result);
};
OBJECT_ENTRY_AUTO(__uuidof(WeChatRobot), CWeChatRobot)
......@@ -22,6 +22,7 @@ interface IWeChatRobot : IDispatch
[id(4)] HRESULT CSendImage([in] BSTR wxid, [in] BSTR imagepath, [out, retval] int* __result);
[id(5)] HRESULT CSendFile([in] BSTR wxid, [in] BSTR filepath, [out, retval] int* __result);
[id(6)] HRESULT CGetFriendList([out, retval] BSTR* __result);
[id(7)] HRESULT CGetWxUserInfo([in] BSTR wxid, [out, retval] BSTR* __result);
};
[
uuid(721abb35-141a-4aa2-94f2-762e2833fa6c),
......
......@@ -221,6 +221,7 @@
<ClInclude Include="SendImage.h" />
<ClInclude Include="SendText.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="UserInfo.h" />
<ClInclude Include="WeChatRobot.h" />
<ClInclude Include="WeChatRobotCOM_i.h" />
<ClInclude Include="xdlldata.h" />
......@@ -237,6 +238,7 @@
<ClCompile Include="SendFile.cpp" />
<ClCompile Include="SendImage.cpp" />
<ClCompile Include="SendText.cpp" />
<ClCompile Include="UserInfo.cpp" />
<ClCompile Include="WeChatRobot.cpp" />
<ClCompile Include="WeChatRobotCOM.cpp" />
<ClCompile Include="WeChatRobotCOM_i.c">
......
......@@ -32,9 +32,15 @@
<Filter Include="发送消息\发送文件">
<UniqueIdentifier>{eb0eba18-3b38-466c-8978-f7d0f2bb756e}</UniqueIdentifier>
</Filter>
<Filter Include="好友列表">
<Filter Include="好友相关">
<UniqueIdentifier>{19933e02-50d4-489c-823e-4e7fe6539792}</UniqueIdentifier>
</Filter>
<Filter Include="好友相关\好友列表">
<UniqueIdentifier>{be3e55a9-dd57-4e92-a340-cb558f3cd4f7}</UniqueIdentifier>
</Filter>
<Filter Include="好友相关\好友信息">
<UniqueIdentifier>{cdd9e8b4-4576-499c-b20e-60e05911f6d6}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
......@@ -68,7 +74,7 @@
<Filter>发送消息\发送文本</Filter>
</ClInclude>
<ClInclude Include="FriendList.h">
<Filter>好友列表</Filter>
<Filter>好友相关\好友列表</Filter>
</ClInclude>
<ClInclude Include="SendFile.h">
<Filter>发送消息\发送文件</Filter>
......@@ -76,6 +82,9 @@
<ClInclude Include="robotdata.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="UserInfo.h">
<Filter>好友相关\好友信息</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="WeChatRobotCOM.cpp">
......@@ -103,11 +112,14 @@
<Filter>发送消息\发送文本</Filter>
</ClCompile>
<ClCompile Include="FriendList.cpp">
<Filter>好友列表</Filter>
<Filter>好友相关\好友列表</Filter>
</ClCompile>
<ClCompile Include="SendFile.cpp">
<Filter>发送消息\发送文件</Filter>
</ClCompile>
<ClCompile Include="UserInfo.cpp">
<Filter>好友相关\好友信息</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="WeChatRobotCOM.rc">
......
......@@ -113,6 +113,10 @@ EXTERN_C const IID IID_IWeChatRobot;
virtual /* [id] */ HRESULT STDMETHODCALLTYPE CGetFriendList(
/* [retval][out] */ BSTR *__result) = 0;
virtual /* [id] */ HRESULT STDMETHODCALLTYPE CGetWxUserInfo(
/* [in] */ BSTR wxid,
/* [retval][out] */ BSTR *__result) = 0;
};
......@@ -202,6 +206,11 @@ EXTERN_C const IID IID_IWeChatRobot;
IWeChatRobot * This,
/* [retval][out] */ BSTR *__result);
/* [id] */ HRESULT ( STDMETHODCALLTYPE *CGetWxUserInfo )(
IWeChatRobot * This,
/* [in] */ BSTR wxid,
/* [retval][out] */ BSTR *__result);
END_INTERFACE
} IWeChatRobotVtbl;
......@@ -256,6 +265,9 @@ EXTERN_C const IID IID_IWeChatRobot;
#define IWeChatRobot_CGetFriendList(This,__result) \
( (This)->lpVtbl -> CGetFriendList(This,__result) )
#define IWeChatRobot_CGetWxUserInfo(This,wxid,__result) \
( (This)->lpVtbl -> CGetWxUserInfo(This,wxid,__result) )
#endif /* COBJMACROS */
......
......@@ -49,7 +49,7 @@
#include "WeChatRobotCOM_i.h"
#define TYPE_FORMAT_STRING_SIZE 71
#define PROC_FORMAT_STRING_SIZE 259
#define PROC_FORMAT_STRING_SIZE 301
#define EXPR_FORMAT_STRING_SIZE 1
#define TRANSMIT_AS_TABLE_SIZE 0
#define WIRE_MARSHAL_TABLE_SIZE 1
......@@ -334,6 +334,42 @@ static const WeChatRobotCOM_MIDL_PROC_FORMAT_STRING WeChatRobotCOM__MIDL_ProcFor
/* 256 */ 0x8, /* FC_LONG */
0x0, /* 0 */
/* Procedure CGetWxUserInfo */
/* 258 */ 0x33, /* FC_AUTO_HANDLE */
0x6c, /* Old Flags: object, Oi2 */
/* 260 */ NdrFcLong( 0x0 ), /* 0 */
/* 264 */ NdrFcShort( 0xd ), /* 13 */
/* 266 */ NdrFcShort( 0x10 ), /* x86 Stack size/offset = 16 */
/* 268 */ NdrFcShort( 0x0 ), /* 0 */
/* 270 */ NdrFcShort( 0x8 ), /* 8 */
/* 272 */ 0x47, /* Oi2 Flags: srv must size, clt must size, has return, has ext, */
0x3, /* 3 */
/* 274 */ 0x8, /* 8 */
0x47, /* Ext Flags: new corr desc, clt corr check, srv corr check, has range on conformance */
/* 276 */ NdrFcShort( 0x1 ), /* 1 */
/* 278 */ NdrFcShort( 0x1 ), /* 1 */
/* 280 */ NdrFcShort( 0x0 ), /* 0 */
/* Parameter wxid */
/* 282 */ NdrFcShort( 0x8b ), /* Flags: must size, must free, in, by val, */
/* 284 */ NdrFcShort( 0x4 ), /* x86 Stack size/offset = 4 */
/* 286 */ NdrFcShort( 0x26 ), /* Type Offset=38 */
/* Parameter __result */
/* 288 */ NdrFcShort( 0x2113 ), /* Flags: must size, must free, out, simple ref, srv alloc size=8 */
/* 290 */ NdrFcShort( 0x8 ), /* x86 Stack size/offset = 8 */
/* 292 */ NdrFcShort( 0x3c ), /* Type Offset=60 */
/* Return value */
/* 294 */ NdrFcShort( 0x70 ), /* Flags: out, return, base type, */
/* 296 */ NdrFcShort( 0xc ), /* x86 Stack size/offset = 12 */
/* 298 */ 0x8, /* FC_LONG */
0x0, /* 0 */
0x0
}
};
......@@ -433,7 +469,8 @@ static const unsigned short IWeChatRobot_FormatStringOffsetTable[] =
78,
126,
174,
222
222,
258
};
static const MIDL_STUBLESS_PROXY_INFO IWeChatRobot_ProxyInfo =
......@@ -457,7 +494,7 @@ static const MIDL_SERVER_INFO IWeChatRobot_ServerInfo =
0,
0,
0};
CINTERFACE_PROXY_VTABLE(13) _IWeChatRobotProxyVtbl =
CINTERFACE_PROXY_VTABLE(14) _IWeChatRobotProxyVtbl =
{
&IWeChatRobot_ProxyInfo,
&IID_IWeChatRobot,
......@@ -473,7 +510,8 @@ CINTERFACE_PROXY_VTABLE(13) _IWeChatRobotProxyVtbl =
(void *) (INT_PTR) -1 /* IWeChatRobot::CSendText */ ,
(void *) (INT_PTR) -1 /* IWeChatRobot::CSendImage */ ,
(void *) (INT_PTR) -1 /* IWeChatRobot::CSendFile */ ,
(void *) (INT_PTR) -1 /* IWeChatRobot::CGetFriendList */
(void *) (INT_PTR) -1 /* IWeChatRobot::CGetFriendList */ ,
(void *) (INT_PTR) -1 /* IWeChatRobot::CGetWxUserInfo */
};
......@@ -488,6 +526,7 @@ static const PRPC_STUB_FUNCTION IWeChatRobot_table[] =
NdrStubCall2,
NdrStubCall2,
NdrStubCall2,
NdrStubCall2,
NdrStubCall2
};
......@@ -495,7 +534,7 @@ CInterfaceStubVtbl _IWeChatRobotStubVtbl =
{
&IID_IWeChatRobot,
&IWeChatRobot_ServerInfo,
13,
14,
&IWeChatRobot_table[-3],
CStdStubBuffer_DELEGATING_METHODS
};
......
......@@ -9,6 +9,7 @@ DWORD SendFileOffset = 0x0;
DWORD GetFriendListInitOffset = 0x0;
DWORD GetFriendListRemoteOffset = 0x0;
DWORD GetFriendListFinishOffset = 0x0;
DWORD GetWxUserInfoOffset = 0x0;
HANDLE hProcess = NULL;
......@@ -83,6 +84,9 @@ void GetProcOffset(wchar_t* workPath) {
DWORD GetFriendListFinishProcAddr = (DWORD)GetProcAddress(hd, GetFriendListFinish);
GetFriendListFinishOffset = GetFriendListFinishProcAddr - WeChatBase;
DWORD GetWxUserInfoProcAddr = (DWORD)GetProcAddress(hd, GetWxUserInfoRemote);
GetWxUserInfoOffset = GetWxUserInfoProcAddr - WeChatBase;
FreeLibrary(hd);
delete[] dllpath;
dllpath = NULL;
......
......@@ -4,6 +4,7 @@
#include "SendText.h"
#include "SendFile.h"
#include "FriendList.h"
#include "UserInfo.h"
extern HANDLE hProcess;
extern DWORD SendImageOffset;
......@@ -14,6 +15,8 @@ extern DWORD GetFriendListInitOffset;
extern DWORD GetFriendListRemoteOffset;
extern DWORD GetFriendListFinishOffset;
extern DWORD GetWxUserInfoOffset;
#define dllname L"DWeChatRobot.dll"
#define SendTextRemote "SendTextRemote"
......@@ -22,4 +25,6 @@ extern DWORD GetFriendListFinishOffset;
#define GetFriendListInit "GetFriendListInit"
#define GetFriendListRemote "GetFriendListRemote"
#define GetFriendListFinish "GetFriendListFinish"
\ No newline at end of file
#define GetFriendListFinish "GetFriendListFinish"
#define GetWxUserInfoRemote "GetWxUserInfoRemote"
\ No newline at end of file
......@@ -159,6 +159,7 @@
<ClInclude Include="SendFile.h" />
<ClInclude Include="SendImage.h" />
<ClInclude Include="SendText.h" />
<ClInclude Include="UserInfo.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
......@@ -174,6 +175,7 @@
<ClCompile Include="SendImage.cpp" />
<ClCompile Include="SendText.cpp" />
<ClCompile Include="showFriendList.cpp" />
<ClCompile Include="UserInfo.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
......
......@@ -25,15 +25,21 @@
<Filter Include="发送消息\发送文件">
<UniqueIdentifier>{069b8c09-e473-4bba-a49e-571f35f2efef}</UniqueIdentifier>
</Filter>
<Filter Include="好友列表">
<UniqueIdentifier>{24dc11dd-cb6a-4c63-bf21-35823cd389ab}</UniqueIdentifier>
</Filter>
<Filter Include="自动功能">
<UniqueIdentifier>{25f77de8-b12c-4f2b-a3ac-0260b6a16897}</UniqueIdentifier>
</Filter>
<Filter Include="自动功能\聊天表情">
<UniqueIdentifier>{166b9e01-bc1c-4366-abcf-c14ec3fbbfb1}</UniqueIdentifier>
</Filter>
<Filter Include="好友相关">
<UniqueIdentifier>{8ad1ff87-550b-4942-8ebd-afbe1cfaddc9}</UniqueIdentifier>
</Filter>
<Filter Include="好友相关\好友列表">
<UniqueIdentifier>{24dc11dd-cb6a-4c63-bf21-35823cd389ab}</UniqueIdentifier>
</Filter>
<Filter Include="好友相关\好友信息">
<UniqueIdentifier>{564cc9ef-a939-4bfd-a420-a08b3072d198}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
......@@ -52,11 +58,14 @@
<Filter>发送消息\发送文件</Filter>
</ClInclude>
<ClInclude Include="FriendList.h">
<Filter>好友列表</Filter>
<Filter>好友相关\好友列表</Filter>
</ClInclude>
<ClInclude Include="SaveGif.h">
<Filter>自动功能\聊天表情</Filter>
</ClInclude>
<ClInclude Include="UserInfo.h">
<Filter>好友相关\好友信息</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
......@@ -75,13 +84,16 @@
<Filter>发送消息\发送文件</Filter>
</ClCompile>
<ClCompile Include="FriendList.cpp">
<Filter>好友列表</Filter>
<Filter>好友相关\好友列表</Filter>
</ClCompile>
<ClCompile Include="SaveGif.cpp">
<Filter>自动功能\聊天表情</Filter>
</ClCompile>
<ClCompile Include="showFriendList.cpp">
<Filter>好友列表</Filter>
<Filter>好友相关\好友列表</Filter>
</ClCompile>
<ClCompile Include="UserInfo.cpp">
<Filter>好友相关\好友信息</Filter>
</ClCompile>
</ItemGroup>
</Project>
\ No newline at end of file
#include "pch.h"
#include <typeinfo>
#include <string>
#include <vector>
#define GetUserInfoCall1Offset 0x645BD9A0 - 0x64530000
#define GetUserInfoCall2Offset 0x64C08420 - 0x64530000
#define GetUserInfoCall3Offset 0x64914260 - 0x64530000
struct GetUserInfoStruct {
DWORD message;
DWORD length;
};
wstring wUserInfo = L"";
GetUserInfoStruct ret = { 0 };
struct GetDetailUserInfoStruct {
WxString* pWxString;
DWORD ptr1 = 0;
DWORD ptr2 = 0;
char fill[0x18] = { 0 };
GetDetailUserInfoStruct(WxString* pWxString) {
this->pWxString = pWxString;
ptr1 = DWORD(pWxString) + sizeof(WxString);
ptr2 = DWORD(pWxString) + sizeof(WxString);
}
};
struct UserInfoBaseStruct {
DWORD data;
DWORD endbuffer1;
DWORD endbuffer2;
char fill[0x18] = { 0 };
};
VOID WxUserInfo(DWORD address) {
vector<DWORD> InfoType{
address + 0x10,
address + 0x24,
address + 0x38,
address + 0x6C,
address + 0xFC,
address + 0x110,
address + 0x19C,
address + 0x1B0,
address + 0x1C4,
address + 0x1D8,
address + 0x27C
};
vector<wchar_t*> InfoTypeName{
(WCHAR*)L"\"wxId\"",
(WCHAR*)L"\"wxNumber\"",
(WCHAR*)L"\"wxV3\"",
(WCHAR*)L"\"wxNickName\"",
(WCHAR*)L"\"wxBigAvatar\"",
(WCHAR*)L"\"wxSmallAvatar\"",
(WCHAR*)L"\"wxSignature\"",
(WCHAR*)L"\"wxNation\"",
(WCHAR*)L"\"wxProvince\"",
(WCHAR*)L"\"wxCity\"",
(WCHAR*)L"\"wxBackground\"",
};
wUserInfo += L"{";
for (unsigned int i = 0; i < InfoType.size(); i++) {
wchar_t* wstemp = ((*((DWORD*)InfoType[i])) != 0) ? (WCHAR*)(*((LPVOID*)InfoType[i])) : (WCHAR*)L"null";
wUserInfo = wUserInfo + InfoTypeName[i] + L":\"" + wstemp + L"\"";
if (i != InfoType.size() - 1) {
wUserInfo += L",";
}
}
wUserInfo += L"}";
#ifdef _DEBUG
wcout.imbue(locale("chs"));
wcout << wUserInfo.c_str() << endl;
#endif
}
DWORD GetWxUserInfoRemote(LPVOID lparamter) {
wchar_t* userwxid = (wchar_t*)lparamter;
DWORD address = 0;
if (!GetUserDetailInfoByWxId(userwxid, address)) {
return 0;
}
ret.message = (DWORD)wUserInfo.c_str();
ret.length = (DWORD)wUserInfo.length();
return (DWORD)&ret;
}
BOOL GetUserDetailInfoByWxId(wchar_t* wxid,DWORD &address) {
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD GetUserDetailInfoCall1 = WeChatWinBase + 0x5F917490 - 0x5F230000;
DWORD GetUserDetailInfoCall2 = WeChatWinBase + 0x5F2BD9A0 - 0x5F230000;
DWORD GetUserDetailInfoCall3 = WeChatWinBase + 0x5F619F70 - 0x5F230000;
DWORD DeleteCacheCall1 = WeChatWinBase + 0x56C349A0 - 0x56B80000;
DWORD DeleteCacheCall2 = WeChatWinBase + 0x56D983B0 - 0x56B80000;
WxString* pWxid = new WxString;
pWxid->buffer = wxid;
pWxid->length = wcslen(wxid);
pWxid->maxLength = wcslen(wxid) * 2;
UserInfoBaseStruct temp = { 0 };
UserInfoBaseStruct userinfo = { 0 };
GetDetailUserInfoStruct pUser(pWxid);
DWORD isSuccess = 0;
__asm {
pushad;
pushfd;
mov eax, 0x7;
lea ecx, pUser;
lea edx, temp;
call GetUserDetailInfoCall1;
call GetUserDetailInfoCall2;
lea ecx, userinfo;
push ecx;
lea ecx, temp;
push ecx;
mov ecx, eax;
call GetUserDetailInfoCall3;
mov isSuccess, eax;
popfd;
popad;
}
address = userinfo.data;
if(isSuccess != 0)
WxUserInfo(address);
__asm {
pushad;
pushfd;
lea ecx, temp;
call DeleteCacheCall1;
lea ecx, userinfo;
call DeleteCacheCall2;
popfd;
popad;
}
delete pWxid;
pWxid = NULL;
return (isSuccess != 0);
}
BOOL GetWxUserInfoByWxid(wchar_t* wxid, DWORD& address) {
DWORD WeChatWinBase = GetWeChatWinBase();
DWORD WxUserDataCall1 = WeChatWinBase + GetUserInfoCall1Offset;
DWORD WxUserDataCall2 = WeChatWinBase + GetUserInfoCall2Offset;
DWORD WxUserDataCall3 = WeChatWinBase + GetUserInfoCall3Offset;
char buffer[0xF90] = { 0 };
WxBaseStruct pWxid(wxid);
DWORD r_ebx = 0;
DWORD isSuccess = 0;
__asm
{
pushad;
call WxUserDataCall1;
lea ebx, buffer;
mov esi, eax;
push ebx;
sub esp, 0x14;
lea eax, pWxid;
mov ecx, esp;
push eax;
call WxUserDataCall2;
mov ecx, esi;
call WxUserDataCall3;
mov r_ebx, ebx;
mov isSuccess, eax;
popad;
}
address = r_ebx;
return isSuccess;
}
\ No newline at end of file
#pragma once
#include<windows.h>
BOOL GetWxUserInfoByWxid(wchar_t* wxid, DWORD& address);
BOOL GetUserDetailInfoByWxId(wchar_t* wxid, DWORD& address);
extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter);
\ No newline at end of file
......@@ -16,13 +16,19 @@ BOOL APIENTRY DllMain( HMODULE hModule,
{
#ifdef _DEBUG
CreateConsole();
DWORD base = (DWORD)GetModuleHandleA("MyWeChatRobot.dll");
DWORD base = (DWORD)GetModuleHandleA("DWeChatRobot.dll");
printf("SendImage 0x%08X\n", (DWORD)SendImage);
printf("SendText 0x%08X\n", (DWORD)SendText);
printf("SendFile 0x%08X\n", (DWORD)SendFile);
printf("GetFriendList 0x%08X\n", (DWORD)GetFriendList);
printf("HookExtractExpression 0x%08X\n", (DWORD)HookExtractExpression);
printf("GetWxUserInfoByWxid 0x%08X\n", (DWORD)GetWxUserInfoByWxid);
printf("GetUserDetailInfoByWxId 0x%08X\n", (DWORD)GetUserDetailInfoByWxId);
printf("GetWxUserInfoRemote 0x%08X\n", (DWORD)GetWxUserInfoRemote);
system("pause");
wchar_t* wxid = (wchar_t*)L"wxid_ltedgfwcw7yu22";
GetWxUserInfoRemote(wxid);
#endif
break;
}
......@@ -33,7 +39,7 @@ BOOL APIENTRY DllMain( HMODULE hModule,
detach_count++;
if (detach_count != 1) {
FreeConsole();
UnHookAll();
// UnHookAll();
}
#endif
break;
......
......@@ -16,6 +16,7 @@
#include "SendFile.h"
#include "FriendList.h"
#include "SaveGif.h"
#include "UserInfo.h"
#endif //PCH_H
using namespace std;
......@@ -43,8 +44,8 @@ struct WxString
wchar_t* buffer;
DWORD length;
DWORD maxLength;
DWORD fill1;
DWORD fill2;
DWORD fill1 = 0;
DWORD fill2 = 0;
};
......
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 24 16:19:48 2022
......@@ -100,6 +100,9 @@ class WeChatRobot():
def GetChatSession(self,wxid):
return ChatSession(self.robot, wxid)
def GetWxDetailUserInfo(self,wxid):
return self.robot.CGetWxUserInfo(wxid)
if __name__ == '__main__':
......@@ -115,10 +118,14 @@ if __name__ == '__main__':
wx = WeChatRobot(dllpath)
wx.StartService()
me = wx.GetFriendByWxNickName("文件传助手")
me = wx.GetFriendByWxNickName("文件传助手")
session = wx.GetChatSession(me.get('wxid'))
print(me.get('wxid'))
session.SendText('来自python的消息')
a = wx.GetWxDetailUserInfo(me.get('wxid'))
print(a)
session.SendImage(imgpath)
session.SendFile(filepath)
session.SendMp4(mp4path)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册