From e5d71296e19d92e6e177b298cc5e381611d7b67e Mon Sep 17 00:00:00 2001 From: Duo Date: Mon, 26 Sep 2022 22:10:03 +0800 Subject: [PATCH] Fix image and video auto download issue --- DWeChatRobot/HookImageMessage.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/DWeChatRobot/HookImageMessage.cpp b/DWeChatRobot/HookImageMessage.cpp index efac5ba..876487a 100644 --- a/DWeChatRobot/HookImageMessage.cpp +++ b/DWeChatRobot/HookImageMessage.cpp @@ -92,6 +92,17 @@ void __stdcall HookImageMsg() char settime[] = "00:00-00:00"; DWORD AutoDownloadTimeSettingAddr = GetWeChatWinBase() + AutoDownloadTimeSettingOffset; WriteProcessMemory(GetCurrentProcess(), (LPVOID)AutoDownloadTimeSettingAddr, settime, strlen(settime) + 1, 0); + + // video auto + BYTE nopVideo[] = {0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + DWORD nopVideoAddr = WeChatWinBase + 0x48CE1B; + WriteProcessMemory(GetCurrentProcess(), (LPVOID)nopVideoAddr, &nopVideo, sizeof(nopVideo), 0); + + // image auto + BYTE nopImg[] = {0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + DWORD nopImgAddr = WeChatWinBase + 0x48D56B; + WriteProcessMemory(GetCurrentProcess(), (LPVOID)nopImgAddr, &nopImg, sizeof(nopImg), 0); + ImageMsgHooked = true; } -- GitLab