diff --git a/App/App.cpp b/App/App.cpp index 91e12c3..e9ba49c 100644 --- a/App/App.cpp +++ b/App/App.cpp @@ -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 } diff --git a/SDK/sdk.cpp b/SDK/sdk.cpp index 6a48509..0202aeb 100644 --- a/SDK/sdk.cpp +++ b/SDK/sdk.cpp @@ -95,7 +95,7 @@ int WxInitSDK() if (status != 0) { return status; } - + Sleep(2000); // 等待微信打开 if (!InjectDll(pid, DllPath)) { return -1; } diff --git a/SDK/util.cpp b/SDK/util.cpp index 30baa61..b4a4bdc 100644 --- a/SDK/util.cpp +++ b/SDK/util.cpp @@ -1,4 +1,4 @@ -#include "Shlwapi.h" +#include "Shlwapi.h" #include "framework.h" #include #include @@ -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; } diff --git a/Spy/load_calls.cpp b/Spy/load_calls.cpp index 2ca986a..bd854de 100644 --- a/Spy/load_calls.cpp +++ b/Spy/load_calls.cpp @@ -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: diff --git a/Spy/monitor.cpp b/Spy/monitor.cpp index 50d4c92..eb6eb1d 100644 --- a/Spy/monitor.cpp +++ b/Spy/monitor.cpp @@ -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; }