-
Notifications
You must be signed in to change notification settings - Fork 451
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ljc545w
committed
Oct 7, 2022
1 parent
9490d40
commit f0ea4e1
Showing
37 changed files
with
614 additions
and
114 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#pragma once | ||
#include <windows.h> | ||
VARIANT GetQrcodeImage(DWORD pid); | ||
BOOL isWxLogin(DWORD pid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "pch.h" | ||
|
||
BOOL Logout(DWORD pid) | ||
{ | ||
WeChatProcess hp(pid); | ||
if (!hp.m_init) | ||
return 1; | ||
DWORD WxLogoutRemoteAddr = hp.GetProcAddr(LogoutRemote); | ||
if (WxLogoutRemoteAddr == 0) | ||
return 1; | ||
DWORD ret = CallRemoteFunction(hp.GetHandle(), WxLogoutRemoteAddr, NULL); | ||
return ret != 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
#include <windows.h> | ||
BOOL Logout(DWORD pid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,36 @@ | ||
#include "pch.h" | ||
|
||
struct GetSelfInfoStruct { | ||
DWORD message; | ||
DWORD length; | ||
struct GetSelfInfoStruct | ||
{ | ||
DWORD message; | ||
DWORD length; | ||
}; | ||
|
||
std::wstring GetSelfInfo(DWORD pid) { | ||
wstring SelfInfoString = L""; | ||
DWORD dwReadSize = 0; | ||
WeChatProcess hp(pid); | ||
if (!hp.m_init) return L"{}"; | ||
DWORD GetSelfInfoRemoteAddr = hp.GetProcAddr(GetSelfInfoRemote); | ||
DWORD DeleteSelfInfoCacheRemoteAddr = hp.GetProcAddr(DeleteSelfInfoCacheRemote); | ||
if (GetSelfInfoRemoteAddr == 0) | ||
return L"{}"; | ||
DWORD ret = CallRemoteFunction(hp.GetHandle(), GetSelfInfoRemoteAddr, NULL); | ||
if (ret == 0) | ||
return L"{}"; | ||
GetSelfInfoStruct selfinfo = { 0 }; | ||
ReadProcessMemory(hp.GetHandle(), (LPCVOID)ret, &selfinfo, sizeof(GetSelfInfoStruct), &dwReadSize); | ||
if (selfinfo.length) { | ||
wchar_t* wmessage = new wchar_t[selfinfo.length + 1]; | ||
ZeroMemory(wmessage, (selfinfo.length + 1) * 2); | ||
ReadProcessMemory(hp.GetHandle(), (LPCVOID)selfinfo.message, wmessage, selfinfo.length * 2, &dwReadSize); | ||
SelfInfoString = (wstring)wmessage; | ||
delete[] wmessage; | ||
wmessage = NULL; | ||
} | ||
CallRemoteFunction(hp.GetHandle(), DeleteSelfInfoCacheRemoteAddr, NULL); | ||
return SelfInfoString; | ||
std::wstring GetSelfInfo(DWORD pid) | ||
{ | ||
wstring SelfInfoString = L""; | ||
DWORD dwReadSize = 0; | ||
WeChatProcess hp(pid); | ||
if (!hp.m_init) | ||
return L"{}"; | ||
DWORD GetSelfInfoRemoteAddr = hp.GetProcAddr(GetSelfInfoRemote); | ||
DWORD DeleteSelfInfoCacheRemoteAddr = hp.GetProcAddr(DeleteSelfInfoCacheRemote); | ||
if (GetSelfInfoRemoteAddr == 0) | ||
return L"{}"; | ||
DWORD ret = CallRemoteFunction(hp.GetHandle(), GetSelfInfoRemoteAddr, NULL); | ||
if (ret == 0) | ||
return L"{}"; | ||
GetSelfInfoStruct selfinfo = {0}; | ||
ReadProcessMemory(hp.GetHandle(), (LPCVOID)ret, &selfinfo, sizeof(GetSelfInfoStruct), &dwReadSize); | ||
if (selfinfo.length) | ||
{ | ||
wchar_t *wmessage = new wchar_t[selfinfo.length + 1]; | ||
ZeroMemory(wmessage, (selfinfo.length + 1) * 2); | ||
ReadProcessMemory(hp.GetHandle(), (LPCVOID)selfinfo.message, wmessage, selfinfo.length * 2, &dwReadSize); | ||
SelfInfoString = (wstring)wmessage; | ||
delete[] wmessage; | ||
wmessage = NULL; | ||
} | ||
CallRemoteFunction(hp.GetHandle(), DeleteSelfInfoCacheRemoteAddr, NULL); | ||
return SelfInfoString; | ||
} | ||
|
||
BOOL isWxLogin(DWORD pid) { | ||
WeChatProcess hp(pid); | ||
if (!hp.m_init) return 1; | ||
DWORD isWxLoginRemoteAddr = hp.GetProcAddr(isWxLoginRemote); | ||
if (isWxLoginRemoteAddr == 0) | ||
return 1; | ||
DWORD ret = CallRemoteFunction(hp.GetHandle(), isWxLoginRemoteAddr, NULL); | ||
return ret == 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ | |
#include <iostream> | ||
using namespace std; | ||
std::wstring GetSelfInfo(DWORD pid); | ||
BOOL isWxLogin(DWORD pid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "pch.h" | ||
|
||
struct SendXmlMsgStruct | ||
{ | ||
DWORD wxid; | ||
DWORD xml; | ||
DWORD imgpath; | ||
}; | ||
|
||
BOOL SendXmlMsg(DWORD pid, wchar_t *wxid, wchar_t *xml, wchar_t *imgpath) | ||
{ | ||
WeChatProcess hp(pid); | ||
if (!hp.m_init) | ||
return 1; | ||
DWORD SendXmlMsgRemoteAddr = hp.GetProcAddr(SendXmlMsgRemote); | ||
if (SendXmlMsgRemoteAddr == 0) | ||
{ | ||
return 1; | ||
} | ||
SendXmlMsgStruct params = {0}; | ||
WeChatData<wchar_t *> r_wxid(hp.GetHandle(), wxid, TEXTLENGTH(wxid)); | ||
WeChatData<wchar_t *> r_xml(hp.GetHandle(), xml, TEXTLENGTH(xml)); | ||
WeChatData<wchar_t *> r_imgpath(hp.GetHandle(), imgpath, TEXTLENGTH(imgpath)); | ||
params.wxid = (DWORD)r_wxid.GetAddr(); | ||
params.xml = (DWORD)r_xml.GetAddr(); | ||
params.imgpath = (DWORD)r_imgpath.GetAddr(); | ||
WeChatData<SendXmlMsgStruct *> r_params(hp.GetHandle(), ¶ms, sizeof(params)); | ||
if (!r_wxid.GetAddr() || !r_xml.GetAddr() || !r_params.GetAddr()) | ||
{ | ||
return 1; | ||
} | ||
DWORD dwRet = CallRemoteFunction(hp.GetHandle(), SendXmlMsgRemoteAddr, r_params.GetAddr()); | ||
return dwRet != 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
#include <windows.h> | ||
BOOL SendXmlMsg(DWORD pid, wchar_t *wxid, wchar_t *xml, wchar_t *imgpath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.