diff --git a/.gitignore b/.gitignore index a92a67f..ecc7292 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ +.idea +cmake-build-debug BUILD/ \ No newline at end of file diff --git a/lucky/src/wechat/WeChatOffset.h b/lucky/src/wechat/WeChatOffset.h index dd4060b..aa158d9 100644 --- a/lucky/src/wechat/WeChatOffset.h +++ b/lucky/src/wechat/WeChatOffset.h @@ -76,12 +76,13 @@ const uint64_t kSnsObjectDoComment = 0x2EFD0F0; 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 kTenPayTransferConfirm = 0x304C700; const uint64_t kGetBizProfileInfo = 0x21CC340; - +/ const uint64_t kSceneCenterStartTask = 0x2454F70; //must do scene after auth const uint64_t kMessageLoop = 0x397B400; //Chrome.MessageLoopProblem (__int64 a1, __int64 a2) const uint64_t kWMDestroy = 0x2119240; //Message WM_DESTROY diff --git a/src/DllMain.cc b/src/DllMain.cc index 8ad88e0..8c6a565 100644 --- a/src/DllMain.cc +++ b/src/DllMain.cc @@ -1,32 +1,35 @@ - #include #include +#include #include "WeChatHelper.h" BOOL APIENTRY DllMain(HMODULE module, DWORD ul_reason_for_call, LPVOID reserved) { - switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: { - OutputDebugString("DLL_PROCESS_ATTACH START\n"); - DisableThreadLibraryCalls(module); - lucky::WeChatHelper::GetInstance().Init(module); - OutputDebugString("DLL_PROCESS_ATTACH END\n"); - break; + switch (ul_reason_for_call) { + case DLL_PROCESS_ATTACH: { + OutputDebugString("DLL_PROCESS_ATTACH START\n"); + DisableThreadLibraryCalls(module); + lucky::WeChatHelper::GetInstance().Init(module); + const char *notifyUrl = std::getenv("NOTIFY_URL"); + 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: { - 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; + return TRUE; } -