diff --git a/ComWeChatRobot.sln b/ComWeChatRobot.sln index 5a749781a51451835913c8f4babb21711fa2080b..f2f478cdab9c13d110d72f99294247911886bb9c 100644 --- a/ComWeChatRobot.sln +++ b/ComWeChatRobot.sln @@ -7,11 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CWeChatRobot", "CWeChatRobo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WeChatTools", "WeChatTools\WeChatTools.vcxproj", "{3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DWeChatRobot", "DWeChatRobot", "{9C5F2C6B-73CE-49FC-B19C-478C50550FE4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DWeChatRobot_3.5.0.46", "DWeChatRobot_3.5.0.46\DWeChatRobot_3.5.0.46.vcxproj", "{7EDE81C4-63BC-4C4F-8424-210D91034FDE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DWeChatRobot_3.6.0.18", "DWeChatRobot_3.6.0.18\DWeChatRobot_3.6.0.18.vcxproj", "{C0FC8DAB-0590-46AC-9270-6FEA45D52390}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DWeChatRobot", "DWeChatRobot\DWeChatRobot.vcxproj", "{C0FC8DAB-0590-46AC-9270-6FEA45D52390}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -37,14 +33,6 @@ Global {3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x64.Build.0 = Release|x64 {3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x86.ActiveCfg = Release|Win32 {3F7198C7-68D1-4BBA-9BF2-B7FC67A9426E}.Release|x86.Build.0 = Release|Win32 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Debug|x64.ActiveCfg = Debug|x64 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Debug|x64.Build.0 = Debug|x64 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Debug|x86.ActiveCfg = Debug|Win32 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Debug|x86.Build.0 = Debug|Win32 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Release|x64.ActiveCfg = Release|x64 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Release|x64.Build.0 = Release|x64 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Release|x86.ActiveCfg = Release|Win32 - {7EDE81C4-63BC-4C4F-8424-210D91034FDE}.Release|x86.Build.0 = Release|Win32 {C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|x64.ActiveCfg = Debug|x64 {C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|x64.Build.0 = Debug|x64 {C0FC8DAB-0590-46AC-9270-6FEA45D52390}.Debug|x86.ActiveCfg = Debug|Win32 @@ -57,10 +45,6 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {7EDE81C4-63BC-4C4F-8424-210D91034FDE} = {9C5F2C6B-73CE-49FC-B19C-478C50550FE4} - {C0FC8DAB-0590-46AC-9270-6FEA45D52390} = {9C5F2C6B-73CE-49FC-B19C-478C50550FE4} - EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {20BD2B3B-13AA-4C38-8216-127895041F93} EndGlobalSection diff --git a/DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj b/DWeChatRobot/DWeChatRobot.vcxproj similarity index 96% rename from DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj rename to DWeChatRobot/DWeChatRobot.vcxproj index 82fc3b931dd70278984eaf7c54ee88074253d234..8749926c84c2083f409ab6f8860897679c189223 100644 --- a/DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj +++ b/DWeChatRobot/DWeChatRobot.vcxproj @@ -1,188 +1,188 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {C0FC8DAB-0590-46AC-9270-6FEA45D52390} - MyWeChatRobot - 10.0 - DWeChatRobot_3.6.0.18 - - - - DynamicLibrary - true - v142 - Unicode - - - DynamicLibrary - false - v142 - true - Unicode - - - DynamicLibrary - true - v142 - Unicode - - - DynamicLibrary - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - DWeChatRobot - - - false - DWeChatRobot - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - WIN32;NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - - - - Level3 - true - _DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {C0FC8DAB-0590-46AC-9270-6FEA45D52390} + MyWeChatRobot + 10.0 + DWeChatRobot + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(ProjectName) + + + false + $(ProjectName) + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + WIN32;NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj.filters b/DWeChatRobot/DWeChatRobot.vcxproj.filters similarity index 97% rename from DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj.filters rename to DWeChatRobot/DWeChatRobot.vcxproj.filters index 19aec15fb2a5caa88ed6b1baa0ef38f13252f460..c9d0875e9ef4cd361902c6877aeda3ffb95dc394 100644 --- a/DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj.filters +++ b/DWeChatRobot/DWeChatRobot.vcxproj.filters @@ -1,114 +1,114 @@ - - - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {b1463ca2-6055-4c67-8c42-6319a6171dd2} - - - {b22823ee-f629-4e0a-8358-da017f0e5c3a} - - - {912e6334-b078-4ba6-813c-66d0de3ee123} - - - {069b8c09-e473-4bba-a49e-571f35f2efef} - - - {25f77de8-b12c-4f2b-a3ac-0260b6a16897} - - - {8ad1ff87-550b-4942-8ebd-afbe1cfaddc9} - - - {24dc11dd-cb6a-4c63-bf21-35823cd389ab} - - - {564cc9ef-a939-4bfd-a420-a08b3072d198} - - - {722c02ee-dda5-4a6a-9443-f1ed3c112709} - - - {edd6e39f-235b-4db5-aea1-ec2c8d0072c5} - - - {fc747a68-6314-4f23-92de-a1e55275a01e} - - - - - 通用标头 - - - 通用标头 - - - 发送消息\发送图片 - - - 发送消息\发送文本 - - - 发送消息\发送文件 - - - 好友相关\好友列表 - - - 好友相关\好友信息 - - - 个人信息 - - - 发送消息\发送文章 - - - 发送消息\发送名片 - - - - - 通用函数 - - - 通用函数 - - - 发送消息\发送图片 - - - 发送消息\发送文本 - - - 发送消息\发送文件 - - - 好友相关\好友列表 - - - 好友相关\好友信息 - - - 个人信息 - - - 发送消息\发送文章 - - - 发送消息\发送名片 - - + + + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {b1463ca2-6055-4c67-8c42-6319a6171dd2} + + + {b22823ee-f629-4e0a-8358-da017f0e5c3a} + + + {912e6334-b078-4ba6-813c-66d0de3ee123} + + + {069b8c09-e473-4bba-a49e-571f35f2efef} + + + {25f77de8-b12c-4f2b-a3ac-0260b6a16897} + + + {8ad1ff87-550b-4942-8ebd-afbe1cfaddc9} + + + {24dc11dd-cb6a-4c63-bf21-35823cd389ab} + + + {564cc9ef-a939-4bfd-a420-a08b3072d198} + + + {722c02ee-dda5-4a6a-9443-f1ed3c112709} + + + {edd6e39f-235b-4db5-aea1-ec2c8d0072c5} + + + {fc747a68-6314-4f23-92de-a1e55275a01e} + + + + + 通用标头 + + + 通用标头 + + + 发送消息\发送图片 + + + 发送消息\发送文本 + + + 发送消息\发送文件 + + + 好友相关\好友列表 + + + 好友相关\好友信息 + + + 个人信息 + + + 发送消息\发送文章 + + + 发送消息\发送名片 + + + + + 通用函数 + + + 通用函数 + + + 发送消息\发送图片 + + + 发送消息\发送文本 + + + 发送消息\发送文件 + + + 好友相关\好友列表 + + + 好友相关\好友信息 + + + 个人信息 + + + 发送消息\发送文章 + + + 发送消息\发送名片 + + \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj.user b/DWeChatRobot/DWeChatRobot.vcxproj.user similarity index 92% rename from DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj.user rename to DWeChatRobot/DWeChatRobot.vcxproj.user index 0f14913f3c72094bb7b1e695e153ade04b17d5b0..88a550947edbc3c5003a41726f0749201fdb6822 100644 --- a/DWeChatRobot_3.6.0.18/DWeChatRobot_3.6.0.18.vcxproj.user +++ b/DWeChatRobot/DWeChatRobot.vcxproj.user @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/FriendList.cpp b/DWeChatRobot/FriendList.cpp similarity index 95% rename from DWeChatRobot_3.6.0.18/FriendList.cpp rename to DWeChatRobot/FriendList.cpp index e365b42e3f1afb8c5eb2ed5653900934e2fc44a5..7a18bb620d5eda04faf6c0dccc21a0e095c2e05a 100644 --- a/DWeChatRobot_3.6.0.18/FriendList.cpp +++ b/DWeChatRobot/FriendList.cpp @@ -1,97 +1,97 @@ -#include "pch.h" -#include -using namespace std; -#define LeftTreeOffset 0x222F3BC - - -struct WxFriendStructW { - DWORD wxIdAddr; - DWORD wxNumberAddr; - DWORD wxNickNameAddr; - DWORD wxRemarkAddr; - WxFriendStructW(DWORD wxIdAddr, DWORD wxNumberAddr, DWORD wxNickNameAddr, DWORD wxRemarkAddr) { - this->wxIdAddr = wxIdAddr; - this->wxNumberAddr = wxNumberAddr; - this->wxNickNameAddr = wxNickNameAddr; - this->wxRemarkAddr = wxRemarkAddr; - } -}; - -vector WxFriendList; - -int GetFriendListInit() { - GetFriendList(); -#ifdef _DEBUG - cout << WxFriendList.size() << endl; -#endif - return WxFriendList.size(); -} - -DWORD GetFriendListRemote() { - if (WxFriendList.size() == 0) - return 0; -#ifdef _DEBUG - printf("0x%08X\n", (DWORD)&WxFriendList[0]); - printf("0x%08X\n", (DWORD)&(WxFriendList[0].wxIdAddr)); -#endif - return (DWORD)&WxFriendList[0].wxIdAddr; -} - -void GetFriendListFinish() { - WxFriendList.clear(); - cout << WxFriendList.size() << endl; -} - -void __stdcall GetFriendList() { - - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD LeftTreeAddr = 0; - DWORD RightTreeAddr = 0; - DWORD LeftTreeHead = 0; - DWORD baseAddr = WeChatWinBase + LeftTreeOffset; - printf("0x%08X\n", baseAddr); - __asm { - pushad; - mov eax, dword ptr[baseAddr]; - mov eax, dword ptr[eax]; - mov eax, dword ptr[eax + 0x4C]; - mov ecx, dword ptr[eax]; - mov LeftTreeAddr, ecx; - mov LeftTreeHead, eax; - mov ecx, dword ptr[eax + 0x4]; - mov RightTreeAddr, ecx; - popad; - } - - while (1) { - DWORD wxIdAddr = 0; - DWORD wxNumberAddr = 0; - DWORD wxNickNameAddr = 0; - DWORD wxRemarkAddr = 0; - - __asm { - pushad; - mov eax, dword ptr [LeftTreeAddr]; - mov ecx, eax; - add ecx, 0x30; - mov wxIdAddr, ecx; - mov ecx, eax; - add ecx, 0x44; - mov wxNumberAddr, ecx; - mov ecx, eax; - add ecx, 0x8C; - mov wxNickNameAddr, ecx; - mov ecx, eax; - add ecx, 0x78; - mov wxRemarkAddr, ecx; - mov ecx, dword ptr [eax]; - mov LeftTreeAddr, ecx; - popad; - } - WxFriendStructW p(wxIdAddr, wxNumberAddr, wxNickNameAddr, wxRemarkAddr); - WxFriendList.push_back(p); - if (LeftTreeAddr == LeftTreeHead) { - break; - } - } +#include "pch.h" +#include +using namespace std; +#define LeftTreeOffset 0x222F3BC + + +struct WxFriendStructW { + DWORD wxIdAddr; + DWORD wxNumberAddr; + DWORD wxNickNameAddr; + DWORD wxRemarkAddr; + WxFriendStructW(DWORD wxIdAddr, DWORD wxNumberAddr, DWORD wxNickNameAddr, DWORD wxRemarkAddr) { + this->wxIdAddr = wxIdAddr; + this->wxNumberAddr = wxNumberAddr; + this->wxNickNameAddr = wxNickNameAddr; + this->wxRemarkAddr = wxRemarkAddr; + } +}; + +vector WxFriendList; + +int GetFriendListInit() { + GetFriendList(); +#ifdef _DEBUG + cout << WxFriendList.size() << endl; +#endif + return WxFriendList.size(); +} + +DWORD GetFriendListRemote() { + if (WxFriendList.size() == 0) + return 0; +#ifdef _DEBUG + printf("0x%08X\n", (DWORD)&WxFriendList[0]); + printf("0x%08X\n", (DWORD)&(WxFriendList[0].wxIdAddr)); +#endif + return (DWORD)&WxFriendList[0].wxIdAddr; +} + +void GetFriendListFinish() { + WxFriendList.clear(); + cout << WxFriendList.size() << endl; +} + +void __stdcall GetFriendList() { + + DWORD WeChatWinBase = GetWeChatWinBase(); + DWORD LeftTreeAddr = 0; + DWORD RightTreeAddr = 0; + DWORD LeftTreeHead = 0; + DWORD baseAddr = WeChatWinBase + LeftTreeOffset; + printf("0x%08X\n", baseAddr); + __asm { + pushad; + mov eax, dword ptr[baseAddr]; + mov eax, dword ptr[eax]; + mov eax, dword ptr[eax + 0x4C]; + mov ecx, dword ptr[eax]; + mov LeftTreeAddr, ecx; + mov LeftTreeHead, eax; + mov ecx, dword ptr[eax + 0x4]; + mov RightTreeAddr, ecx; + popad; + } + + while (1) { + DWORD wxIdAddr = 0; + DWORD wxNumberAddr = 0; + DWORD wxNickNameAddr = 0; + DWORD wxRemarkAddr = 0; + + __asm { + pushad; + mov eax, dword ptr [LeftTreeAddr]; + mov ecx, eax; + add ecx, 0x30; + mov wxIdAddr, ecx; + mov ecx, eax; + add ecx, 0x44; + mov wxNumberAddr, ecx; + mov ecx, eax; + add ecx, 0x8C; + mov wxNickNameAddr, ecx; + mov ecx, eax; + add ecx, 0x78; + mov wxRemarkAddr, ecx; + mov ecx, dword ptr [eax]; + mov LeftTreeAddr, ecx; + popad; + } + WxFriendStructW p(wxIdAddr, wxNumberAddr, wxNickNameAddr, wxRemarkAddr); + WxFriendList.push_back(p); + if (LeftTreeAddr == LeftTreeHead) { + break; + } + } } \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/FriendList.h b/DWeChatRobot/FriendList.h similarity index 71% rename from DWeChatRobot_3.5.0.46/FriendList.h rename to DWeChatRobot/FriendList.h index 5ab556de2bb610b131b67d0c5c409fade0a78df3..51593ee1856ea68818c7b5200026f39529745c40 100644 --- a/DWeChatRobot_3.5.0.46/FriendList.h +++ b/DWeChatRobot/FriendList.h @@ -1,6 +1,6 @@ -#pragma once -void __stdcall GetFriendList(); - -extern "C" __declspec(dllexport) DWORD GetFriendListRemote(); -extern "C" __declspec(dllexport) int GetFriendListInit(); +#pragma once +void __stdcall GetFriendList(); + +extern "C" __declspec(dllexport) DWORD GetFriendListRemote(); +extern "C" __declspec(dllexport) int GetFriendListInit(); extern "C" __declspec(dllexport) void GetFriendListFinish(); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SelfInfo.cpp b/DWeChatRobot/SelfInfo.cpp similarity index 100% rename from DWeChatRobot_3.6.0.18/SelfInfo.cpp rename to DWeChatRobot/SelfInfo.cpp diff --git a/DWeChatRobot_3.5.0.46/SelfInfo.h b/DWeChatRobot/SelfInfo.h similarity index 100% rename from DWeChatRobot_3.5.0.46/SelfInfo.h rename to DWeChatRobot/SelfInfo.h diff --git a/DWeChatRobot_3.6.0.18/SendArticle.cpp b/DWeChatRobot/SendArticle.cpp similarity index 100% rename from DWeChatRobot_3.6.0.18/SendArticle.cpp rename to DWeChatRobot/SendArticle.cpp diff --git a/DWeChatRobot_3.5.0.46/SendArticle.h b/DWeChatRobot/SendArticle.h similarity index 100% rename from DWeChatRobot_3.5.0.46/SendArticle.h rename to DWeChatRobot/SendArticle.h diff --git a/DWeChatRobot_3.6.0.18/SendCard.cpp b/DWeChatRobot/SendCard.cpp similarity index 100% rename from DWeChatRobot_3.6.0.18/SendCard.cpp rename to DWeChatRobot/SendCard.cpp diff --git a/DWeChatRobot_3.5.0.46/SendCard.h b/DWeChatRobot/SendCard.h similarity index 100% rename from DWeChatRobot_3.5.0.46/SendCard.h rename to DWeChatRobot/SendCard.h diff --git a/DWeChatRobot_3.6.0.18/SendFile.cpp b/DWeChatRobot/SendFile.cpp similarity index 95% rename from DWeChatRobot_3.6.0.18/SendFile.cpp rename to DWeChatRobot/SendFile.cpp index 3ce9478b49aa7c77feeb1f8773baa119cce9755e..e78d0939c2ddba3c557d280e5992396ba2e81d89 100644 --- a/DWeChatRobot_3.6.0.18/SendFile.cpp +++ b/DWeChatRobot/SendFile.cpp @@ -1,126 +1,126 @@ -#include "pch.h" - -#define SendFileCall1Offset (0x67A71DC0 - 0x67370000) -#define SendFileCall2Offset (0x68D81C83 - 0x67370000) -#define SendFileCall3Offset (0x68D8047A - 0x67370000) -#define SendFileCall4Offset (0x67702260 - 0x67370000) -#define SendFileParamsOffset (0x6959F170 - 0x67370000) - -#define DeleteSendFileCacheCallOffset (0x67404200 - 0x67370000) - -struct FileParamStruct { - DWORD wxid; - DWORD filepath; -}; - -struct WxFileStruct { - int type = 3; - wchar_t* buffer; - DWORD length; - DWORD maxLength; - char fill[0x34] = { 0 }; - - WxFileStruct(wchar_t* pStr) { - buffer = pStr; - length = wcslen(pStr); - maxLength = wcslen(pStr) * 2; - } -}; - -void SendFileRemote(LPVOID lpParamStruct) { - FileParamStruct* params = (FileParamStruct*)lpParamStruct; - SendFile((WCHAR*)params->wxid, (WCHAR*)params->filepath); -} - -void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath) { - WxBaseStruct pReceiver(receiver); - WxBaseStruct pFilePath(FilePath); - WxFileStruct esi_(FilePath); - - DWORD WeChatWinBase = GetWeChatWinBase(); - - DWORD WxSendFileCall1 = WeChatWinBase + SendFileCall1Offset; - DWORD WxSendFileCall2 = WeChatWinBase + SendFileCall2Offset; - DWORD WxSendFileCall3 = WeChatWinBase + SendFileCall3Offset; - DWORD WxSendFileCall4 = WeChatWinBase + SendFileCall4Offset; - DWORD WxSendFileParams = WeChatWinBase + SendFileParamsOffset; - DWORD DeleteSendFileCacheCall = WeChatWinBase + DeleteSendFileCacheCallOffset; - - char buffer[0x3B0] = { 0 }; - - DWORD edi_ = pReceiver.length; - DWORD ptrReceiver = (DWORD)pReceiver.buffer; - - DWORD tempecx = 0; - - __asm { - pushad; - pushfd; - lea esi, esi_; - push 0; - push 0; - push 0; - push 0; - push 0; - push 0x005A0000; - sub esp, 0x14; - mov edi, esp; - mov dword ptr ds : [edi] , 0x0; - mov dword ptr ds : [edi + 0x4] , 0x0; - mov dword ptr ds : [edi + 0x8] , 0x0; - mov dword ptr ds : [edi + 0xC] , 0x0; - mov dword ptr ds : [edi + 0x10] , 0x0; - - sub esp, 0x14; - lea eax, dword ptr ds : [esi + 0x4] ; - mov ecx, esp; - push eax; - call WxSendFileCall1; - - sub esp, 0x14; - mov ecx, esp; - mov dword ptr ds : [ecx] , 0x0; - mov dword ptr ds : [ecx + 0x4] , 0x0; - mov dword ptr ds : [ecx + 0x8] , 0x0; - mov dword ptr ds : [ecx + 0xC] , 0x0; - mov dword ptr ds : [ecx + 0x10] , 0x0; - - lea edx, pReceiver; - mov eax, [edx]; - - mov edi, edi_; - lea eax, dword ptr ds : [edi * 2 + 0x2] ; - mov tempecx, ecx; - push eax; - push dword ptr ds : [ecx] ; - call WxSendFileCall2; - mov ecx, [tempecx]; - mov edx, eax; - add esp, 0x8; - - mov eax, dword ptr ds : [ecx + 0x4] ; - mov dword ptr ds : [ecx] , edx; - mov dword ptr ds : [ecx + 0x8] , edi; - mov tempecx, ecx; - push edi; - push ptrReceiver; - push dword ptr ds : [ecx] ; - call WxSendFileCall3; - mov ecx, [tempecx]; - add esp, 0xC; - - mov edx, 0x0; - mov eax, dword ptr ds : [ecx] ; - mov word ptr ds : [eax + edi * 2] , 0x0; - mov dword ptr ds : [ecx + 0x4] , edi; - - mov ecx, WxSendFileParams; - lea eax, buffer; - push eax; - call WxSendFileCall4; - lea ecx, buffer; - call DeleteSendFileCacheCall; - popfd; - popad; - } +#include "pch.h" + +#define SendFileCall1Offset (0x67A71DC0 - 0x67370000) +#define SendFileCall2Offset (0x68D81C83 - 0x67370000) +#define SendFileCall3Offset (0x68D8047A - 0x67370000) +#define SendFileCall4Offset (0x67702260 - 0x67370000) +#define SendFileParamsOffset (0x6959F170 - 0x67370000) + +#define DeleteSendFileCacheCallOffset (0x67404200 - 0x67370000) + +struct FileParamStruct { + DWORD wxid; + DWORD filepath; +}; + +struct WxFileStruct { + int type = 3; + wchar_t* buffer; + DWORD length; + DWORD maxLength; + char fill[0x34] = { 0 }; + + WxFileStruct(wchar_t* pStr) { + buffer = pStr; + length = wcslen(pStr); + maxLength = wcslen(pStr) * 2; + } +}; + +void SendFileRemote(LPVOID lpParamStruct) { + FileParamStruct* params = (FileParamStruct*)lpParamStruct; + SendFile((WCHAR*)params->wxid, (WCHAR*)params->filepath); +} + +void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath) { + WxBaseStruct pReceiver(receiver); + WxBaseStruct pFilePath(FilePath); + WxFileStruct esi_(FilePath); + + DWORD WeChatWinBase = GetWeChatWinBase(); + + DWORD WxSendFileCall1 = WeChatWinBase + SendFileCall1Offset; + DWORD WxSendFileCall2 = WeChatWinBase + SendFileCall2Offset; + DWORD WxSendFileCall3 = WeChatWinBase + SendFileCall3Offset; + DWORD WxSendFileCall4 = WeChatWinBase + SendFileCall4Offset; + DWORD WxSendFileParams = WeChatWinBase + SendFileParamsOffset; + DWORD DeleteSendFileCacheCall = WeChatWinBase + DeleteSendFileCacheCallOffset; + + char buffer[0x3B0] = { 0 }; + + DWORD edi_ = pReceiver.length; + DWORD ptrReceiver = (DWORD)pReceiver.buffer; + + DWORD tempecx = 0; + + __asm { + pushad; + pushfd; + lea esi, esi_; + push 0; + push 0; + push 0; + push 0; + push 0; + push 0x005A0000; + sub esp, 0x14; + mov edi, esp; + mov dword ptr ds : [edi] , 0x0; + mov dword ptr ds : [edi + 0x4] , 0x0; + mov dword ptr ds : [edi + 0x8] , 0x0; + mov dword ptr ds : [edi + 0xC] , 0x0; + mov dword ptr ds : [edi + 0x10] , 0x0; + + sub esp, 0x14; + lea eax, dword ptr ds : [esi + 0x4] ; + mov ecx, esp; + push eax; + call WxSendFileCall1; + + sub esp, 0x14; + mov ecx, esp; + mov dword ptr ds : [ecx] , 0x0; + mov dword ptr ds : [ecx + 0x4] , 0x0; + mov dword ptr ds : [ecx + 0x8] , 0x0; + mov dword ptr ds : [ecx + 0xC] , 0x0; + mov dword ptr ds : [ecx + 0x10] , 0x0; + + lea edx, pReceiver; + mov eax, [edx]; + + mov edi, edi_; + lea eax, dword ptr ds : [edi * 2 + 0x2] ; + mov tempecx, ecx; + push eax; + push dword ptr ds : [ecx] ; + call WxSendFileCall2; + mov ecx, [tempecx]; + mov edx, eax; + add esp, 0x8; + + mov eax, dword ptr ds : [ecx + 0x4] ; + mov dword ptr ds : [ecx] , edx; + mov dword ptr ds : [ecx + 0x8] , edi; + mov tempecx, ecx; + push edi; + push ptrReceiver; + push dword ptr ds : [ecx] ; + call WxSendFileCall3; + mov ecx, [tempecx]; + add esp, 0xC; + + mov edx, 0x0; + mov eax, dword ptr ds : [ecx] ; + mov word ptr ds : [eax + edi * 2] , 0x0; + mov dword ptr ds : [ecx + 0x4] , edi; + + mov ecx, WxSendFileParams; + lea eax, buffer; + push eax; + call WxSendFileCall4; + lea ecx, buffer; + call DeleteSendFileCacheCall; + popfd; + popad; + } } \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SendFile.h b/DWeChatRobot/SendFile.h similarity index 91% rename from DWeChatRobot_3.6.0.18/SendFile.h rename to DWeChatRobot/SendFile.h index c0b081648f7efb1b6a99253f3045dc966f86b17f..62ab1507f51ea41940087388a02e8e8b2ee01a49 100644 --- a/DWeChatRobot_3.6.0.18/SendFile.h +++ b/DWeChatRobot/SendFile.h @@ -1,5 +1,5 @@ -#pragma once -#include - -void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath); +#pragma once +#include + +void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath); extern "C" __declspec(dllexport) void SendFileRemote(LPVOID lpParamStruct); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SendImage.cpp b/DWeChatRobot/SendImage.cpp similarity index 96% rename from DWeChatRobot_3.6.0.18/SendImage.cpp rename to DWeChatRobot/SendImage.cpp index e99bd055233e798ad3f77328cdac7deb4641282f..fec61bb159c03f9c81539f3290e8eff6d04ef4a3 100644 --- a/DWeChatRobot_3.6.0.18/SendImage.cpp +++ b/DWeChatRobot/SendImage.cpp @@ -1,51 +1,51 @@ -#include "pch.h" - -#define SendImageCall1Offset (0x6740A1C0 - 0x67370000) -#define SendImageCall2Offset (0x67A71DC0 - 0x67370000) -#define SendImageCall3Offset (0x6782E160 - 0x67370000) -#define DeleteSendImageCacheCallOffset (0x67404200 - 0x67370000) - -struct ImageParamStruct { - DWORD wxid; - DWORD imagepath; -}; - -void SendImageRemote(LPVOID lpParamStruct) { - ImageParamStruct* params = (ImageParamStruct*)lpParamStruct; - SendImage((WCHAR*)params->wxid, (WCHAR*)params->imagepath); -} - -void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath) { - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD SendImageCall1 = WeChatWinBase + SendImageCall1Offset; - DWORD SendImageCall2 = WeChatWinBase + SendImageCall2Offset; - DWORD SendImageCall3 = WeChatWinBase + SendImageCall3Offset; - DWORD DeleteSendImageCacheCall = WeChatWinBase + DeleteSendImageCacheCallOffset; - char nullbuffer[0x50] = { 0 }; - char buffer[0x3B0] = { 0 }; - WxBaseStruct pReceiver(receiver); - WxBaseStruct pImagePath(ImagePath); - WxString nullStruct = { 0 }; - - __asm { - pushad; - call SendImageCall1; - sub esp, 0x14; - mov ebx, eax; - lea eax, nullStruct; - mov ecx, esp; - lea edi, pImagePath; - push eax; - call SendImageCall2; - mov ecx, ebx; - lea eax, pReceiver; - push edi; - push eax; - lea eax, buffer; - push eax; - call SendImageCall3; - lea ecx, buffer; - call DeleteSendImageCacheCall; - popad; - } +#include "pch.h" + +#define SendImageCall1Offset (0x6740A1C0 - 0x67370000) +#define SendImageCall2Offset (0x67A71DC0 - 0x67370000) +#define SendImageCall3Offset (0x6782E160 - 0x67370000) +#define DeleteSendImageCacheCallOffset (0x67404200 - 0x67370000) + +struct ImageParamStruct { + DWORD wxid; + DWORD imagepath; +}; + +void SendImageRemote(LPVOID lpParamStruct) { + ImageParamStruct* params = (ImageParamStruct*)lpParamStruct; + SendImage((WCHAR*)params->wxid, (WCHAR*)params->imagepath); +} + +void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath) { + DWORD WeChatWinBase = GetWeChatWinBase(); + DWORD SendImageCall1 = WeChatWinBase + SendImageCall1Offset; + DWORD SendImageCall2 = WeChatWinBase + SendImageCall2Offset; + DWORD SendImageCall3 = WeChatWinBase + SendImageCall3Offset; + DWORD DeleteSendImageCacheCall = WeChatWinBase + DeleteSendImageCacheCallOffset; + char nullbuffer[0x50] = { 0 }; + char buffer[0x3B0] = { 0 }; + WxBaseStruct pReceiver(receiver); + WxBaseStruct pImagePath(ImagePath); + WxString nullStruct = { 0 }; + + __asm { + pushad; + call SendImageCall1; + sub esp, 0x14; + mov ebx, eax; + lea eax, nullStruct; + mov ecx, esp; + lea edi, pImagePath; + push eax; + call SendImageCall2; + mov ecx, ebx; + lea eax, pReceiver; + push edi; + push eax; + lea eax, buffer; + push eax; + call SendImageCall3; + lea ecx, buffer; + call DeleteSendImageCacheCall; + popad; + } } \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SendImage.h b/DWeChatRobot/SendImage.h similarity index 91% rename from DWeChatRobot_3.6.0.18/SendImage.h rename to DWeChatRobot/SendImage.h index 57cdd2e678abdadc4a3f15e73d82464f6aa0735a..5c39f0459e51a6648abe9ae0c08d48719d83462d 100644 --- a/DWeChatRobot_3.6.0.18/SendImage.h +++ b/DWeChatRobot/SendImage.h @@ -1,5 +1,5 @@ -#pragma once -#include - -void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath); +#pragma once +#include + +void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath); extern "C" __declspec(dllexport) void SendImageRemote(LPVOID lpParamStruct); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SendText.cpp b/DWeChatRobot/SendText.cpp similarity index 96% rename from DWeChatRobot_3.6.0.18/SendText.cpp rename to DWeChatRobot/SendText.cpp index c1842d9e5390376dad92028fbb0dbac977dbc374..16eb053600d8db41b6d853c3611c841ee9043aaa 100644 --- a/DWeChatRobot_3.6.0.18/SendText.cpp +++ b/DWeChatRobot/SendText.cpp @@ -1,45 +1,45 @@ -#include "pch.h" - -#define SendTextCallOffset 0x6782E7B0 - 0x67370000 -#define DeleteTextCacheCallOffset 0x67404200 - 0x67370000 - -struct SendTextStruct -{ - DWORD wxid; - DWORD wxmsg; -}; - -void SendTextRemote(LPVOID lpParameter) { - SendTextStruct* rp = (SendTextStruct*)lpParameter; - wchar_t* wsWxId = (WCHAR*)rp->wxid; - wchar_t* wsTextMsg = (WCHAR*)rp->wxmsg; - SendText(wsWxId, wsTextMsg); -} - -void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg) { - WxBaseStruct wxWxid(wsWxId); - WxBaseStruct wxTextMsg(wsTextMsg); - wchar_t** pWxmsg = &wxTextMsg.buffer; - char buffer[0x3B0] = { 0 }; - - WxString wxNull = { 0 }; - DWORD dllBaseAddress = GetWeChatWinBase(); - DWORD callAddress = dllBaseAddress + SendTextCallOffset; - DWORD DeleteTextCacheCall = dllBaseAddress + DeleteTextCacheCallOffset; - - __asm { - pushad; - lea eax, wxNull; - push 0x1; - push eax; - mov edi, pWxmsg; - push edi; - lea edx, wxWxid; - lea ecx, buffer; - call callAddress; - add esp, 0xC; - lea ecx, buffer; - call DeleteTextCacheCall; - popad; - } +#include "pch.h" + +#define SendTextCallOffset 0x6782E7B0 - 0x67370000 +#define DeleteTextCacheCallOffset 0x67404200 - 0x67370000 + +struct SendTextStruct +{ + DWORD wxid; + DWORD wxmsg; +}; + +void SendTextRemote(LPVOID lpParameter) { + SendTextStruct* rp = (SendTextStruct*)lpParameter; + wchar_t* wsWxId = (WCHAR*)rp->wxid; + wchar_t* wsTextMsg = (WCHAR*)rp->wxmsg; + SendText(wsWxId, wsTextMsg); +} + +void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg) { + WxBaseStruct wxWxid(wsWxId); + WxBaseStruct wxTextMsg(wsTextMsg); + wchar_t** pWxmsg = &wxTextMsg.buffer; + char buffer[0x3B0] = { 0 }; + + WxString wxNull = { 0 }; + DWORD dllBaseAddress = GetWeChatWinBase(); + DWORD callAddress = dllBaseAddress + SendTextCallOffset; + DWORD DeleteTextCacheCall = dllBaseAddress + DeleteTextCacheCallOffset; + + __asm { + pushad; + lea eax, wxNull; + push 0x1; + push eax; + mov edi, pWxmsg; + push edi; + lea edx, wxWxid; + lea ecx, buffer; + call callAddress; + add esp, 0xC; + lea ecx, buffer; + call DeleteTextCacheCall; + popad; + } } \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendText.h b/DWeChatRobot/SendText.h similarity index 92% rename from DWeChatRobot_3.5.0.46/SendText.h rename to DWeChatRobot/SendText.h index 7a347e476e0f43ab610cb2744a2d323426704e63..6c16f450fef64c85efc2ab5640d930870cf0077b 100644 --- a/DWeChatRobot_3.5.0.46/SendText.h +++ b/DWeChatRobot/SendText.h @@ -1,5 +1,5 @@ -#pragma once -#include - -void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg); +#pragma once +#include + +void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg); extern "C" __declspec(dllexport) void SendTextRemote(LPVOID lpParameter); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/UserInfo.cpp b/DWeChatRobot/UserInfo.cpp similarity index 96% rename from DWeChatRobot_3.6.0.18/UserInfo.cpp rename to DWeChatRobot/UserInfo.cpp index 160a3c43166064896b164c0a4b909d954ad37847..27f3f4feaa9b419e0c16d4cd96815b4165bf56f9 100644 --- a/DWeChatRobot_3.6.0.18/UserInfo.cpp +++ b/DWeChatRobot/UserInfo.cpp @@ -1,129 +1,129 @@ -#include "pch.h" -#include -#include -#include - -#define GetUserInfoCall0Offset 0x6740A000 - 0x67370000 -#define GetUserInfoCall1Offset 0x679C9840 - 0x67370000 -#define GetUserInfoCall2Offset 0x67A71DC0 - 0x67370000 -#define GetUserInfoCall3Offset 0x677724A0 - 0x67370000 - -#define DeleteUserInfoCacheCall1Offset 0x67775990 - 0x67370000 -#define DeleteUserInfoCacheCall2Offset 0x679CA340 - 0x67370000 - -struct GetUserInfoStruct { - DWORD message; - DWORD length; -}; - -wstring wUserInfo = L""; -GetUserInfoStruct ret = { 0 }; - -VOID WxUserInfo(DWORD address) { - vector InfoType{ - address + 0x10, - address + 0x24, - address + 0x38, - address + 0x6C, - address + 0xFC, - address + 0x110, - address + 0x19C, - address + 0x1B0, - address + 0x1C4, - address + 0x1D8, - address + 0x27C - }; - vector InfoTypeName{ - (WCHAR*)L"\"wxId\"", - (WCHAR*)L"\"wxNumber\"", - (WCHAR*)L"\"wxV3\"", - (WCHAR*)L"\"wxNickName\"", - (WCHAR*)L"\"wxBigAvatar\"", - (WCHAR*)L"\"wxSmallAvatar\"", - (WCHAR*)L"\"wxSignature\"", - (WCHAR*)L"\"wxNation\"", - (WCHAR*)L"\"wxProvince\"", - (WCHAR*)L"\"wxCity\"", - (WCHAR*)L"\"wxBackground\"", - }; - wUserInfo += L"{"; - for (unsigned int i = 0; i < InfoType.size(); i++) { - wchar_t* wstemp = ((*((DWORD*)InfoType[i])) != 0) ? (WCHAR*)(*((LPVOID*)InfoType[i])) : (WCHAR*)L"null"; - wUserInfo = wUserInfo + InfoTypeName[i] + L":\"" + wstemp + L"\""; - if (i != InfoType.size() - 1) { - wUserInfo += L","; - } - } - wUserInfo += L"}"; -#ifdef _DEBUG - wcout.imbue(locale("chs")); - wcout << wUserInfo.c_str() << endl; -#endif -} - - -DWORD GetWxUserInfoRemote(LPVOID lparamter) { - wchar_t* userwxid = (wchar_t*)lparamter; - - if (!GetUserInfoByWxId(userwxid)) { - return 0; - } - ret.message = (DWORD)wUserInfo.c_str(); - ret.length = (DWORD)wUserInfo.length(); - return (DWORD)&ret; -} - -VOID DeleteUserInfoCacheRemote() { - if (ret.length) { - ZeroMemory((wchar_t*)ret.message, ret.length * 2 + 2); - ret.length = 0; - wUserInfo = L""; - } -} - -BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) { - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD WxGetUserInfoCall0 = WeChatWinBase + GetUserInfoCall0Offset; - DWORD WxGetUserInfoCall1 = WeChatWinBase + GetUserInfoCall1Offset; - DWORD WxGetUserInfoCall2 = WeChatWinBase + GetUserInfoCall2Offset; - DWORD WxGetUserInfoCall3 = WeChatWinBase + GetUserInfoCall3Offset; - DWORD DeleteUserInofCacheCall1 = WeChatWinBase + DeleteUserInfoCacheCall1Offset; - DWORD DeleteUserInofCacheCall2 = WeChatWinBase + DeleteUserInfoCacheCall2Offset; - char buffer[0x3FC] = { 0 }; - WxBaseStruct pWxid(wxid); - DWORD address = 0; - DWORD isSuccess = 0; - __asm - { - pushad; - call WxGetUserInfoCall0; - mov edi, eax; - lea ecx, buffer; - call WxGetUserInfoCall1; - lea eax, buffer; - mov address, eax; - push eax; - sub esp, 0x14; - mov ecx, esp; - lea esi, pWxid; - push esi; - call WxGetUserInfoCall2; - mov ecx, edi; - call WxGetUserInfoCall3; - mov isSuccess, eax; - popad; - } - if(isSuccess) - WxUserInfo(address); - __asm { - pushad; - lea eax, buffer; - push eax; - call DeleteUserInofCacheCall1; - lea ecx, buffer; - mov esi, eax; - call DeleteUserInofCacheCall2; - popad; - } - return isSuccess; +#include "pch.h" +#include +#include +#include + +#define GetUserInfoCall0Offset 0x6740A000 - 0x67370000 +#define GetUserInfoCall1Offset 0x679C9840 - 0x67370000 +#define GetUserInfoCall2Offset 0x67A71DC0 - 0x67370000 +#define GetUserInfoCall3Offset 0x677724A0 - 0x67370000 + +#define DeleteUserInfoCacheCall1Offset 0x67775990 - 0x67370000 +#define DeleteUserInfoCacheCall2Offset 0x679CA340 - 0x67370000 + +struct GetUserInfoStruct { + DWORD message; + DWORD length; +}; + +wstring wUserInfo = L""; +GetUserInfoStruct ret = { 0 }; + +VOID WxUserInfo(DWORD address) { + vector InfoType{ + address + 0x10, + address + 0x24, + address + 0x38, + address + 0x6C, + address + 0xFC, + address + 0x110, + address + 0x19C, + address + 0x1B0, + address + 0x1C4, + address + 0x1D8, + address + 0x27C + }; + vector InfoTypeName{ + (WCHAR*)L"\"wxId\"", + (WCHAR*)L"\"wxNumber\"", + (WCHAR*)L"\"wxV3\"", + (WCHAR*)L"\"wxNickName\"", + (WCHAR*)L"\"wxBigAvatar\"", + (WCHAR*)L"\"wxSmallAvatar\"", + (WCHAR*)L"\"wxSignature\"", + (WCHAR*)L"\"wxNation\"", + (WCHAR*)L"\"wxProvince\"", + (WCHAR*)L"\"wxCity\"", + (WCHAR*)L"\"wxBackground\"", + }; + wUserInfo += L"{"; + for (unsigned int i = 0; i < InfoType.size(); i++) { + wchar_t* wstemp = ((*((DWORD*)InfoType[i])) != 0) ? (WCHAR*)(*((LPVOID*)InfoType[i])) : (WCHAR*)L"null"; + wUserInfo = wUserInfo + InfoTypeName[i] + L":\"" + wstemp + L"\""; + if (i != InfoType.size() - 1) { + wUserInfo += L","; + } + } + wUserInfo += L"}"; +#ifdef _DEBUG + wcout.imbue(locale("chs")); + wcout << wUserInfo.c_str() << endl; +#endif +} + + +DWORD GetWxUserInfoRemote(LPVOID lparamter) { + wchar_t* userwxid = (wchar_t*)lparamter; + + if (!GetUserInfoByWxId(userwxid)) { + return 0; + } + ret.message = (DWORD)wUserInfo.c_str(); + ret.length = (DWORD)wUserInfo.length(); + return (DWORD)&ret; +} + +VOID DeleteUserInfoCacheRemote() { + if (ret.length) { + ZeroMemory((wchar_t*)ret.message, ret.length * 2 + 2); + ret.length = 0; + wUserInfo = L""; + } +} + +BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid) { + DWORD WeChatWinBase = GetWeChatWinBase(); + DWORD WxGetUserInfoCall0 = WeChatWinBase + GetUserInfoCall0Offset; + DWORD WxGetUserInfoCall1 = WeChatWinBase + GetUserInfoCall1Offset; + DWORD WxGetUserInfoCall2 = WeChatWinBase + GetUserInfoCall2Offset; + DWORD WxGetUserInfoCall3 = WeChatWinBase + GetUserInfoCall3Offset; + DWORD DeleteUserInofCacheCall1 = WeChatWinBase + DeleteUserInfoCacheCall1Offset; + DWORD DeleteUserInofCacheCall2 = WeChatWinBase + DeleteUserInfoCacheCall2Offset; + char buffer[0x3FC] = { 0 }; + WxBaseStruct pWxid(wxid); + DWORD address = 0; + DWORD isSuccess = 0; + __asm + { + pushad; + call WxGetUserInfoCall0; + mov edi, eax; + lea ecx, buffer; + call WxGetUserInfoCall1; + lea eax, buffer; + mov address, eax; + push eax; + sub esp, 0x14; + mov ecx, esp; + lea esi, pWxid; + push esi; + call WxGetUserInfoCall2; + mov ecx, edi; + call WxGetUserInfoCall3; + mov isSuccess, eax; + popad; + } + if(isSuccess) + WxUserInfo(address); + __asm { + pushad; + lea eax, buffer; + push eax; + call DeleteUserInofCacheCall1; + lea ecx, buffer; + mov esi, eax; + call DeleteUserInofCacheCall2; + popad; + } + return isSuccess; } \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/UserInfo.h b/DWeChatRobot/UserInfo.h similarity index 97% rename from DWeChatRobot_3.6.0.18/UserInfo.h rename to DWeChatRobot/UserInfo.h index 465776e1db2f3b11204b917082d7cb2d2fc09622..f7bca702c544a053a468541c8741c3a674b7f04c 100644 --- a/DWeChatRobot_3.6.0.18/UserInfo.h +++ b/DWeChatRobot/UserInfo.h @@ -1,5 +1,5 @@ -#pragma once -#include -BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid); -extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter); +#pragma once +#include +BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid); +extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter); extern "C" __declspec(dllexport) VOID DeleteUserInfoCacheRemote(); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/dllmain.cpp b/DWeChatRobot/dllmain.cpp similarity index 96% rename from DWeChatRobot_3.6.0.18/dllmain.cpp rename to DWeChatRobot/dllmain.cpp index 8657c4cbd1a0570f4b932217d8e8cd72e6845f59..7c60eabbbc0eca3f75f60fe421fb36d8ed9a470c 100644 --- a/DWeChatRobot_3.6.0.18/dllmain.cpp +++ b/DWeChatRobot/dllmain.cpp @@ -1,46 +1,46 @@ -// dllmain.cpp : 定义 DLL 应用程序的入口点。 -#include "pch.h" - -#ifdef _DEBUG - int detach_count = 0; -#endif - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - { -#ifdef _DEBUG - CreateConsole(); - DWORD base = (DWORD)GetModuleHandleA("DWeChatRobot.dll"); - - printf("SendImage 0x%08X\n", (DWORD)SendImage); - printf("SendText 0x%08X\n", (DWORD)SendText); - printf("SendFile 0x%08X\n", (DWORD)SendFile); - printf("GetFriendList 0x%08X\n", (DWORD)GetFriendList); - printf("GetUserInfoByWxId 0x%08X\n", (DWORD)GetUserInfoByWxId); - printf("SendArticle 0x%08X\n", (DWORD)SendArticle); - printf("SendCard 0x%08X\n", (DWORD)SendCard); -#endif - break; - } - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: { -#ifdef _DEBUG - detach_count++; - if (detach_count != 1) { - // FreeConsole(); - // UnHookAll(); - } -#endif - break; - } - } - return TRUE; -} - +// dllmain.cpp : 定义 DLL 应用程序的入口点。 +#include "pch.h" + +#ifdef _DEBUG + int detach_count = 0; +#endif + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + { +#ifdef _DEBUG + CreateConsole(); + DWORD base = (DWORD)GetModuleHandleA("DWeChatRobot.dll"); + + printf("SendImage 0x%08X\n", (DWORD)SendImage); + printf("SendText 0x%08X\n", (DWORD)SendText); + printf("SendFile 0x%08X\n", (DWORD)SendFile); + printf("GetFriendList 0x%08X\n", (DWORD)GetFriendList); + printf("GetUserInfoByWxId 0x%08X\n", (DWORD)GetUserInfoByWxId); + printf("SendArticle 0x%08X\n", (DWORD)SendArticle); + printf("SendCard 0x%08X\n", (DWORD)SendCard); +#endif + break; + } + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: { +#ifdef _DEBUG + detach_count++; + if (detach_count != 1) { + // FreeConsole(); + // UnHookAll(); + } +#endif + break; + } + } + return TRUE; +} + diff --git a/DWeChatRobot_3.6.0.18/framework.h b/DWeChatRobot/framework.h similarity index 96% rename from DWeChatRobot_3.6.0.18/framework.h rename to DWeChatRobot/framework.h index 3f0fc4ac20254c2a75028938d8faae302f52f73b..80cbbc9b06a9b0141f92ee19eceaed71328caff4 100644 --- a/DWeChatRobot_3.6.0.18/framework.h +++ b/DWeChatRobot/framework.h @@ -1,5 +1,5 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 -// Windows 头文件 -#include +#pragma once + +#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 +// Windows 头文件 +#include diff --git a/DWeChatRobot_3.6.0.18/pch.cpp b/DWeChatRobot/pch.cpp similarity index 97% rename from DWeChatRobot_3.6.0.18/pch.cpp rename to DWeChatRobot/pch.cpp index 0facc600694413d9a13e72b9ff8bfd0a4a291828..7ccf902085674dafc485dc1bc4402897ec45beed 100644 --- a/DWeChatRobot_3.6.0.18/pch.cpp +++ b/DWeChatRobot/pch.cpp @@ -1,67 +1,67 @@ -// pch.cpp: 与预编译标头对应的源文件 - -#include "pch.h" - -// 当使用预编译的头时,需要使用此源文件,编译才能成功。 -BOOL CreateConsole(void) { - if (AllocConsole()) { - AttachConsole(GetCurrentProcessId()); - FILE* retStream; - freopen_s(&retStream, "CONOUT$", "w", stdout); - if (!retStream) throw std::runtime_error("Stdout redirection failed."); - freopen_s(&retStream, "CONOUT$", "w", stderr); - if (!retStream) throw std::runtime_error("Stderr redirection failed."); - return 0; - } - return 1; -} - -DWORD GetWeChatWinBase() { - return (DWORD)GetModuleHandleA("WeChatWin.dll"); -} - -void Wchar_tToString(std::string& szDst, wchar_t* wchar) -{ - wchar_t* wText = wchar; - DWORD dwNum = WideCharToMultiByte(CP_OEMCP, NULL, wText, -1, NULL, 0, NULL, FALSE);// WideCharToMultiByte的运用 - char* psText; // psText为char*的临时数组,作为赋值给std::string的中间变量 - psText = new char[dwNum]; - WideCharToMultiByte(CP_OEMCP, NULL, wText, -1, psText, dwNum, NULL, FALSE);// WideCharToMultiByte的再次运用 - szDst = psText;// std::string赋值 - delete[]psText;// psText的清除 -} - -void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress,char* originalRecieveCode) -{ - //组装跳转数据 - BYTE jmpCode[5] = { 0 }; - jmpCode[0] = 0xE9; - - //计算偏移 - *(DWORD*)&jmpCode[1] = (DWORD)dwJmpAddress - dwHookAddr - 5; - - // 保存以前的属性用于还原 - DWORD OldProtext = 0; - - // 因为要往代码段写入数据,又因为代码段是不可写的,所以需要修改属性 - VirtualProtect((LPVOID)dwHookAddr, 5, PAGE_EXECUTE_READWRITE, &OldProtext); - ReadProcessMemory(GetCurrentProcess(), (LPVOID)dwHookAddr, originalRecieveCode, 5, 0); - - //写入自己的代码 - memcpy((void*)dwHookAddr, jmpCode, 5); - - // 执行完了操作之后需要进行还原 - VirtualProtect((LPVOID)dwHookAddr, 5, OldProtext, &OldProtext); -} - -void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode) -{ - DWORD OldProtext = 0; - VirtualProtect((LPVOID)dwHookAddr, 5, PAGE_EXECUTE_READWRITE, &OldProtext); - WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwHookAddr, originalRecieveCode, 5, 0); - VirtualProtect((LPVOID)dwHookAddr, 5, OldProtext, &OldProtext); -} - -void UnHookAll() { - return; +// pch.cpp: 与预编译标头对应的源文件 + +#include "pch.h" + +// 当使用预编译的头时,需要使用此源文件,编译才能成功。 +BOOL CreateConsole(void) { + if (AllocConsole()) { + AttachConsole(GetCurrentProcessId()); + FILE* retStream; + freopen_s(&retStream, "CONOUT$", "w", stdout); + if (!retStream) throw std::runtime_error("Stdout redirection failed."); + freopen_s(&retStream, "CONOUT$", "w", stderr); + if (!retStream) throw std::runtime_error("Stderr redirection failed."); + return 0; + } + return 1; +} + +DWORD GetWeChatWinBase() { + return (DWORD)GetModuleHandleA("WeChatWin.dll"); +} + +void Wchar_tToString(std::string& szDst, wchar_t* wchar) +{ + wchar_t* wText = wchar; + DWORD dwNum = WideCharToMultiByte(CP_OEMCP, NULL, wText, -1, NULL, 0, NULL, FALSE);// WideCharToMultiByte的运用 + char* psText; // psText为char*的临时数组,作为赋值给std::string的中间变量 + psText = new char[dwNum]; + WideCharToMultiByte(CP_OEMCP, NULL, wText, -1, psText, dwNum, NULL, FALSE);// WideCharToMultiByte的再次运用 + szDst = psText;// std::string赋值 + delete[]psText;// psText的清除 +} + +void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress,char* originalRecieveCode) +{ + //组装跳转数据 + BYTE jmpCode[5] = { 0 }; + jmpCode[0] = 0xE9; + + //计算偏移 + *(DWORD*)&jmpCode[1] = (DWORD)dwJmpAddress - dwHookAddr - 5; + + // 保存以前的属性用于还原 + DWORD OldProtext = 0; + + // 因为要往代码段写入数据,又因为代码段是不可写的,所以需要修改属性 + VirtualProtect((LPVOID)dwHookAddr, 5, PAGE_EXECUTE_READWRITE, &OldProtext); + ReadProcessMemory(GetCurrentProcess(), (LPVOID)dwHookAddr, originalRecieveCode, 5, 0); + + //写入自己的代码 + memcpy((void*)dwHookAddr, jmpCode, 5); + + // 执行完了操作之后需要进行还原 + VirtualProtect((LPVOID)dwHookAddr, 5, OldProtext, &OldProtext); +} + +void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode) +{ + DWORD OldProtext = 0; + VirtualProtect((LPVOID)dwHookAddr, 5, PAGE_EXECUTE_READWRITE, &OldProtext); + WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwHookAddr, originalRecieveCode, 5, 0); + VirtualProtect((LPVOID)dwHookAddr, 5, OldProtext, &OldProtext); +} + +void UnHookAll() { + return; } \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/pch.h b/DWeChatRobot/pch.h similarity index 96% rename from DWeChatRobot_3.6.0.18/pch.h rename to DWeChatRobot/pch.h index 048c94ca97dfbcfc7b603144f351e63c0650d8f8..5a4258556b7ca27dee3c3768b53882fcec13de3d 100644 --- a/DWeChatRobot_3.6.0.18/pch.h +++ b/DWeChatRobot/pch.h @@ -1,59 +1,59 @@ -// pch.h: 这是预编译标头文件。 -// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 -// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 -// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 -// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 -#pragma once -#ifndef PCH_H -#define PCH_H - -// 添加要在此处预编译的标头 -#include "framework.h" -#include -#include -#include "SendImage.h" -#include "SendText.h" -#include "SendFile.h" -#include "SendArticle.h" -#include "FriendList.h" -#include "UserInfo.h" -#include "SelfInfo.h" -#include "SendCard.h" -#endif //PCH_H - -using namespace std; -#define DLLEXPORT extern "C" __declspec(dllexport) - -struct WxBaseStruct -{ - wchar_t* buffer; - DWORD length; - DWORD maxLength; - DWORD fill1; - DWORD fill2; - - WxBaseStruct(wchar_t* pStr) { - buffer = pStr; - length = wcslen(pStr); - maxLength = wcslen(pStr) * 2; - fill1 = 0x0; - fill2 = 0x0; - } -}; - -struct WxString -{ - wchar_t* buffer; - DWORD length; - DWORD maxLength; - DWORD fill1 = 0; - DWORD fill2 = 0; -}; - - -BOOL CreateConsole(void); -DWORD GetWeChatWinBase(); -void Wchar_tToString(std::string& szDst, wchar_t* wchar); -void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode); -void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode); -DLLEXPORT void UnHookAll(); +// pch.h: 这是预编译标头文件。 +// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 +// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 +// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 +// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 +#pragma once +#ifndef PCH_H +#define PCH_H + +// 添加要在此处预编译的标头 +#include "framework.h" +#include +#include +#include "SendImage.h" +#include "SendText.h" +#include "SendFile.h" +#include "SendArticle.h" +#include "FriendList.h" +#include "UserInfo.h" +#include "SelfInfo.h" +#include "SendCard.h" +#endif //PCH_H + +using namespace std; +#define DLLEXPORT extern "C" __declspec(dllexport) + +struct WxBaseStruct +{ + wchar_t* buffer; + DWORD length; + DWORD maxLength; + DWORD fill1; + DWORD fill2; + + WxBaseStruct(wchar_t* pStr) { + buffer = pStr; + length = wcslen(pStr); + maxLength = wcslen(pStr) * 2; + fill1 = 0x0; + fill2 = 0x0; + } +}; + +struct WxString +{ + wchar_t* buffer; + DWORD length; + DWORD maxLength; + DWORD fill1 = 0; + DWORD fill2 = 0; +}; + + +BOOL CreateConsole(void); +DWORD GetWeChatWinBase(); +void Wchar_tToString(std::string& szDst, wchar_t* wchar); +void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode); +void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode); +DLLEXPORT void UnHookAll(); diff --git a/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj b/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj deleted file mode 100644 index a45391466f89b5bdac5f6700615c7081dd5550cc..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj +++ /dev/null @@ -1,190 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {7ede81c4-63bc-4c4f-8424-210d91034fde} - MyWeChatRobot - 10.0 - DWeChatRobot_3.5.0.46 - - - - DynamicLibrary - true - v142 - Unicode - - - DynamicLibrary - false - v142 - true - Unicode - - - DynamicLibrary - true - v142 - Unicode - - - DynamicLibrary - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - DWeChatRobot - - - false - DWeChatRobot - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - WIN32;NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - - - - Level3 - true - _DEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - NDEBUG;MYWECHATROBOT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - - \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj.filters b/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj.filters deleted file mode 100644 index 6882baa530e750d9735b8b9b5e5514c4a4c9cd92..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj.filters +++ /dev/null @@ -1,123 +0,0 @@ - - - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {b1463ca2-6055-4c67-8c42-6319a6171dd2} - - - {b22823ee-f629-4e0a-8358-da017f0e5c3a} - - - {912e6334-b078-4ba6-813c-66d0de3ee123} - - - {069b8c09-e473-4bba-a49e-571f35f2efef} - - - {25f77de8-b12c-4f2b-a3ac-0260b6a16897} - - - {166b9e01-bc1c-4366-abcf-c14ec3fbbfb1} - - - {8ad1ff87-550b-4942-8ebd-afbe1cfaddc9} - - - {24dc11dd-cb6a-4c63-bf21-35823cd389ab} - - - {564cc9ef-a939-4bfd-a420-a08b3072d198} - - - {722c02ee-dda5-4a6a-9443-f1ed3c112709} - - - {edd6e39f-235b-4db5-aea1-ec2c8d0072c5} - - - {fc747a68-6314-4f23-92de-a1e55275a01e} - - - - - 通用标头 - - - 通用标头 - - - 发送消息\发送图片 - - - 发送消息\发送文本 - - - 发送消息\发送文件 - - - 好友相关\好友列表 - - - 自动功能\聊天表情 - - - 好友相关\好友信息 - - - 个人信息 - - - 发送消息\发送文章 - - - 发送消息\发送名片 - - - - - 通用函数 - - - 通用函数 - - - 发送消息\发送图片 - - - 发送消息\发送文本 - - - 发送消息\发送文件 - - - 好友相关\好友列表 - - - 自动功能\聊天表情 - - - 好友相关\好友信息 - - - 个人信息 - - - 发送消息\发送文章 - - - 发送消息\发送名片 - - - \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj.user b/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj.user deleted file mode 100644 index 0f14913f3c72094bb7b1e695e153ade04b17d5b0..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/DWeChatRobot_3.5.0.46.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/FriendList.cpp b/DWeChatRobot_3.5.0.46/FriendList.cpp deleted file mode 100644 index 8d680b7ef25e8f2c47a77bb7c54be8ae0ca228c3..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/FriendList.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "pch.h" -#include -using namespace std; -#define LeftTreeOffset 0x21DD240 - - -struct WxFriendStructW { - DWORD wxIdAddr; - DWORD wxNumberAddr; - DWORD wxNickNameAddr; - DWORD wxRemarkAddr; - WxFriendStructW(DWORD wxIdAddr, DWORD wxNumberAddr, DWORD wxNickNameAddr, DWORD wxRemarkAddr) { - this->wxIdAddr = wxIdAddr; - this->wxNumberAddr = wxNumberAddr; - this->wxNickNameAddr = wxNickNameAddr; - this->wxRemarkAddr = wxRemarkAddr; - } -}; - -vector WxFriendList; - -int GetFriendListInit() { - GetFriendList(); -#ifdef _DEBUG - cout << WxFriendList.size() << endl; -#endif - return WxFriendList.size(); -} - -DWORD GetFriendListRemote() { - if (WxFriendList.size() == 0) - return 0; -#ifdef _DEBUG - printf("0x%08X\n", (DWORD)&WxFriendList[0]); - printf("0x%08X\n", (DWORD)&(WxFriendList[0].wxIdAddr)); -#endif - return (DWORD)&WxFriendList[0].wxIdAddr; -} - -void GetFriendListFinish() { - WxFriendList.clear(); - cout << WxFriendList.size() << endl; -} - -void __stdcall GetFriendList() { - - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD LeftTreeAddr = 0; - DWORD RightTreeAddr = 0; - DWORD LeftTreeHead = 0; - DWORD baseAddr = WeChatWinBase + LeftTreeOffset; - __asm { - pushad; - mov eax, dword ptr[baseAddr]; - mov eax, dword ptr[eax]; - mov eax, dword ptr[eax + 0x4C]; - mov ecx, dword ptr[eax]; - mov LeftTreeAddr, ecx; - mov LeftTreeHead, eax; - mov ecx, dword ptr[eax + 0x4]; - mov RightTreeAddr, ecx; - popad; - } - - while (1) { - DWORD wxIdAddr = 0; - DWORD wxNumberAddr = 0; - DWORD wxNickNameAddr = 0; - DWORD wxRemarkAddr = 0; - - __asm { - pushad; - mov eax, dword ptr [LeftTreeAddr]; - mov ecx, eax; - add ecx, 0x30; - mov wxIdAddr, ecx; - mov ecx, eax; - add ecx, 0x44; - mov wxNumberAddr, ecx; - mov ecx, eax; - add ecx, 0x8C; - mov wxNickNameAddr, ecx; - mov ecx, eax; - add ecx, 0x78; - mov wxRemarkAddr, ecx; - mov ecx, dword ptr [eax]; - mov LeftTreeAddr, ecx; - popad; - } - WxFriendStructW p(wxIdAddr, wxNumberAddr, wxNickNameAddr, wxRemarkAddr); - WxFriendList.push_back(p); - if (LeftTreeAddr == LeftTreeHead) { - break; - } - } -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SaveGif.cpp b/DWeChatRobot_3.5.0.46/SaveGif.cpp deleted file mode 100644 index 61c8a36b3e39012bbe2ce30919da586ae85397eb..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SaveGif.cpp +++ /dev/null @@ -1,145 +0,0 @@ -#include "pch.h" -#include -#include - -/* -Executable modules, Ŀ 126 - ַ=78BD0000 - С=02624000 (39993344.) - =7A0FC59D WeChatWi.<ģڵ> - =WeChatWi - ļ汾=3.5.0.46 - ·=D:\Tencent\WeChat\[3.5.0.46]\WeChatWin.dll - -78FC8980 E8 FB730000 call 78FCFD80 ; λãeax-3CСeax-48 -*/ - -#define SaveGifHookOffset (0x5D9A2E83 - 0x5D5B0000) -#define NextCallOffset (0x5D9A8910 - 0x5D5B0000) -CHAR originalRecieveCode[5] = { 0 }; - -BYTE bjmpcode[5] = { 0 }; -DWORD SaveGifHookAddress = GetWeChatWinBase() + SaveGifHookOffset; -DWORD dwReternAddress = GetWeChatWinBase() + SaveGifHookOffset + 5; -DWORD NextCallAddr = GetWeChatWinBase() + NextCallOffset; -bool SaveGifHooked = false; - -void __declspec(naked) ExtractExpression() -{ - __asm - { - pushad; - push eax; - call OutputExpression; - popad; - call NextCallAddr; - //طصַ - jmp dwReternAddress; - } -} - -void HookExtractExpression() -{ - HookAnyAddress(SaveGifHookAddress, ExtractExpression,originalRecieveCode); - SaveGifHooked = true; -} - -void CreateDir(const char* dir) -{ - int m = 0, n; - string str1, str2; - - str1 = dir; - str2 = str1.substr(0, 2); - str1 = str1.substr(3, str1.size()); - - while (m >= 0) - { - m = str1.find('\\'); - str2 += '\\' + str1.substr(0, m); - n = _access(str2.c_str(), 0); //жϸĿ¼Ƿ - if (n == -1) - { - int status = _mkdir(str2.c_str()); //Ŀ¼ - } - str1 = str1.substr(m + 1, str1.size()); - } -} - -void CreateFileWithCurrentTime(char* filedir, char* filepostfix, DWORD filedata, DWORD filedatalen) -{ - //ȡǰʱΪļ - time_t rawtime; - struct tm* ptminfo = new struct tm; - time(&rawtime); - localtime_s(ptminfo, &rawtime); - char currenttime[30] = { 0 }; - sprintf_s(currenttime, "%02d%02d%02d%02d%02d%02d", ptminfo->tm_year + 1900, - ptminfo->tm_mon + 1, ptminfo->tm_mday, ptminfo->tm_hour, ptminfo->tm_min, ptminfo->tm_sec); - - //ƴ· - char filepath[MAX_PATH] = { 0 }; - sprintf_s(filepath, "%s%s%s", filedir, currenttime, filepostfix); - //ļ - HANDLE hFile = CreateFileA(filepath, GENERIC_ALL, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) - { - MessageBoxA(NULL, "ļʧ", "", 0); - return; - } - //дļ - DWORD dwWrite = 0; - WriteFile(hFile, (LPCVOID)filedata, filedatalen, &dwWrite, 0); - //رվ - CloseHandle(hFile); -} - -void __stdcall OutputExpression(DWORD dwExpressionAddr) -{ - //ȡͼƬ - DWORD dwImageLen = *((DWORD*)(dwExpressionAddr + 0x4)); - //ȡͼƬ - DWORD dwImage = *((DWORD*)(dwExpressionAddr)); - if (dwImageLen == 0) { - return; - } - unsigned char magic_head[4] = { 0 }; - char postfix[5] = { 0 }; - memcpy(magic_head, (void*)dwImage, 3); - //MAGICͷжϺ׺ - if (magic_head[0] == 137 && magic_head[1] == 80 && magic_head[2] == 78) - { - strcpy_s(postfix, 5, ".png"); - } - else if (magic_head[0] == 71 && magic_head[1] == 73 && magic_head[2] == 70) - { - strcpy_s(postfix, 5, ".gif"); - } - else if (magic_head[0] == 255 && magic_head[1] == 216 && magic_head[2] == 255) - { - strcpy_s(postfix, 5, ".jpg"); - } - //ȡʱļĿ¼ - char temppath[MAX_PATH] = { 0 }; - GetTempPathA(MAX_PATH, temppath); - char imagedir[25] = { "WeChatRecordExpressions" }; - - //ƴӴ΢űĿ¼ - char WeChatExpressionsPath[MAX_PATH] = { 0 }; - sprintf_s(WeChatExpressionsPath, "%s%s\\", temppath, imagedir); - //Ŀ¼ͼƬ - CreateDir(WeChatExpressionsPath); - - //ͼƬ - CreateFileWithCurrentTime(WeChatExpressionsPath, postfix, dwImage, dwImageLen); -} - -void UnHookExtractExpression() -{ - // ظǵָ - if (!SaveGifHooked) - return; - UnHookAnyAddress(SaveGifHookAddress, originalRecieveCode); - PostMessage(HWND_BROADCAST, NULL, 0, 0); - SaveGifHooked = false; -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SaveGif.h b/DWeChatRobot_3.5.0.46/SaveGif.h deleted file mode 100644 index 76e6ad89956617eafa99f0bbc9231d3d672a0550..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SaveGif.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include - -extern "C" __declspec(dllexport) void HookExtractExpression(); -void __stdcall OutputExpression(DWORD dwExpressionAddr); -void UnHookExtractExpression(); \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SelfInfo.cpp b/DWeChatRobot_3.5.0.46/SelfInfo.cpp deleted file mode 100644 index 1b9fe224c3a30cb0524b69cd2de92409c0bd445e..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SelfInfo.cpp +++ /dev/null @@ -1,98 +0,0 @@ -#include "pch.h" -#include - -wstring selfinfo = L""; - -struct SelfInfoStruct { - DWORD message; - DWORD length; -} ret; - -// дBUG -DWORD GetSelfInfoRemote() { - DWORD WeChatWinBase = GetWeChatWinBase(); - /*vector SelfInfoAddr = { - *(DWORD*)(WeChatWinBase + 0x21DC9C4), - WeChatWinBase + 0x21DCBB8, - *(DWORD*)(WeChatWinBase + 0x21DCA3C), - *(DWORD*)(WeChatWinBase + 0x21DCB74), - *(DWORD*)(WeChatWinBase + 0x21DCD34), - *(DWORD*)(WeChatWinBase + 0x21DCD1C), - WeChatWinBase + 0x21DCC30, - WeChatWinBase + 0x21DCB44, - WeChatWinBase + 0x21DCB5C, - WeChatWinBase + 0x21DCA70 - };*/ - vector SelfInfoAddr = { - *(DWORD*)(WeChatWinBase + 0x21DC9C4), - WeChatWinBase + 0x21DCBB8, - WeChatWinBase + 0x21DCA3C, - *(DWORD*)(WeChatWinBase + 0x21DCB74), - *(DWORD*)(WeChatWinBase + 0x21DCD34), - *(DWORD*)(WeChatWinBase + 0x21DCD1C), - WeChatWinBase + 0x21DCC30, - WeChatWinBase + 0x21DCB44, - WeChatWinBase + 0x21DCB5C, - WeChatWinBase + 0x21DCA70 - }; - - vector SelfInfoKey = { - L"\"wxId\"", - L"\"wxNumber\"", - L"\"wxNickName\"", - L"\"wxSignature\"", - L"\"wxBigAvatar\"", - L"\"wxSmallAvatar\"", - L"\"wxNation\"", - L"\"wxProvince\"", - L"\"wxCity\"", - L"\"PhoneNumber\"" - }; -#ifdef _DEBUG - wcout.imbue(locale("chs")); -#endif - selfinfo = selfinfo + L"{"; - for (unsigned int i = 0; i < SelfInfoAddr.size(); i++) { - selfinfo = selfinfo + SelfInfoKey[i] + L":"; - selfinfo = selfinfo + L"\""; - char* temp = NULL; - if (!SelfInfoKey[i].compare(L"\"wxNickName\"")) { - if (*(DWORD*)(SelfInfoAddr[i] + 0x14) == 0xF) { - temp = (*((DWORD*)SelfInfoAddr[i]) != 0) ? (char*)SelfInfoAddr[i] : (char*)"null"; - } - else { - temp = (*((DWORD*)SelfInfoAddr[i]) != 0) ? (char*)(*(DWORD*)SelfInfoAddr[i]) : (char*)"null"; - } - } - else { - temp = (char*)SelfInfoAddr[i]; - if (strlen(temp) == 0) - temp = (char*)"null"; - } - wchar_t* wtemp = new wchar_t[strlen(temp) + 1]; - ZeroMemory(wtemp, (strlen(temp) + 1) * 2); - MultiByteToWideChar(CP_UTF8, 0, temp, -1, wtemp, strlen(temp) + 1); - selfinfo = selfinfo + wtemp; - selfinfo = selfinfo + L"\""; - if(i!= SelfInfoAddr.size() - 1) - selfinfo = selfinfo + L","; - delete[] wtemp; - wtemp = NULL; - } - selfinfo = selfinfo + L"}"; - ret.message = (DWORD)selfinfo.c_str(); - ret.length = selfinfo.length(); -#ifdef _DEBUG - wcout << selfinfo << endl; - DeleteSelfInfoCacheRemote(); -#endif - return (DWORD)&ret; -} - -VOID DeleteSelfInfoCacheRemote() { - if (ret.length) { - ZeroMemory((wchar_t*)ret.message, ret.length*2 + 2); - ret.length = 0; - selfinfo = L""; - } -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendArticle.cpp b/DWeChatRobot_3.5.0.46/SendArticle.cpp deleted file mode 100644 index 3091e07ad6011d62d07f96ab053a8b7999cabb73..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SendArticle.cpp +++ /dev/null @@ -1,100 +0,0 @@ -#include "pch.h" - -#define SendArticleCall1Offset 0x5BC68E80 - 0x5BBE0000 -#define SendArticleCall2Offset 0x03297840 - 0x02F20000 -#define SendArticleCall3Offset 0x5BC9C570 - 0x5BBE0000 -#define SendArticleCall4Offset 0x5BF57A10 - 0x5BBE0000 -#define SendArticleParamOffset 0x5DDCCD1C - 0x5BBE0000 - -#define SendArticleClearCacheCall1Offset 0x5C1F40D0 - 0x5BBE0000 -#define SendArticleClearCacheCall2Offset 0x59637BA0 - 0x595B0000 - -struct SendArticleStruct { - DWORD wxid; - DWORD title; - DWORD abstract; - DWORD url; -}; - -VOID SendArticleRemote(LPVOID lparameter) { - SendArticleStruct* sas = (SendArticleStruct*)lparameter; - wchar_t* wxid = (wchar_t*)sas->wxid; - wchar_t* title = (wchar_t*)sas->title; - wchar_t* abstract = (wchar_t*)sas->abstract; - wchar_t* url = (wchar_t*)sas->url; - SendArticle(wxid,title,abstract,url); -} - -BOOL __stdcall SendArticle(wchar_t* wxid,wchar_t* title, wchar_t* abstract, wchar_t* url) { - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD SendArticleCall1 = WeChatWinBase + SendArticleCall1Offset; - DWORD SendArticleCall2 = WeChatWinBase + SendArticleCall2Offset; - DWORD SendArticleCall3 = WeChatWinBase + SendArticleCall3Offset; - DWORD SendArticleCall4 = WeChatWinBase + SendArticleCall4Offset; - - DWORD SendArticleParam = WeChatWinBase + SendArticleParamOffset; - - DWORD SendArticleClearCacheCall1 = WeChatWinBase + SendArticleClearCacheCall1Offset; - DWORD SendArticleClearCacheCall2 = WeChatWinBase + SendArticleClearCacheCall2Offset; - // Լwxid - char* sselfwxid = (char*)(*(DWORD*)(WeChatWinBase + 0x21DC9C4)); - wchar_t* wselfwxid = new wchar_t[strlen(sselfwxid) + 1]; - MultiByteToWideChar(CP_ACP, MB_COMPOSITE, sselfwxid, -1, wselfwxid, strlen(sselfwxid) + 1); - // xml - wchar_t* xmlbuffer = new wchar_t[0x2000]; - ZeroMemory(xmlbuffer, 0x2000 * 2); - swprintf_s(xmlbuffer,0x2000, (wchar_t*)L"\n %ws\n 0\n \n \n %ws\n %ws\n view\n 5\n 0\n \n %ws\n \n \n \n \n \n \n \n \n \n \n \n \n \n 0\n \n \n \n \n \n \n \n \n \n 0\n \n \n \n \n 1\n Window wechat\n \n", - wselfwxid,title,abstract,url); - - DWORD sendtype = 0x5; - WxBaseStruct pSender(wselfwxid); - char nullbuffer[0x1C] = { 0 }; - WxBaseStruct pXml(xmlbuffer); - WxBaseStruct pReceiver(wxid); - WxString imgbuffer = { 0 }; - WxString nullStruct = { 0 }; - char buffer[0xF70] = { 0 }; - DWORD isSuccess = 0x0; - __asm { - pushad; - pushfd; - lea ecx, buffer; - call SendArticleCall1; - mov eax, [sendtype]; - push eax; - lea eax, nullbuffer; - lea edx, pSender; - push eax; - lea eax, imgbuffer; - push eax; - lea eax, pXml; - push eax; - lea edi, pReceiver; - push edi; - lea ecx, buffer; - call SendArticleCall2; - add esp, 0x14; - lea eax, nullStruct; - push eax; - lea ecx, buffer; - call SendArticleCall3; - mov dl, 0x0; - lea ecx, buffer; - push SendArticleParam; - push SendArticleParam; - call SendArticleCall4; - mov isSuccess, eax; - add esp, 0x8; - lea ecx, buffer; - call SendArticleClearCacheCall1; - lea ecx, buffer; - call SendArticleClearCacheCall2; - popfd; - popad; - } - delete[] xmlbuffer; - xmlbuffer = NULL; - delete[] wselfwxid; - wselfwxid = NULL; - return (isSuccess == 0x1); -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendCard.cpp b/DWeChatRobot_3.5.0.46/SendCard.cpp deleted file mode 100644 index abca2cb68404b35fce204de638f6a5cd2bdc35d5..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SendCard.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "pch.h" - -#define SendCardCallOffset 0x5BDCBC80 - 0x05B930000 -#define DeleteCardCacheCallOffset 0x5B9B7BA0 - 0x05B930000 - -struct SendCardStruct { - DWORD receiver; - DWORD sharedwxid; - DWORD nickname; -}; - -VOID SendCardRemote(LPVOID lparameter) { - SendCardStruct* scs = (SendCardStruct*)lparameter; - wchar_t* receiver = (WCHAR*)scs->receiver; - wchar_t* sharedwxid = (WCHAR*)scs->sharedwxid; - wchar_t* nickname = (WCHAR*)scs->nickname; - SendCard(receiver,sharedwxid,nickname); -} - -BOOL __stdcall SendCard(wchar_t* receiver, wchar_t* sharedwxid, wchar_t* nickname) { - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD SendCardCall = WeChatWinBase + SendCardCallOffset; - DWORD DeleteCardCacheCall = WeChatWinBase + DeleteCardCacheCallOffset; - wchar_t* xml = new wchar_t[0x2000]; - ZeroMemory(xml, 0x2000 * 2); - swprintf_s(xml, 0x2000,L"", - sharedwxid, nickname, sharedwxid); - WxBaseStruct pReceiver(receiver); - WxBaseStruct pXml(xml); - char buffer[0x2C0] = { 0 }; - DWORD isSuccess = 0x1; - - __asm { - pushad; - push 0x2A; - lea eax, pXml; - lea edx, pReceiver; - push 0x0; - push eax; - lea ecx, buffer; - call SendCardCall; - add esp, 0xC; - lea ecx, buffer; - call DeleteCardCacheCall; - mov isSuccess, eax; - popad; - } - delete[] xml; - xml = NULL; - return isSuccess; -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendFile.cpp b/DWeChatRobot_3.5.0.46/SendFile.cpp deleted file mode 100644 index 1b2eb476db7e5b008b0cc6df118e26bbefe4bfff..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SendFile.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include "pch.h" - -#define WxSendFileCall1Offset (0x0FD68420 - 0x0F690000) -#define WxSendFileCall2Offset (0x11064BE3 - 0x0F690000) -#define WxSendFileCall3Offset (0x110633DA - 0x0F690000) -#define WxSendFileCall4Offset (0x0FA07B20 - 0x0F690000) -#define WxSendFileParamsOffset (0x5294CFF0 - 0x50770000) - -struct FileParamStruct { - DWORD wxid; - DWORD filepath; -}; - -struct WxFileStruct { - int type = 3; - wchar_t* buffer; - DWORD length; - DWORD maxLength; - char fill[0x34] = { 0 }; - - WxFileStruct(wchar_t* pStr) { - buffer = pStr; - length = wcslen(pStr); - maxLength = wcslen(pStr) * 2; - } -}; - -void SendFileRemote(LPVOID lpParamStruct) { - FileParamStruct* params = (FileParamStruct*)lpParamStruct; - SendFile((WCHAR*)params->wxid, (WCHAR*)params->filepath); -} - -void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath) { - WxBaseStruct pReceiver(receiver); - WxBaseStruct pFilePath(FilePath); - WxFileStruct esi_(FilePath); - - DWORD WeChatWinBase = GetWeChatWinBase(); - - DWORD WxSendFileCall1 = WeChatWinBase + WxSendFileCall1Offset; - DWORD WxSendFileCall2 = WeChatWinBase + WxSendFileCall2Offset; - DWORD WxSendFileCall3 = WeChatWinBase + WxSendFileCall3Offset; - DWORD WxSendFileCall4 = WeChatWinBase + WxSendFileCall4Offset; - DWORD WxSendFileParams = WeChatWinBase + WxSendFileParamsOffset; - - char buffer[0x3A8] = { 0 }; - - DWORD edi_ = pReceiver.length; - DWORD ptrReceiver = (DWORD)pReceiver.buffer; - - DWORD tempecx = 0; - - __asm { - pushad; - pushfd; - lea esi, esi_; - push 0; - push 0; - push 0; - push 0; - push 0; - push 0x00700000; - sub esp, 0x14; - mov edi, esp; - mov dword ptr ds : [edi] , 0x0; - mov dword ptr ds : [edi + 0x4] , 0x0; - mov dword ptr ds : [edi + 0x8] , 0x0; - mov dword ptr ds : [edi + 0xC] , 0x0; - mov dword ptr ds : [edi + 0x10] , 0x0; - - sub esp, 0x14; - lea eax, dword ptr ds : [esi + 0x4] ; - mov ecx, esp; - push eax; - call WxSendFileCall1; - - sub esp, 0x14; - mov ecx, esp; - mov dword ptr ds : [ecx] , 0x0; - mov dword ptr ds : [ecx + 0x4] , 0x0; - mov dword ptr ds : [ecx + 0x8] , 0x0; - mov dword ptr ds : [ecx + 0xC] , 0x0; - mov dword ptr ds : [ecx + 0x10] , 0x0; - - lea edx, pReceiver; - mov eax, [edx]; - - mov edi, edi_; - lea eax, dword ptr ds : [edi * 2 + 0x2] ; - mov tempecx, ecx; - push eax; - push dword ptr ds : [ecx] ; - call WxSendFileCall2; - mov ecx, [tempecx]; - mov edx, eax; - add esp, 0x8; - - mov eax, dword ptr ds : [ecx + 0x4] ; - mov dword ptr ds : [ecx] , edx; - mov dword ptr ds : [ecx + 0x8] , edi; - mov tempecx, ecx; - push edi; - push ptrReceiver; - push dword ptr ds : [ecx] ; - call WxSendFileCall3; - mov ecx, [tempecx]; - add esp, 0xC; - - mov edx, 0x0; - mov eax, dword ptr ds : [ecx] ; - mov word ptr ds : [eax + edi * 2] , 0x0; - mov dword ptr ds : [ecx + 0x4] , edi; - mov ecx, WxSendFileParams; - lea eax, buffer; - push eax; - call WxSendFileCall4; - - popfd; - popad; - } -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendFile.h b/DWeChatRobot_3.5.0.46/SendFile.h deleted file mode 100644 index c0b081648f7efb1b6a99253f3045dc966f86b17f..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SendFile.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include - -void __stdcall SendFile(wchar_t* receiver, wchar_t* FilePath); -extern "C" __declspec(dllexport) void SendFileRemote(LPVOID lpParamStruct); \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendImage.cpp b/DWeChatRobot_3.5.0.46/SendImage.cpp deleted file mode 100644 index 8eaf0aa1935b941247554d16c93b5cd2aef07021..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SendImage.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "pch.h" - -/* -Executable modules, Ŀ 128 - ַ=02E50000 - С=02624000 (39993344.) - =0437C59D WeChatWi.<ģڵ> - =WeChatWi - ļ汾=3.5.0.46 - ·=D:\Tencent\WeChat\[3.5.0.46]\WeChatWin.dll - -02FB4485 E8 D696F2FF call 02EDDB60 -02FB448A 83EC 14 sub esp, 14 -02FB448D 8945 B0 mov dword ptr [ebp-50], eax -02FB4490 8D46 18 lea eax, dword ptr [esi+18] -02FB4493 8BCC mov ecx, esp -02FB4495 8D7E 04 lea edi, dword ptr [esi+4] ; ͼƬ· -02FB4498 50 push eax -02FB4499 E8 823F5700 call 03528420 -02FB449E 8B4D B0 mov ecx, dword ptr [ebp-50] -02FB44A1 8D85 7CFFFFFF lea eax, dword ptr [ebp-84] -02FB44A7 57 push edi ; ͼƬ· -02FB44A8 50 push eax ; wxid -02FB44A9 8D85 58FCFFFF lea eax, dword ptr [ebp-3A8] -02FB44AF 50 push eax ; xml -02FB44B0 E8 DB713300 call 032EB690 ; ͼƬCALL -*/ - -#define WxSendImageCall1offset (0x02EDDB60 - 0x02E50000) -#define WxSendImageCall2offset (0x03528420 - 0x02E50000) -#define WxSendImageCall3offset (0x032EB690 - 0x02E50000) - -struct ImageParamStruct { - DWORD wxid; - DWORD imagepath; -}; - -void SendImageRemote(LPVOID lpParamStruct) { - ImageParamStruct* params = (ImageParamStruct*)lpParamStruct; - SendImage((WCHAR*)params->wxid, (WCHAR*)params->imagepath); -} - -void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath) { - DWORD WxSendImageCall1 = GetWeChatWinBase() + WxSendImageCall1offset; - DWORD WxSendImageCall2 = GetWeChatWinBase() + WxSendImageCall2offset; - DWORD WxSendImageCall3 = GetWeChatWinBase() + WxSendImageCall3offset; - char nullbuffer[0x50] = { 0 }; - char buffer[0x3A8] = { 0 }; - WxBaseStruct pReceiver(receiver); - WxBaseStruct pImagePath(ImagePath); - - __asm { - pushad; - call WxSendImageCall1; - sub esp, 0x14; - mov dword ptr[ebp - 0x50], eax; - mov ecx, esp; - lea edi, pImagePath; - push eax; - call WxSendImageCall2; - mov ecx, dword ptr[ebp - 0x50]; - lea eax, pReceiver; - push edi; - push eax; - lea eax, buffer; - push eax; - call WxSendImageCall3; - popad; - } -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendImage.h b/DWeChatRobot_3.5.0.46/SendImage.h deleted file mode 100644 index 57cdd2e678abdadc4a3f15e73d82464f6aa0735a..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SendImage.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include - -void __stdcall SendImage(wchar_t* receiver, wchar_t* ImagePath); -extern "C" __declspec(dllexport) void SendImageRemote(LPVOID lpParamStruct); \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/SendText.cpp b/DWeChatRobot_3.5.0.46/SendText.cpp deleted file mode 100644 index e36f0095a1e082d367cd6912f76c1ff526bf45d7..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/SendText.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include "pch.h" - -/* -WeChatWin.dll: 0x78670000 - -787D42EE 8D46 38 lea eax, dword ptr [esi+38] ; ȡatṹ -787D42F1 6A 01 push 1 ; 0x1 -787D42F3 50 push eax ; ȺϢatѣatϢΪ0 -787D42F4 57 push edi ; Ϣ,[edi] -787D42F5 8D95 7CFFFFFF lea edx, dword ptr [ebp-84] ; ,[edx] -787D42FB 8D8D 58FCFFFF lea ecx, dword ptr [ebp-3A8] ; ˵౾ -787D4301 E8 7A793300 call 78B0BC80 ; ϢCALL -787D4306 83C4 0C add esp, 0C ; ƽջ -*/ - -#define SendTextCallOffset 0x49BC80; - -struct SendTextStruct -{ - DWORD wxid; - DWORD wxmsg; -}; - -void SendTextRemote(LPVOID lpParameter) { - SendTextStruct* rp = (SendTextStruct*)lpParameter; - wchar_t* wsWxId = (WCHAR*)rp->wxid; - wchar_t* wsTextMsg = (WCHAR*)rp->wxmsg; - SendText(wsWxId, wsTextMsg); -} - -void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg) { - WxBaseStruct wxWxid(wsWxId); - WxBaseStruct wxTextMsg(wsTextMsg); - wchar_t** pWxmsg = &wxTextMsg.buffer; - char buffer[0x3A8] = { 0 }; - - WxString wxNull = { 0 }; - DWORD dllBaseAddress = GetWeChatWinBase(); - DWORD callAddress = dllBaseAddress + SendTextCallOffset; - - __asm { - lea eax, wxNull; - push 0x1; - push eax; - mov edi, pWxmsg; - push edi; - lea edx, wxWxid; - lea ecx, buffer; - call callAddress; - add esp, 0xC; - } -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/UserInfo.cpp b/DWeChatRobot_3.5.0.46/UserInfo.cpp deleted file mode 100644 index 9dc7a7c4bde5383555c932da2fdfa3b2654bd093..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/UserInfo.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include "pch.h" -#include -#include -#include - -#define GetUserInfoCall1Offset 0x5F917490 - 0x5F230000 -#define GetUserInfoCall2Offset 0x5F2BD9A0 - 0x5F230000 -#define GetUserInfoCall3Offset 0x5F619F70 - 0x5F230000 - -#define DeleteCacheCall1Offset 0x56C349A0 - 0x56B80000 -#define DeleteCacheCall2Offset 0x56D983B0 - 0x56B80000 - -struct GetUserInfoStruct { - DWORD message; - DWORD length; -}; - -wstring wUserInfo = L""; -GetUserInfoStruct ret = { 0 }; - -struct GetDetailUserInfoParamStruct { - WxString* pWxString; - DWORD ptr1 = 0; - DWORD ptr2 = 0; - char fill[0x18] = { 0 }; - GetDetailUserInfoParamStruct(WxString* pWxString) { - this->pWxString = pWxString; - ptr1 = DWORD(pWxString) + sizeof(WxString); - ptr2 = DWORD(pWxString) + sizeof(WxString); - } -}; - -struct UserInfoBaseParamStruct { - DWORD data; - DWORD endbuffer1; - DWORD endbuffer2; - char fill[0x18] = { 0 }; -}; - - -VOID WxUserInfo(DWORD address) { - vector InfoType{ - address + 0x10, - address + 0x24, - address + 0x38, - address + 0x6C, - address + 0xFC, - address + 0x110, - address + 0x19C, - address + 0x1B0, - address + 0x1C4, - address + 0x1D8, - address + 0x27C - }; - vector InfoTypeName{ - (WCHAR*)L"\"wxId\"", - (WCHAR*)L"\"wxNumber\"", - (WCHAR*)L"\"wxV3\"", - (WCHAR*)L"\"wxNickName\"", - (WCHAR*)L"\"wxBigAvatar\"", - (WCHAR*)L"\"wxSmallAvatar\"", - (WCHAR*)L"\"wxSignature\"", - (WCHAR*)L"\"wxNation\"", - (WCHAR*)L"\"wxProvince\"", - (WCHAR*)L"\"wxCity\"", - (WCHAR*)L"\"wxBackground\"", - }; - wUserInfo += L"{"; - for (unsigned int i = 0; i < InfoType.size(); i++) { - wchar_t* wstemp = ((*((DWORD*)InfoType[i])) != 0) ? (WCHAR*)(*((LPVOID*)InfoType[i])) : (WCHAR*)L"null"; - wUserInfo = wUserInfo + InfoTypeName[i] + L":\"" + wstemp + L"\""; - if (i != InfoType.size() - 1) { - wUserInfo += L","; - } - } - wUserInfo += L"}"; -#ifdef _DEBUG - wcout.imbue(locale("chs")); - wcout << wUserInfo.c_str() << endl; -#endif -} - - -DWORD GetWxUserInfoRemote(LPVOID lparamter) { - wchar_t* userwxid = (wchar_t*)lparamter; - DWORD address = 0; - - if (!GetUserInfoByWxId(userwxid, address)) { - return 0; - } - ret.message = (DWORD)wUserInfo.c_str(); - ret.length = (DWORD)wUserInfo.length(); - return (DWORD)&ret; -} - -VOID DeleteUserInfoCacheRemote() { - if (ret.length) { - ZeroMemory((wchar_t*)ret.message, ret.length * 2 + 2); - ret.length = 0; - wUserInfo = L""; - } -} - -BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid,DWORD &address) { - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD GetUserDetailInfoCall1 = WeChatWinBase + GetUserInfoCall1Offset; - DWORD GetUserDetailInfoCall2 = WeChatWinBase + GetUserInfoCall2Offset; - DWORD GetUserDetailInfoCall3 = WeChatWinBase + GetUserInfoCall3Offset; - - DWORD DeleteCacheCall1 = WeChatWinBase + DeleteCacheCall1Offset; - DWORD DeleteCacheCall2 = WeChatWinBase + DeleteCacheCall2Offset; - WxString* pWxid = new WxString; - pWxid->buffer = wxid; - pWxid->length = wcslen(wxid); - pWxid->maxLength = wcslen(wxid) * 2; - - UserInfoBaseParamStruct temp = { 0 }; - UserInfoBaseParamStruct userinfo = { 0 }; - GetDetailUserInfoParamStruct pUser(pWxid); - DWORD isSuccess = 0; - - __asm { - pushad; - pushfd; - // mov eax, 0x7; - lea ecx, pUser; - lea edx, temp; - call GetUserDetailInfoCall1; - call GetUserDetailInfoCall2; - lea ecx, userinfo; - push ecx; - lea ecx, temp; - push ecx; - mov ecx, eax; - call GetUserDetailInfoCall3; - mov isSuccess, eax; - popfd; - popad; - } - address = userinfo.data; - if(isSuccess != 0) - WxUserInfo(address); - // ͷڴ - __asm { - pushad; - pushfd; - lea ecx, temp; - call DeleteCacheCall1; - lea ecx, userinfo; - call DeleteCacheCall2; - popfd; - popad; - } - delete pWxid; - pWxid = NULL; - return (isSuccess != 0); -} - -// һѯϢĵط -BOOL __stdcall GetWxUserInfoByWxid2(wchar_t* wxid, DWORD& address) { - DWORD WeChatWinBase = GetWeChatWinBase(); - DWORD WxUserDataCall1 = WeChatWinBase + 0x645BD9A0 - 0x64530000; - DWORD WxUserDataCall2 = WeChatWinBase + 0x64C08420 - 0x64530000; - DWORD WxUserDataCall3 = WeChatWinBase + 0x64914260 - 0x64530000; - char buffer[0xF90] = { 0 }; - WxBaseStruct pWxid(wxid); - DWORD r_ebx = 0; - DWORD isSuccess = 0; - __asm - { - pushad; - call WxUserDataCall1; - lea ebx, buffer; - mov esi, eax; - push ebx; - sub esp, 0x14; - lea eax, pWxid; - mov ecx, esp; - push eax; - call WxUserDataCall2; - mov ecx, esi; - call WxUserDataCall3; - mov r_ebx, ebx; - mov isSuccess, eax; - popad; - } - address = r_ebx; - return isSuccess; -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/UserInfo.h b/DWeChatRobot_3.5.0.46/UserInfo.h deleted file mode 100644 index 760517fc5c34818d5409e4188eccba9c96303d57..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/UserInfo.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include -BOOL __stdcall GetWxUserInfoByWxid2(wchar_t* wxid, DWORD& address); -BOOL __stdcall GetUserInfoByWxId(wchar_t* wxid, DWORD& address); -extern "C" __declspec(dllexport) DWORD GetWxUserInfoRemote(LPVOID lparamter); -extern "C" __declspec(dllexport) VOID DeleteUserInfoCacheRemote(); \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/dllmain.cpp b/DWeChatRobot_3.5.0.46/dllmain.cpp deleted file mode 100644 index bbf1e4b02f23dbf7a5ed9b510cec1bee5d4cbe01..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/dllmain.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// dllmain.cpp : 定义 DLL 应用程序的入口点。 -#include "pch.h" - -#ifdef _DEBUG - int detach_count = 0; -#endif - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - { -#ifdef _DEBUG - CreateConsole(); - DWORD base = (DWORD)GetModuleHandleA("DWeChatRobot.dll"); - - printf("SendImage 0x%08X\n", (DWORD)SendImage); - printf("SendText 0x%08X\n", (DWORD)SendText); - printf("SendFile 0x%08X\n", (DWORD)SendFile); - printf("GetFriendList 0x%08X\n", (DWORD)GetFriendList); - printf("HookExtractExpression 0x%08X\n", (DWORD)HookExtractExpression); - printf("GetUserInfoByWxId 0x%08X\n", (DWORD)GetUserInfoByWxId); - printf("SendArticle 0x%08X\n", (DWORD)SendArticle); - printf("SendCard 0x%08X\n", (DWORD)SendCard); -#endif - break; - } - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: { -#ifdef _DEBUG - detach_count++; - if (detach_count != 1) { - // FreeConsole(); - // UnHookAll(); - } -#endif - break; - } - } - return TRUE; -} - diff --git a/DWeChatRobot_3.5.0.46/framework.h b/DWeChatRobot_3.5.0.46/framework.h deleted file mode 100644 index 3f0fc4ac20254c2a75028938d8faae302f52f73b..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/framework.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 -// Windows 头文件 -#include diff --git a/DWeChatRobot_3.5.0.46/pch.cpp b/DWeChatRobot_3.5.0.46/pch.cpp deleted file mode 100644 index 1d04db67c97e5555b61426e496996b9df6fb929a..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/pch.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// pch.cpp: 与预编译标头对应的源文件 - -#include "pch.h" - -// 当使用预编译的头时,需要使用此源文件,编译才能成功。 -BOOL CreateConsole(void) { - if (AllocConsole()) { - AttachConsole(GetCurrentProcessId()); - FILE* retStream; - freopen_s(&retStream, "CONOUT$", "w", stdout); - if (!retStream) throw std::runtime_error("Stdout redirection failed."); - freopen_s(&retStream, "CONOUT$", "w", stderr); - if (!retStream) throw std::runtime_error("Stderr redirection failed."); - return 0; - } - return 1; -} - -DWORD GetWeChatWinBase() { - return (DWORD)GetModuleHandleA("WeChatWin.dll"); -} - -void Wchar_tToString(std::string& szDst, wchar_t* wchar) -{ - wchar_t* wText = wchar; - DWORD dwNum = WideCharToMultiByte(CP_OEMCP, NULL, wText, -1, NULL, 0, NULL, FALSE);// WideCharToMultiByte的运用 - char* psText; // psText为char*的临时数组,作为赋值给std::string的中间变量 - psText = new char[dwNum]; - WideCharToMultiByte(CP_OEMCP, NULL, wText, -1, psText, dwNum, NULL, FALSE);// WideCharToMultiByte的再次运用 - szDst = psText;// std::string赋值 - delete[]psText;// psText的清除 -} - -void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress,char* originalRecieveCode) -{ - //组装跳转数据 - BYTE jmpCode[5] = { 0 }; - jmpCode[0] = 0xE9; - - //计算偏移 - *(DWORD*)&jmpCode[1] = (DWORD)dwJmpAddress - dwHookAddr - 5; - - // 保存以前的属性用于还原 - DWORD OldProtext = 0; - - // 因为要往代码段写入数据,又因为代码段是不可写的,所以需要修改属性 - VirtualProtect((LPVOID)dwHookAddr, 5, PAGE_EXECUTE_READWRITE, &OldProtext); - ReadProcessMemory(GetCurrentProcess(), (LPVOID)dwHookAddr, originalRecieveCode, 5, 0); - - //写入自己的代码 - memcpy((void*)dwHookAddr, jmpCode, 5); - - // 执行完了操作之后需要进行还原 - VirtualProtect((LPVOID)dwHookAddr, 5, OldProtext, &OldProtext); -} - -void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode) -{ - DWORD OldProtext = 0; - VirtualProtect((LPVOID)dwHookAddr, 5, PAGE_EXECUTE_READWRITE, &OldProtext); - WriteProcessMemory(GetCurrentProcess(), (LPVOID)dwHookAddr, originalRecieveCode, 5, 0); - VirtualProtect((LPVOID)dwHookAddr, 5, OldProtext, &OldProtext); -} - -void UnHookAll() { - UnHookExtractExpression(); -} \ No newline at end of file diff --git a/DWeChatRobot_3.5.0.46/pch.h b/DWeChatRobot_3.5.0.46/pch.h deleted file mode 100644 index 7ad2b5886be9a29187e15fa0b5a9cd8a21af40f6..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.5.0.46/pch.h +++ /dev/null @@ -1,60 +0,0 @@ -// pch.h: 这是预编译标头文件。 -// 下方列出的文件仅编译一次,提高了将来生成的生成性能。 -// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 -// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 -// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 -#pragma once -#ifndef PCH_H -#define PCH_H - -// 添加要在此处预编译的标头 -#include "framework.h" -#include -#include -#include "SendImage.h" -#include "SendText.h" -#include "SendFile.h" -#include "SendArticle.h" -#include "FriendList.h" -#include "SaveGif.h" -#include "UserInfo.h" -#include "SelfInfo.h" -#include "SendCard.h" -#endif //PCH_H - -using namespace std; -#define DLLEXPORT extern "C" __declspec(dllexport) - -struct WxBaseStruct -{ - wchar_t* buffer; - DWORD length; - DWORD maxLength; - DWORD fill1; - DWORD fill2; - - WxBaseStruct(wchar_t* pStr) { - buffer = pStr; - length = wcslen(pStr); - maxLength = wcslen(pStr) * 2; - fill1 = 0x0; - fill2 = 0x0; - } -}; - -struct WxString -{ - wchar_t* buffer; - DWORD length; - DWORD maxLength; - DWORD fill1 = 0; - DWORD fill2 = 0; -}; - - -BOOL CreateConsole(void); -DWORD GetWeChatWinBase(); -void Wchar_tToString(std::string& szDst, wchar_t* wchar); -void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress, char* originalRecieveCode); -void UnHookAnyAddress(DWORD dwHookAddr, char* originalRecieveCode); -DLLEXPORT void UnHookAll(); diff --git a/DWeChatRobot_3.6.0.18/FriendList.h b/DWeChatRobot_3.6.0.18/FriendList.h deleted file mode 100644 index 5ab556de2bb610b131b67d0c5c409fade0a78df3..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.6.0.18/FriendList.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -void __stdcall GetFriendList(); - -extern "C" __declspec(dllexport) DWORD GetFriendListRemote(); -extern "C" __declspec(dllexport) int GetFriendListInit(); -extern "C" __declspec(dllexport) void GetFriendListFinish(); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SelfInfo.h b/DWeChatRobot_3.6.0.18/SelfInfo.h deleted file mode 100644 index 910ba8ebbd484c653e8001e73ab9f3a1b0e03971..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.6.0.18/SelfInfo.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include -#include -using namespace std; -extern "C" __declspec(dllexport) DWORD GetSelfInfoRemote(); -extern "C" __declspec(dllexport) VOID DeleteSelfInfoCacheRemote(); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SendArticle.h b/DWeChatRobot_3.6.0.18/SendArticle.h deleted file mode 100644 index 5ce08585361e42d6c9f57af62256b9ef231fb826..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.6.0.18/SendArticle.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include -extern "C" __declspec(dllexport) VOID SendArticleRemote(LPVOID lparameter); -BOOL __stdcall SendArticle(wchar_t* wxid, wchar_t* title, wchar_t* abstract, wchar_t* url); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SendCard.h b/DWeChatRobot_3.6.0.18/SendCard.h deleted file mode 100644 index 892ab26a44650eeaadd054fccd466f9892ff7323..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.6.0.18/SendCard.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#include -extern "C" __declspec(dllexport) VOID SendCardRemote(LPVOID lparameter); -BOOL __stdcall SendCard(wchar_t* receiver, wchar_t* sharedwxid, wchar_t* nickname); \ No newline at end of file diff --git a/DWeChatRobot_3.6.0.18/SendText.h b/DWeChatRobot_3.6.0.18/SendText.h deleted file mode 100644 index 7a347e476e0f43ab610cb2744a2d323426704e63..0000000000000000000000000000000000000000 --- a/DWeChatRobot_3.6.0.18/SendText.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include - -void __stdcall SendText(wchar_t* wsWxId, wchar_t* wsTextMsg); -extern "C" __declspec(dllexport) void SendTextRemote(LPVOID lpParameter); \ No newline at end of file diff --git a/Release/DWeChatRobot.dll b/Release/DWeChatRobot.dll index 1dc777308972322161b13e49bbb1cf9fe19c3ac3..25f977731e4885a7414499f7bd5f250432a96d6a 100644 Binary files a/Release/DWeChatRobot.dll and b/Release/DWeChatRobot.dll differ