Impl login

This commit is contained in:
Changhua 2022-08-06 16:49:37 +08:00
parent 9848097058
commit 1028150f1f
5 changed files with 21 additions and 8 deletions

View File

@ -56,7 +56,7 @@ int main()
if (status != 0) {
return 0;
}
#if 0
wcout << L"Message: 接收通知中......" << endl;
WxSetTextMsgCb(onTextMsg);
@ -69,7 +69,7 @@ int main()
// 测试联系人获取
auto mContact = WxGetContacts();
printContacts(mContact);
#endif
while (1) {
Sleep(10000); // 休眠释放CPU
}

View File

@ -95,7 +95,7 @@ int WxInitSDK()
if (status != 0) {
return status;
}
Sleep(2000); // 等待微信打开
if (!InjectDll(pid, DllPath)) {
return -1;
}

View File

@ -1,4 +1,4 @@
#include "Shlwapi.h"
#include "Shlwapi.h"
#include "framework.h"
#include <string.h>
#include <strsafe.h>
@ -54,6 +54,19 @@ int GetWeChatWinDLLPath(wchar_t *path)
PathRemoveFileSpecW(path);
PathAppendW(path, WECHATWINDLL);
if (!PathFileExists(path)) {
// 微信从大约3.7开始,增加了一层版本目录: [3.7.0.29]
PathRemoveFileSpec(path);
_wfinddata_t findData;
wstring dir = wstring(path) + L"\\[*.*";
intptr_t handle = _wfindfirst(dir.c_str(), &findData);
if (handle == -1) { // 检查是否成功
return -1;
}
wstring dllPath = wstring(path) + L"\\" + findData.name;
wcscpy_s(path, MAX_PATH, dllPath.c_str());
PathAppend(path, WECHATWINDLL);
}
return ret;
}

View File

@ -3,9 +3,9 @@
#include "load_calls.h"
#define SUPPORT_VERSION L"3.3.0.115"
#define SUPPORT_VERSION L"3.7.0.29"
WxCalls_t wxCalls = {
0x1DDF60C, // Login Status
0x23631D0, // Login Status
{ 0x1DDF4BC, 0x1DDF534, 0x1DDF568 }, // User Info: wxid, nickname, mobile
0x3E3B80, // Send Message
/* Receive Message:

View File

@ -17,7 +17,7 @@ int InitDLL(void)
g_WeChatWinDllAddr = (DWORD)LoadLibrary(L"WeChatWin.dll"); //获取wechatWin模块地址
if (g_WeChatWinDllAddr == 0) {
MessageBox(NULL, L"获取wechatWin.dll模块地址", L"错误", 0);
MessageBox(NULL, L"获取wechatWin.dll模块地址失败", L"错误", 0);
return -1;
}
@ -39,7 +39,7 @@ int InitDLL(void)
DWORD WINAPI Monitor(HMODULE hModule)
{
ListenMessage();
//ListenMessage();
return TRUE;
}