🎨 一些优化,编译试试看能不能用

This commit is contained in:
李寻欢 2024-06-13 09:12:27 +08:00
parent 56dffa2749
commit 833c3f1163
3 changed files with 32 additions and 26 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
.idea
cmake-build-debug
BUILD/ BUILD/

View File

@ -76,12 +76,13 @@ const uint64_t kSnsObjectDoComment = 0x2EFD0F0;
const uint64_t kStartupDownloadMedia = 0x2596780; const uint64_t kStartupDownloadMedia = 0x2596780;
const uint64_t kDoAddMsg = 0x23D2B10; // const uint64_t kDoAddMsg = 0x23D2B10;
const uint64_t kDoAddMsg = 0x2205510; // decoded msg
const uint64_t kJSLogin = 0x27826A0; const uint64_t kJSLogin = 0x27826A0;
const uint64_t kTenPayTransferConfirm = 0x304C700; const uint64_t kTenPayTransferConfirm = 0x304C700;
const uint64_t kGetBizProfileInfo = 0x21CC340; const uint64_t kGetBizProfileInfo = 0x21CC340;
/
const uint64_t kSceneCenterStartTask = 0x2454F70; //must do scene after auth const uint64_t kSceneCenterStartTask = 0x2454F70; //must do scene after auth
const uint64_t kMessageLoop = 0x397B400; //Chrome.MessageLoopProblem (__int64 a1, __int64 a2) const uint64_t kMessageLoop = 0x397B400; //Chrome.MessageLoopProblem (__int64 a1, __int64 a2)
const uint64_t kWMDestroy = 0x2119240; //Message WM_DESTROY const uint64_t kWMDestroy = 0x2119240; //Message WM_DESTROY

View File

@ -1,32 +1,35 @@
#include <WinSock2.h> #include <WinSock2.h>
#include <Windows.h> #include <Windows.h>
#include <wechat/SyncMgr.h>
#include "WeChatHelper.h" #include "WeChatHelper.h"
BOOL APIENTRY DllMain(HMODULE module, DWORD ul_reason_for_call, LPVOID reserved) { BOOL APIENTRY DllMain(HMODULE module, DWORD ul_reason_for_call, LPVOID reserved) {
switch (ul_reason_for_call) { switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH: { case DLL_PROCESS_ATTACH: {
OutputDebugString("DLL_PROCESS_ATTACH START\n"); OutputDebugString("DLL_PROCESS_ATTACH START\n");
DisableThreadLibraryCalls(module); DisableThreadLibraryCalls(module);
lucky::WeChatHelper::GetInstance().Init(module); lucky::WeChatHelper::GetInstance().Init(module);
OutputDebugString("DLL_PROCESS_ATTACH END\n"); const char *notifyUrl = std::getenv("NOTIFY_URL");
break; if (notifyUrl != nullptr) {
lucky::wechat::SyncMgr::GetInstance().SetMessageNotifyUrl(std::string(notifyUrl));
}
OutputDebugString("DLL_PROCESS_ATTACH END\n");
break;
}
case DLL_THREAD_ATTACH: {
break;
}
case DLL_THREAD_DETACH: {
// OutputDebugString("DLL_THREAD_DETACH END\n");
break;
}
case DLL_PROCESS_DETACH: {
OutputDebugString("DLL_PROCESS_DETACH START\n");
lucky::WeChatHelper::GetInstance().DeInit();
OutputDebugString("DLL_PROCESS_DETACH END\n");
break;
}
} }
case DLL_THREAD_ATTACH: { return TRUE;
break;
}
case DLL_THREAD_DETACH: {
// OutputDebugString("DLL_THREAD_DETACH END\n");
break;
}
case DLL_PROCESS_DETACH: {
OutputDebugString("DLL_PROCESS_DETACH START\n");
lucky::WeChatHelper::GetInstance().DeInit();
OutputDebugString("DLL_PROCESS_DETACH END\n");
break;
}
}
return TRUE;
} }