WeChatFerry/SDK/util.h

32 lines
1.1 KiB
C
Raw Normal View History

2022-08-07 23:32:25 +08:00
#pragma once
#include <string>
2021-02-12 23:21:57 +08:00
2022-08-07 15:03:17 +08:00
#include "rpc_h.h"
2022-08-07 23:32:25 +08:00
#include "sdk.h"
2021-02-12 23:21:57 +08:00
#define WECHAREXE L"WeChat.exe"
#define WECHATWINDLL L"WeChatWin.dll"
#define WECHATSDKDLL L"SDK.dll"
#define WECHATINJECTDLL L"Spy.dll"
#define GET_DWORD(addr) ((DWORD) * (DWORD *)(addr))
2022-09-25 11:22:24 +08:00
#define GET_STRING(addr) ((CHAR *)(*(DWORD *)(addr)))
2021-02-12 23:21:57 +08:00
#define GET_WSTRING(addr) ((WCHAR *)(*(DWORD *)(addr)))
int OpenWeChat(DWORD *pid);
int GetWeChatVersion(wchar_t *version);
2022-08-07 23:32:25 +08:00
int GetWstringByAddress(DWORD address, wchar_t *buffer, DWORD buffer_size);
2022-08-07 15:03:17 +08:00
void GetRpcMessage(WxMessage_t *wxMsg, RpcMessage_t rpcMsg);
2022-08-07 23:32:25 +08:00
DWORD GetMemoryIntByAddress(HANDLE hProcess, DWORD address);
2022-08-20 22:10:11 +08:00
BSTR GetBstrByAddress(DWORD address);
2022-08-07 23:49:37 +08:00
BSTR GetBstrFromString(const char *str);
2022-08-07 23:32:25 +08:00
BSTR GetBstrFromWstring(std::wstring ws);
2022-08-20 22:10:11 +08:00
BSTR GetBstrFromByteArray(const byte *b, int len);
BSTR GetBstrFromStringBuffer(const char *str, int length);
std::string GetBytesFromBstr(BSTR bstr);
std::wstring GetWstringFromBstr(BSTR bstr);
2021-02-12 23:21:57 +08:00
std::wstring GetUnicodeInfoByAddress(HANDLE hProcess, DWORD address);
2022-08-20 22:10:11 +08:00
std::wstring String2Wstring(std::string s);
std::string Wstring2String(std::wstring ws);