-
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
Sep 21, 2022
1 parent
7fc9898
commit 72c20b6
Showing
30 changed files
with
485 additions
and
84 deletions.
There are no files selected for viewing
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,35 @@ | ||
#include "pch.h" | ||
|
||
struct GetA8KeyRespStruct | ||
{ | ||
DWORD message; | ||
DWORD length; | ||
}; | ||
|
||
wstring GetA8Key(DWORD pid, wchar_t *url) | ||
{ | ||
WeChatProcess hp(pid); | ||
if (!hp.m_init) | ||
return L""; | ||
DWORD GetA8KeyReomteAddr = hp.GetProcAddr(GetA8KeyRemote); | ||
if (GetA8KeyReomteAddr == 0) | ||
{ | ||
return L""; | ||
} | ||
WeChatData<wchar_t *> r_url(hp.GetHandle(), url, TEXTLENGTH(url)); | ||
if (!r_url.GetAddr()) | ||
{ | ||
return L""; | ||
} | ||
DWORD dwRet = CallRemoteFunction(hp.GetHandle(), GetA8KeyReomteAddr, r_url.GetAddr()); | ||
DWORD dwReadSize; | ||
GetA8KeyRespStruct ret_info = {0}; | ||
ReadProcessMemory(hp.GetHandle(), (LPCVOID)dwRet, &ret_info, sizeof(ret_info), &dwReadSize); | ||
if (ret_info.message == 0) | ||
return L""; | ||
unique_ptr<char[]> buffer(new char[ret_info.length + 1]()); | ||
ReadProcessMemory(hp.GetHandle(), (LPCVOID)ret_info.message, buffer.get(), ret_info.length, &dwReadSize); | ||
string result(buffer.get(), ret_info.length); | ||
wstring wresult = gb2312_to_unicode(result.c_str()); | ||
return wresult; | ||
} |
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,5 @@ | ||
#pragma once | ||
#include <windows.h> | ||
#include <iostream> | ||
using namespace std; | ||
wstring GetA8Key(DWORD pid, wchar_t *url); |
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.