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
+1 -1
View File
@@ -95,7 +95,7 @@ int WxInitSDK()
if (status != 0) {
return status;
}
Sleep(2000); // 等待微信打开
if (!InjectDll(pid, DllPath)) {
return -1;
}
+14 -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;
}