├── .gitattributes ├── .gitignore ├── Add_Friend.cpp ├── Add_public.cpp ├── AggreFriend_Request.cpp ├── Debug ├── Socket_WX_helper.Build.CppClean.log ├── Socket_WX_helper.dll.recipe ├── Socket_WX_helper.exp ├── Socket_WX_helper.ilk ├── Socket_WX_helper.log ├── Socket_WX_helper.pdb ├── Socket_WX_helper.tlog │ ├── CL.command.1.tlog │ ├── CL.read.1.tlog │ ├── CL.write.1.tlog │ ├── Socket_WX_helper.lastbuildstate │ ├── Socket_WX_helper.write.1u.tlog │ ├── link.command.1.tlog │ ├── link.read.1.tlog │ └── link.write.1.tlog ├── Socket_WX_helper.vcxproj.CopyComplete ├── Socket_WX_helper.vcxproj.FileListAbsolute.txt ├── vc142.idb ├── vc142.pdb └── vcpkg.applocal.log ├── FindPattern.cpp ├── FindPattern.h ├── Gei_Info.cpp ├── Group.cpp ├── HTools.cpp ├── HTools.h ├── HUtil.cpp ├── HUtil.h ├── HWeChat.h ├── Hook_msg.cpp ├── Init_Match_Pattern.cpp ├── Init_Match_Pattern.h ├── MemOpt.cpp ├── MemOpt.h ├── ProcessOpt.cpp ├── ProcessOpt.h ├── PubLic.cpp ├── PubLic.h ├── README.md ├── Recv_Money.cpp ├── Release ├── Socket_WX_helper.Build.CppClean.log ├── Socket_WX_helper.dll.recipe ├── Socket_WX_helper.exe.recipe ├── Socket_WX_helper.exp ├── Socket_WX_helper.iobj ├── Socket_WX_helper.ipdb ├── Socket_WX_helper.log ├── Socket_WX_helper.pdb ├── Socket_WX_helper.tlog │ ├── CL.command.1.tlog │ ├── CL.read.1.tlog │ ├── CL.write.1.tlog │ ├── Socket_WX_helper.lastbuildstate │ ├── Socket_WX_helper.write.1u.tlog │ ├── link.command.1.tlog │ ├── link.read.1.tlog │ └── link.write.1.tlog ├── Socket_WX_helper.vcxproj.FileListAbsolute.txt ├── vc142.pdb └── vcpkg.applocal.log ├── Send_msg.cpp ├── Socket_WX_helper.sln ├── Socket_WX_helper.vcxproj ├── Socket_WX_helper.vcxproj.filters ├── Socket_WX_helper.vcxproj.user ├── Static ├── add_public.png ├── recv_msg.png ├── sendxmlcard.png ├── wxid获取详细信息.jpg ├── 发送普通消息.png ├── 收款.png └── 获取好友列表.png ├── ZZHook.cpp ├── ZZHook.h ├── cvtcode.hpp ├── dllmain.cpp ├── framework.h ├── json.hpp ├── pch.cpp ├── pch.h ├── socketMain.cpp ├── socketMain.h └── wxid_Get_Info.cpp /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /Add_Friend.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Add_Friend.cpp -------------------------------------------------------------------------------- /Add_public.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "PubLic.h" 3 | #include "pch.h" 4 | #include 5 | 6 | #include "HWeChat.h" 7 | 8 | #include "pch.h" 9 | 10 | 11 | #include "jsonxx/json.hpp" 12 | 13 | DWORD getWeChatwinADD(); 14 | void Add_Public(std::wstring wx_id) { 15 | 16 | DWORD call_1 = getWeChatwinADD() + 0x1D69F0; 17 | WxString wxid; 18 | 19 | 20 | 21 | //std::wstring dddd = L"gh_650586eed01c"; 22 | wxid.pstr = (wchar_t*)wx_id.c_str(); 23 | wxid.len = wx_id.size(); 24 | wxid.maxLen = wx_id.size() * 2; 25 | 26 | HWND Hwnd = FindWindow(L"WeChatMainWndForPC", 0); 27 | DWORD dwCore = GetWindowLong(Hwnd, GWLP_USERDATA); 28 | dwCore += 0x610; 29 | 30 | char buff[0x500] = { 0 }; 31 | 32 | __asm { 33 | 34 | pushad 35 | 36 | push 0x0 37 | push 0x0 38 | push 0x0 39 | push 0x0 40 | push 0x0 41 | push 0x0 42 | push 0x0 43 | push 0x0 44 | push 0x0 45 | push 0x0 46 | push 0x0 47 | push 0x11 48 | push 0x1 49 | 50 | mov edi, dwCore 51 | 52 | lea ecx, ds: [edi - 0x5E0] 53 | mov eax, dword ptr ds : [ecx] 54 | push eax 55 | 56 | 57 | 58 | 59 | mov ecx, -1 60 | lea eax, ds: [edi + 0x2DC] 61 | and ecx, eax 62 | push ecx 63 | 64 | lea esi, wxid 65 | 66 | 67 | push esi 68 | lea ecx, ds : [edi + 0xD80] 69 | 70 | 71 | call call_1 72 | 73 | popad 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /AggreFriend_Request.cpp: -------------------------------------------------------------------------------- 1 | #include "PubLic.h" 2 | #include "pch.h" 3 | #include 4 | 5 | #include "HWeChat.h" 6 | 7 | #include "pch.h" 8 | 9 | 10 | #include "jsonxx/json.hpp" 11 | 12 | 13 | void AgreeUserRequest(wchar_t* v1, wchar_t* v2) 14 | { 15 | struct v1Info 16 | { 17 | int fill = 0; 18 | wchar_t* v1 = 0; 19 | int v1Len; 20 | int maxV1Len; 21 | char fill2[0x41C] = { 0 }; 22 | DWORD v2 = { 0 }; 23 | }; 24 | 25 | struct v2Info 26 | { 27 | char fill[0x24C] = { 0 }; 28 | DWORD fill3 = 0x25; 29 | char fill4[0x40] = { 0 }; 30 | wchar_t* v2; 31 | int v2Len; 32 | int maxV2Len; 33 | char fill2[0x8] = { 0 }; 34 | }; 35 | 36 | DWORD callAdd1 = getWeChatwinADD() + (0x621BFE60 - 0x61FD0000); 37 | DWORD callAdd2 = getWeChatwinADD() + (0x6202D590 - 0x61FD0000); 38 | DWORD callAdd3 = getWeChatwinADD() + (0x620DFD10 - 0x61FD0000); 39 | DWORD callAdd4 = getWeChatwinADD() + (0x621A6C80 - 0x61FD0000); 40 | DWORD params = getWeChatwinADD() + (0x63A57138 - 0x61FD0000);//0x63A57138 41 | 42 | DWORD* asmP = (DWORD*)params; 43 | 44 | v1Info userInfoV1 = { 0 }; 45 | v2Info userInfoV2 = { 0 }; 46 | userInfoV1.v2 = (DWORD)&userInfoV2.fill; 47 | userInfoV1.v1 = v1; 48 | userInfoV1.v1Len = wcslen(v1); 49 | userInfoV1.maxV1Len = wcslen(v1) * 2; 50 | 51 | userInfoV2.v2 = v2; 52 | userInfoV2.v2Len = wcslen(v2); 53 | userInfoV2.maxV2Len = wcslen(v2) * 2; 54 | 55 | char* asmUser = (char*)&userInfoV1.fill; 56 | char buff[0x14] = { 0 }; 57 | char buff2[0x48] = { 0 }; 58 | char* asmBuff = buff2; 59 | 60 | 61 | char buff_ecx[0x300] = { 0 }; 62 | char buff_edx[0x300] = { 0 }; 63 | __asm 64 | { 65 | pushad 66 | 67 | mov ecx, asmUser; 68 | push 0xE; 69 | sub esp, 0x14; 70 | push esp; 71 | call callAdd1; 72 | mov ecx, asmUser; 73 | lea eax, buff; 74 | push eax; 75 | call callAdd2; 76 | mov esi, eax; 77 | sub esp, 0x8; 78 | mov ecx, asmP; 79 | call callAdd3; 80 | lea ecx, buff_ecx; 81 | lea edx, buff_edx; 82 | push eax; 83 | push edx; 84 | push esi; 85 | call callAdd4; 86 | 87 | popad 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.pch 2 | d:\code\c++\socket_wx_helper\debug\vc142.pdb 3 | d:\code\c++\socket_wx_helper\debug\vc142.idb 4 | d:\code\c++\socket_wx_helper\debug\pch.obj 5 | d:\code\c++\socket_wx_helper\debug\zzhook.obj 6 | d:\code\c++\socket_wx_helper\debug\wxid_get_info.obj 7 | d:\code\c++\socket_wx_helper\debug\socketmain.obj 8 | d:\code\c++\socket_wx_helper\debug\send_msg.obj 9 | d:\code\c++\socket_wx_helper\debug\public.obj 10 | d:\code\c++\socket_wx_helper\debug\processopt.obj 11 | d:\code\c++\socket_wx_helper\debug\memopt.obj 12 | d:\code\c++\socket_wx_helper\debug\init_match_pattern.obj 13 | d:\code\c++\socket_wx_helper\debug\hutil.obj 14 | d:\code\c++\socket_wx_helper\debug\htools.obj 15 | d:\code\c++\socket_wx_helper\debug\hook_msg.obj 16 | d:\code\c++\socket_wx_helper\debug\findpattern.obj 17 | d:\code\c++\socket_wx_helper\debug\dllmain.obj 18 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.ilk 19 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.dll 20 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.pdb 21 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.lib 22 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.exp 23 | d:\code\c++\socket_wx_helper\debug\jsoncpp.dll 24 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.tlog\cl.command.1.tlog 25 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.tlog\cl.read.1.tlog 26 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.tlog\cl.write.1.tlog 27 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.tlog\link.command.1.tlog 28 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.tlog\link.read.1.tlog 29 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.tlog\link.write.1.tlog 30 | d:\code\c++\socket_wx_helper\debug\socket_wx_helper.tlog\socket_wx_helper.write.1u.tlog 31 | -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.dll.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | D:\code\C++\Socket_WX_helper\Debug\Socket_WX_helper.dll 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.exp -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.ilk -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.log: -------------------------------------------------------------------------------- 1 |  pch.cpp 2 | dllmain.cpp 3 | FindPattern.cpp 4 | D:\code\C++\Socket_WX_helper\FindPattern.cpp(199,17): warning C4267: “=”: 从“size_t”转换到“short”,可能丢失数据 5 | Hook_msg.cpp 6 | HTools.cpp 7 | HUtil.cpp 8 | Init_Match_Pattern.cpp 9 | MemOpt.cpp 10 | ProcessOpt.cpp 11 | PubLic.cpp 12 | Send_msg.cpp 13 | socketMain.cpp 14 | D:\code\C++\Socket_WX_helper\socketMain.cpp(115,9): warning C4101: “optVal”: 未引用的局部变量 15 | wxid_Get_Info.cpp 16 | ZZHook.cpp 17 | D:\code\C++\Socket_WX_helper\ZZHook.cpp(60,11): warning C4477: “printf_s”: 格式字符串“%X”需要类型“unsigned int”的参数,但可变参数 1 拥有了类型“BYTE *” 18 | 正在生成代码... 19 | 正在创建库 D:\code\C++\Socket_WX_helper\Debug\Socket_WX_helper.lib 和对象 D:\code\C++\Socket_WX_helper\Debug\Socket_WX_helper.exp 20 | Socket_WX_helper.vcxproj -> D:\code\C++\Socket_WX_helper\Debug\Socket_WX_helper.dll 21 | -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.pdb -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/Socket_WX_helper.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.28.29333:TargetPlatformVersion=10.0.18362.0:VcpkgTriplet=x86-windows: 2 | Debug|Win32|D:\code\C++\Socket_WX_helper\| 3 | -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/Socket_WX_helper.write.1u.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.tlog/Socket_WX_helper.write.1u.tlog -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.vcxproj.CopyComplete: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/Socket_WX_helper.vcxproj.CopyComplete -------------------------------------------------------------------------------- /Debug/Socket_WX_helper.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\code\C++\Socket_WX_helper\Debug\Socket_WX_helper.pdb 2 | D:\code\C++\Socket_WX_helper\Debug\Socket_WX_helper.vcxproj.CopyComplete 3 | D:\code\C++\Socket_WX_helper\Debug\Socket_WX_helper.dll 4 | D:\code\C++\Socket_WX_helper\Debug\jsoncpp.dll 5 | -------------------------------------------------------------------------------- /Debug/vc142.idb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/vc142.idb -------------------------------------------------------------------------------- /Debug/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Debug/vc142.pdb -------------------------------------------------------------------------------- /Debug/vcpkg.applocal.log: -------------------------------------------------------------------------------- 1 |  2 | D:\code\C++\Socket_WX_helper\Debug\jsoncpp.dll 3 | -------------------------------------------------------------------------------- /FindPattern.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/FindPattern.cpp -------------------------------------------------------------------------------- /FindPattern.h: -------------------------------------------------------------------------------- 1 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 2 | // Windows Header Files: 3 | #include 4 | #define SIGSCANDLL_EXPORTS 5 | #ifdef SIGSCANDLL_EXPORTS 6 | #define GeekX_API __declspec(dllexport) 7 | #else 8 | #define GeekX_API __declspec(dllimport) 9 | #endif 10 | 11 | void OutputDebugPrintf(const char* strOutputString, ...); 12 | GeekX_API DWORD _stdcall GeekXFindPattern(const char* szPattern, DWORD* pmodulBase , int offset = 0); 13 | GeekX_API void _stdcall InitializeSigCopyMemory(DWORD ProcessID, const char* szModule); 14 | GeekX_API void _stdcall FinalizeScan(); 15 | -------------------------------------------------------------------------------- /Gei_Info.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Gei_Info.cpp -------------------------------------------------------------------------------- /Group.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Group.cpp -------------------------------------------------------------------------------- /HTools.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "HTools.h" 3 | 4 | using namespace std; 5 | #pragma warning(disable:4996) 6 | #pragma comment(lib, "version.lib") 7 | 8 | string HTools::GetFileVersion(string filePath) { 9 | string version = "0.0.0.0"; 10 | if (FileExist(filePath)) { 11 | VS_FIXEDFILEINFO* fInfo; 12 | unsigned int fSize = sizeof(VS_FIXEDFILEINFO); 13 | int size = GetFileVersionInfoSizeA(filePath.c_str(), NULL); 14 | if (size != 0) { 15 | size = size * 2; 16 | char* buff = new char[size]; 17 | if (GetFileVersionInfoA(filePath.c_str(), 0, size, buff)) { 18 | if (VerQueryValueA(buff, "\\", (void**)&fInfo, &fSize)) { 19 | sprintf(buff, "%d.%d.%d.%d", 20 | HIWORD(fInfo->dwFileVersionMS), 21 | LOWORD(fInfo->dwFileVersionMS), 22 | HIWORD(fInfo->dwFileVersionLS), 23 | LOWORD(fInfo->dwFileVersionLS)); 24 | version = buff; 25 | } 26 | } 27 | delete[] buff; 28 | } 29 | } 30 | return version; 31 | } 32 | 33 | BOOL HTools::FileExist(std::string file) { 34 | struct stat buffer; 35 | return (stat(file.c_str(), &buffer) == 0); 36 | } 37 | 38 | wstring HTools::itow(int i) { 39 | wstring data; 40 | wchar_t t[10]; 41 | wmemset(t, 0, 10); 42 | wsprintf(t, TEXT("%d"), i); 43 | data = t; 44 | return data; 45 | } 46 | 47 | string HTools::w2s(wstring wstr) { 48 | string result; 49 | int len = WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), wstr.size(), NULL, 0, NULL, NULL); 50 | char* buffer = new char[len + 1]; 51 | WideCharToMultiByte(CP_ACP, 0, wstr.c_str(), wstr.size(), buffer, len, NULL, NULL); 52 | buffer[len] = '\0'; 53 | result.append(buffer); 54 | delete[] buffer; 55 | return result; 56 | } 57 | 58 | string HTools::wstring2string(wstring wstr) { 59 | return w2s(wstr); 60 | } 61 | 62 | wstring HTools::s2w(string str) { 63 | wstring result; 64 | int len = MultiByteToWideChar(CP_ACP, 0, str.c_str(), str.size(), NULL, 0); 65 | TCHAR* buffer = new TCHAR[len + 1]; 66 | MultiByteToWideChar(CP_ACP, 0, str.c_str(), str.size(), buffer, len); 67 | buffer[len] = '\0'; 68 | result.append(buffer); 69 | delete[] buffer; 70 | return result; 71 | } 72 | 73 | wstring HTools::string2wstring(string str) { 74 | return s2w(str); 75 | } 76 | 77 | const char* HTools::u2g(string str) { 78 | const char* utf8 = str.c_str(); 79 | int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); 80 | wchar_t* wstr = new wchar_t[len + 1]; 81 | memset(wstr, 0, len + 1); 82 | MultiByteToWideChar(CP_UTF8, 0, utf8, -1, wstr, len); 83 | len = WideCharToMultiByte(CP_ACP, 0, wstr, -1, NULL, 0, NULL, NULL); 84 | char* res = new char[len + 1]; 85 | memset(res, 0, len + 1); 86 | WideCharToMultiByte(CP_ACP, 0, wstr, -1, res, len, NULL, NULL); 87 | if (wstr) delete[] wstr; 88 | return res; 89 | } 90 | 91 | string& HTools::Replace(string& str, const string& old_value, const string& new_value) { 92 | for (string::size_type pos(0); pos != string::npos; pos += new_value.length()) { 93 | if ((pos = str.find(old_value, pos)) != string::npos) { 94 | str.replace(pos, old_value.length(), new_value); 95 | } else { 96 | break; 97 | } 98 | } 99 | return str; 100 | } 101 | 102 | string HTools::Base64_Encode(const char* data, int len) { 103 | const char EncodeTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 104 | string str; 105 | unsigned char tmp[4] = { 0 }; 106 | int llen = 0; 107 | for (int i = 0; i < (int)(len / 3); i++) { 108 | tmp[1] = *data++; 109 | tmp[2] = *data++; 110 | tmp[3] = *data++; 111 | str += EncodeTable[tmp[1] >> 2]; 112 | str += EncodeTable[((tmp[1] << 4) | (tmp[2] >> 4)) & 0x3F]; 113 | str += EncodeTable[((tmp[2] << 2) | (tmp[3] >> 6)) & 0x3F]; 114 | str += EncodeTable[tmp[3] & 0x3F]; 115 | if (llen += 4, llen == 76) { 116 | str += "\r\n"; 117 | llen = 0; 118 | } 119 | } 120 | int mod = len % 3; 121 | if (mod == 1) { 122 | tmp[1] = *data++; 123 | str += EncodeTable[(tmp[1] & 0xFC) >> 2]; 124 | str += EncodeTable[((tmp[1] & 0x03) << 4)]; 125 | str += "=="; 126 | } else if (mod == 2) { 127 | tmp[1] = *data++; 128 | tmp[2] = *data++; 129 | str += EncodeTable[(tmp[1] & 0xFC) >> 2]; 130 | str += EncodeTable[((tmp[1] & 0x03) << 4) | ((tmp[2] & 0xF0) >> 4)]; 131 | str += EncodeTable[((tmp[2] & 0x0F) << 2)]; 132 | str += "="; 133 | } 134 | return str; 135 | } 136 | 137 | string HTools::Base64_Encode(string str) { 138 | return Base64_Encode(str.c_str(), str.size()); 139 | } 140 | 141 | string HTools::Base64_Decode(const char* data, int len, int& olen) { 142 | const char DecodeTable[] = { 143 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 145 | 62, 146 | 0, 0, 0, 147 | 63, 148 | 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 149 | 0, 0, 0, 0, 0, 0, 0, 150 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 151 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 152 | 0, 0, 0, 0, 0, 0, 153 | 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 154 | 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 155 | }; 156 | string str; 157 | int index; 158 | int i = 0; 159 | while (i < len) { 160 | if (*data != '\r' && *data != '\n') { 161 | index = DecodeTable[*data++] << 18; 162 | index += DecodeTable[*data++] << 12; 163 | str += (index & 0x00FF0000) >> 16; 164 | olen++; 165 | if (*data != '=') { 166 | index += DecodeTable[*data++] << 6; 167 | str += (index & 0x0000FF00) >> 8; 168 | olen++; 169 | if (*data != '=') { 170 | index += DecodeTable[*data++]; 171 | str += index & 0x000000FF; 172 | olen++; 173 | } 174 | } 175 | i += 4; 176 | } else { 177 | data++; 178 | i++; 179 | } 180 | } 181 | return str; 182 | } 183 | 184 | string HTools::Base64_Decode(string data, int& olen) { 185 | return Base64_Decode(data.c_str(), data.size(), olen); 186 | } 187 | 188 | std::wstring HTools::RegReadView(HKEY root, LPCWSTR path, LPCWSTR key, DWORD type) { 189 | wstring value(TEXT("")); 190 | HKEY hKey; 191 | if (RegOpenKey(root, path, &hKey) == ERROR_SUCCESS) { 192 | wchar_t buf[MAX_PATH]; 193 | wmemset(buf, 0, MAX_PATH); 194 | DWORD data = MAX_PATH * sizeof(wchar_t); 195 | if (RegQueryValueEx(hKey, key, 0, &type, (LPBYTE)buf, &data) == ERROR_SUCCESS) { 196 | value = buf; 197 | } 198 | RegCloseKey(hKey); 199 | } 200 | return value; 201 | } 202 | 203 | DWORD HTools::ReadInt(DWORD address) { 204 | DWORD intValue = 0; 205 | intValue = *(DWORD*)address; 206 | return intValue; 207 | } 208 | 209 | string HTools::ReadAsciiString(DWORD address) { 210 | string sValue = ""; 211 | char cValue[0x1000] = { 0 }; 212 | memcpy(cValue, (const void*)address, 0x1000); 213 | sValue = string(cValue); 214 | return sValue; 215 | } 216 | 217 | wstring HTools::ReadUnicodeString(DWORD address) { 218 | wstring value; 219 | int slen = (int)ReadInt(address + 0x4); 220 | DWORD str = ReadInt(address); 221 | if (str == NULL || slen == 0) { 222 | return value; 223 | } 224 | wchar_t* buffer = NULL; 225 | do { 226 | buffer = new wchar_t[slen + 1]; 227 | } while (buffer == NULL); 228 | wmemset(buffer, 0, slen + 1); 229 | wmemcpy(buffer, (const wchar_t*)str, slen); 230 | buffer[slen] = '\0'; 231 | value.append(buffer); 232 | delete[] buffer; 233 | return value; 234 | } 235 | 236 | typedef struct tagWNDINFO { 237 | DWORD dwProcessId; 238 | HWND hWnd; 239 | } WNDINFO, * LPWNDINFO; 240 | 241 | BOOL CALLBACK YourEnumProc(HWND hWnd, LPARAM lParam) { 242 | DWORD dwProcessId; 243 | GetWindowThreadProcessId(hWnd, &dwProcessId); 244 | LPWNDINFO pInfo = (LPWNDINFO)lParam; 245 | if (dwProcessId == pInfo->dwProcessId) { 246 | pInfo->hWnd = hWnd; 247 | return FALSE; 248 | } 249 | return TRUE; 250 | } 251 | 252 | HWND HTools::GetProcessWnd(DWORD pid) { 253 | WNDINFO wi; 254 | wi.dwProcessId = pid; 255 | wi.hWnd = NULL; 256 | EnumWindows(YourEnumProc, (LPARAM)&wi); 257 | return wi.hWnd; 258 | } 259 | -------------------------------------------------------------------------------- /HTools.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | 6 | 7 | class HTools { 8 | 9 | 10 | public: 11 | static std::string GetFileVersion(std::string filePath); 12 | static BOOL FileExist(std::string file); 13 | 14 | static std::wstring itow(int i); 15 | static std::string w2s(std::wstring wstr); 16 | static std::string wstring2string(std::wstring wstr); 17 | static std::wstring s2w(std::string str); 18 | static std::wstring string2wstring(std::string str); 19 | static const char* u2g(std::string str); 20 | static std::string& Replace(std::string& str, const std::string& old_value, const std::string& new_value); 21 | 22 | static std::string Base64_Encode(const char* data, int len); 23 | static std::string Base64_Encode(std::string str); 24 | static std::string Base64_Decode(const char* data, int len, int& olen); 25 | static std::string Base64_Decode(std::string data, int& olen); 26 | 27 | static std::wstring RegReadView(HKEY root, LPCWSTR path, LPCWSTR key, DWORD type = REG_SZ); 28 | 29 | static DWORD ReadInt(DWORD address); 30 | static std::string ReadAsciiString(DWORD address); 31 | static std::wstring ReadUnicodeString(DWORD address); 32 | 33 | static HWND GetProcessWnd(DWORD pid); 34 | }; 35 | 36 | -------------------------------------------------------------------------------- /HUtil.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/HUtil.cpp -------------------------------------------------------------------------------- /HUtil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #define WX_VERSION "3.1.0.41" 5 | 6 | #define FIVE 5 7 | 8 | class HUtil { 9 | public: 10 | HUtil(); 11 | ~HUtil(); 12 | 13 | DWORD Offset(DWORD offset); 14 | 15 | void OpenConsole(); 16 | void CloseConsole(); 17 | 18 | private: 19 | DWORD mBase = NULL; 20 | 21 | FILE* mConsoleOut; 22 | std::streambuf* mConsoleOutBackup; 23 | BOOL mConsoleOpen = FALSE; 24 | 25 | public: 26 | static std::string GetWeChatVersion(); 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /HWeChat.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "pch.h" 3 | #include "HTools.h" 4 | #include "HUtil.h" 5 | 6 | #define HASM __declspec(naked) 7 | 8 | typedef const UNICODE_STRING* PCUNICODE_STRING; 9 | 10 | typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA { 11 | ULONG Flags; 12 | PCUNICODE_STRING FullDllName; 13 | PCUNICODE_STRING BaseDllName; 14 | PVOID DllBase; 15 | ULONG SizeOfImage; 16 | } LDR_DLL_LOADED_NOTIFICATION_DATA, * PLDR_DLL_LOADED_NOTIFICATION_DATA; 17 | 18 | typedef struct _LDR_DLL_UNLOADED_NOTIFICATION_DATA { 19 | ULONG Flags; 20 | PCUNICODE_STRING FullDllName; 21 | PCUNICODE_STRING BaseDllName; 22 | PVOID DllBase; 23 | ULONG SizeOfImage; 24 | } LDR_DLL_UNLOADED_NOTIFICATION_DATA, * PLDR_DLL_UNLOADED_NOTIFICATION_DATA; 25 | 26 | typedef union _LDR_DLL_NOTIFICATION_DATA { 27 | LDR_DLL_LOADED_NOTIFICATION_DATA Loaded; 28 | LDR_DLL_UNLOADED_NOTIFICATION_DATA Unloaded; 29 | } LDR_DLL_NOTIFICATION_DATA, * PLDR_DLL_NOTIFICATION_DATA; 30 | 31 | typedef const PLDR_DLL_NOTIFICATION_DATA PCLDR_DLL_NOTIFICATION_DATA; 32 | 33 | typedef VOID(NTAPI* PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG NotificationReason, PCLDR_DLL_NOTIFICATION_DATA NotificationData, PVOID Context); 34 | typedef NTSTATUS(NTAPI* PfnLdrRegisterDllNotification)(ULONG Flags, PLDR_DLL_NOTIFICATION_FUNCTION NotificationFunction, void* Context, void** Cookie); 35 | typedef NTSTATUS(NTAPI* PfnLdrUnregisterDllNotification)(void* Cookie); 36 | 37 | 38 | #define LDR_DLL_NOTIFICATION_REASON_LOADED 1 39 | #define LDR_DLL_NOTIFICATION_REASON_UNLOADED 2 40 | 41 | typedef struct _WXLINK { 42 | struct _WXLINK* p; 43 | struct _WXLINK* n; 44 | struct _WXLINK* d; 45 | } WxLink; 46 | 47 | typedef struct _WXSTRING { 48 | wchar_t* pstr; 49 | int len; 50 | int maxLen; 51 | int fill1 = 0; 52 | int fill2 = 0; 53 | } WxString; 54 | 55 | typedef struct _WXUSERINFO { 56 | char top[0x8]; 57 | WxString wxid; 58 | WxString account; 59 | WxString vData; 60 | int un_0; 61 | int un_1; 62 | char un_2[0x18]; 63 | WxString name; 64 | char un_3[0x28]; 65 | int un_4; 66 | WxString nameUpper; 67 | WxString nameUn; 68 | char un_5[0x28]; 69 | WxString pic; 70 | WxString img; 71 | char* md5; 72 | char un_6[0xC]; 73 | int un_7; 74 | int addSource; 75 | char un_8[0x2AC]; 76 | } WxUserInfo, * PWxUserInfo; 77 | 78 | typedef struct _WXMESSAGE { 79 | char fill[0x24C]; 80 | WxLink* link; 81 | char fill2[0x20]; 82 | char fill3[0x68]; 83 | } WxMessage; 84 | 85 | typedef struct _WXDBPASS { 86 | char* pass; 87 | int len; 88 | } WxDbPass; 89 | 90 | VOID NTAPI LdrDllNotification(ULONG NotificationReason, PCLDR_DLL_NOTIFICATION_DATA NotificationData, PVOID Context); -------------------------------------------------------------------------------- /Hook_msg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Hook_msg.cpp -------------------------------------------------------------------------------- /Init_Match_Pattern.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Init_Match_Pattern.cpp -------------------------------------------------------------------------------- /Init_Match_Pattern.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | int Main_Match_Pattern(); -------------------------------------------------------------------------------- /MemOpt.cpp: -------------------------------------------------------------------------------- 1 | // MemOpt.cpp: implementation of the CMemOpt class. 2 | // 3 | ////////////////////////////////////////////////////////////////////// 4 | #include "pch.h" 5 | #include 6 | #include "MemOpt.h" 7 | 8 | #ifdef _DEBUG 9 | #undef THIS_FILE 10 | static char THIS_FILE[]=__FILE__; 11 | #define new DEBUG_NEW 12 | #endif 13 | 14 | ////////////////////////////////////////////////////////////////////// 15 | // Construction/Destruction 16 | ////////////////////////////////////////////////////////////////////// 17 | 18 | CMemOpt::CMemOpt(HANDLE hProcess,DWORD dwBase,int vOffset[],int nCount) 19 | { 20 | m_hProcess=hProcess; 21 | m_pBase=(void*)dwBase; 22 | if (nCount > 0) 23 | { 24 | DWORD dwAddr=0; 25 | ReadOffsetMem(vOffset,nCount-1,&dwAddr,4); 26 | m_pBase=(void*)(dwAddr+vOffset[nCount-1]); 27 | } 28 | } 29 | 30 | CMemOpt::~CMemOpt() 31 | { 32 | 33 | } 34 | 35 | bool CMemOpt::ReadMem(void *pBuf,int nCount) 36 | { 37 | DWORD dwTemp=0; 38 | return ::ReadProcessMemory(m_hProcess,m_pBase,pBuf,nCount,&dwTemp); 39 | } 40 | 41 | bool CMemOpt::WriteMem(void *pBuf,int nCount) 42 | { 43 | DWORD dwTemp=0; 44 | return ::WriteProcessMemory(m_hProcess,m_pBase,pBuf,nCount,&dwTemp); 45 | } 46 | 47 | bool CMemOpt::ReadOffsetMem(int vOffset[],int nSize,void *pBuf,int nCount) 48 | { 49 | DWORD dwTemp=0; 50 | void *pBaseAddr=m_pBase; 51 | DWORD dwAddr=0; 52 | for (int i=0;i 1000 9 | #pragma once 10 | #endif // _MSC_VER > 1000 11 | 12 | class CMemOpt 13 | { 14 | public: 15 | CMemOpt(HANDLE hProcess,DWORD dwBase,int vOffset[]=NULL,int nCount=0); 16 | virtual ~CMemOpt(); 17 | bool ReadMem(void *pBuf,int nCount); 18 | bool WriteMem(void *pBuf,int nCount); 19 | bool ReadOffsetMem(int vOffset[],int nSize,void *pBuf,int nCount); 20 | private: 21 | HANDLE m_hProcess; 22 | void *m_pBase; 23 | 24 | }; 25 | 26 | #endif // !defined(AFX_MEMOPT_H__659AA101_2C5E_409B_B656_49DEF306159D__INCLUDED_) 27 | -------------------------------------------------------------------------------- /ProcessOpt.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "ProcessOpt.h" 3 | 4 | CProcessOpt::CProcessOpt(DWORD dwProcessID,DWORD dwAccess) 5 | { 6 | m_hProcess=OpenProcess(dwAccess,FALSE,dwProcessID); 7 | } 8 | 9 | CProcessOpt::~CProcessOpt(void) 10 | { 11 | CloseHandle(m_hProcess); 12 | } 13 | -------------------------------------------------------------------------------- /ProcessOpt.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #define DEFAULT_ACCESS_VALUE (PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE \ 4 | | PROCESS_SUSPEND_RESUME | PROCESS_TERMINATE | PROCESS_SET_SESSIONID | PROCESS_DUP_HANDLE | PROCESS_CREATE_PROCESS \ 5 | | PROCESS_SET_QUOTA | PROCESS_SET_INFORMATION | PROCESS_QUERY_INFORMATION) 6 | 7 | class CProcessOpt 8 | { 9 | public: 10 | CProcessOpt(DWORD dwProcessID,DWORD dwAccess=DEFAULT_ACCESS_VALUE); 11 | ~CProcessOpt(void); 12 | HANDLE GetProcessHandle(){return m_hProcess;} 13 | HANDLE m_hProcess; 14 | }; 15 | -------------------------------------------------------------------------------- /PubLic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/PubLic.cpp -------------------------------------------------------------------------------- /PubLic.h: -------------------------------------------------------------------------------- 1 | //#pragma once 2 | #include 3 | #include 4 | 5 | #include "pch.h" 6 | 7 | 8 | 9 | 10 | 11 | DWORD Read_OriFun_ADD(HANDLE hProcess, DWORD AddTo_Read); 12 | DWORD getWeChatwinADD(); 13 | 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Socket_WX_Helper 2 | 3 | ## 要求 4 | 5 | + [jsonxx](https://github.com/Nomango/jsonxx) 6 | 7 | ## 2021/7/3更新 8 | 支持最新微信(3.3.0.104) 9 | 在release中下载最新的dll和服务端(还有使用接口)(先启动服务端,再注入微信) 10 | 11 | ## 项目介绍 12 | 编译环境为VS2019 只支持微信3.2.1.112版本。会在项目右侧的Release中附上3.2.1.112微信版本的安装包,编译好的dll可在Release到,该项目使用socket通信,只要是支持socket的语言都可以使用。(如果你不会写的话,可以加群找我要) 13 | 14 | ### 主要功能: 15 | 0. 16 | 接收消息: 17 | 18 | 19 | ![image](https://github.com/2826430176/Wx_Socket_Helper/blob/main/Static/recv_msg.png) 20 | 21 | 22 | + 1. 发送普通文本消息: 23 | ``` 24 | { 25 | "type": 1, 26 | "wxid":"wxid", 27 | "msg":"消息内容" 28 | } 29 | 例如:{"type":1,"wxid":"filehelper","msg":"消息内容"} 30 | ``` 31 | 效果演示: 32 | ![image](https://github.com/2826430176/Wx_Socket_Helper/blob/main/Static/%E5%8F%91%E9%80%81%E6%99%AE%E9%80%9A%E6%B6%88%E6%81%AF.png) 33 | 34 | 35 | + 2. 发送名片 36 | ```javascript 37 | { 38 | "type": 2, 39 | "wxid":"wxid", 40 | "source":"源wxid", 41 | "NickName":"昵称" 42 | } 43 | 44 | 例如:{"type": 2,"wxid":"filehelper""source":"wxid_4zr616ir6fi122""NickName":"昵称"} 45 | ``` 46 | 47 | 效果演示: 48 | 49 | ![image](https://github.com/2826430176/Wx_Socket_Helper/blob/main/Static/sendxmlcard.png) 50 | 51 | 52 | + 3. 通过wxid获取好友详细信息 53 | ```javascript 54 | { 55 | "type": 3, 56 | "wxid":"wxid", 57 | } 58 | ``` 59 | 例如: 60 | 61 | {"type": 3,"wxid":"wxid_4zr616ir6fi122",} 62 | 63 | 效果演示: 64 | ![image](https://github.com/2826430176/Wx_Socket_Helper/blob/main/Static/wxid%E8%8E%B7%E5%8F%96%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.jpg) 65 | 66 | 67 | + 4. 遍历二叉树获取好友列表 68 | ```javascript 69 | { 70 | "type": 4, 71 | } 72 | ``` 73 | 例如: 74 | 75 | {"type": 4} 76 | 77 | 效果演示: 78 | 79 | ![image](https://github.com/2826430176/Wx_Socket_Helper/blob/main/Static/%E8%8E%B7%E5%8F%96%E5%A5%BD%E5%8F%8B%E5%88%97%E8%A1%A8.png) 80 | 81 | 82 | #### python控制台收到的并不是错误的,这个是编码后的,可以用utf8解开还原成中文,我实力太菜,就不想折腾了 83 | 84 | + 5. 通过wxid获取好友详细信息 85 | ```javascript 86 | 87 | { 88 | "type": 3, 89 | "wxid":"wxid", 90 | } 91 | 92 | ``` 93 | 例如: 94 | 95 | {"type":3,"wxid":"wxid_4zr616ir6fi122"} 96 | 97 | 效果演示: 98 | 99 | ![image](https://github.com/2826430176/Wx_Socket_Helper/blob/main/Static/wxid%E8%8E%B7%E5%8F%96%E8%AF%A6%E7%BB%86%E4%BF%A1%E6%81%AF.jpg) 100 | 101 | --- 102 | 103 | + 5. 通过wxid关注公众号 104 | 105 | ```javascript 106 | { 107 | "type": 12, 108 | "wxid":"wxid", 109 | } 110 | 111 | ``` 112 | 113 | 效果演示: 114 | ![image](https://github.com/zhuzhu-Top/Wx_Socket_Helper/blob/main/Static/add_public.png) 115 | 116 | ---- 117 | #### 这里还有一些别的个人信息,我只是没有取出来,有需要的话,可以自己看下我的代码去取出来,我写的都挺简单易懂的(太懒了,没办法-_-) 118 | 119 | 120 | ### 余下的功能就不一一演示了,第一次开源项目,github都不太会用,后面闲着没事了,如果有需要的话我会完善的,我的所用功能都在socketMain里可以找到。 121 | 122 | 123 | 124 | 125 | ---- 126 | 127 | ### 我写这个项目的目的,只是单纯的想考验下我自己的实力,FindPattern库是我偶然一次看到大佬发出来的,这个特征码匹配的还是很不错的,我本来想的是全部功能都用特征码实现,后面发现太麻烦了,就放弃了,ZZHook是我自己封装的,我个人感觉还是挺方便的,我在hook 消息的时候有用到,有兴趣的一看看 128 | 129 | 130 | 131 | ###声明 132 | 本项目仅供技术研究,请勿用于任何商业用途,请勿用于非法用途,如有任何人凭此做何非法事情,均于作者无关,特此声明。 133 | -------------------------------------------------------------------------------- /Recv_Money.cpp: -------------------------------------------------------------------------------- 1 | #include "PubLic.h" 2 | #include "pch.h" 3 | #include 4 | 5 | #include "HWeChat.h" 6 | 7 | #include "pch.h" 8 | 9 | 10 | #include "jsonxx/json.hpp" 11 | DWORD getWeChatwinADD(); 12 | 13 | 14 | void CllectMoney(wchar_t* transferid, wchar_t* wxid) 15 | { 16 | struct CllectMoneyStruct 17 | { 18 | wchar_t* ptransferid; 19 | int transferidLen; 20 | int transferidMaxLen; 21 | char full[0x8] = { 0 }; 22 | wchar_t* pwxid; 23 | int wxidLen; 24 | int wxidMaxLen; 25 | char full2[0x8] = { 0 }; 26 | }; 27 | 28 | CllectMoneyStruct cllect; 29 | cllect.ptransferid = transferid; 30 | cllect.transferidLen = wcslen(transferid) + 1; 31 | cllect.transferidMaxLen = (wcslen(transferid) + 1) * 2; 32 | cllect.pwxid = wxid; 33 | cllect.wxidLen = wcslen(wxid) + 1; 34 | cllect.wxidMaxLen = (wcslen(wxid) + 1) * 2; 35 | 36 | char* asmBuff = (char*)&cllect.ptransferid; 37 | 38 | //9B3F40 39 | // 9B3FC0 40 | 41 | DWORD dwCall1 = getWeChatwinADD() + 0x9B3F40; 42 | DWORD dwCall2 = getWeChatwinADD() + 0x9B3FC0; 43 | 44 | 45 | __asm 46 | { 47 | sub esp, 0x30; 48 | mov ecx, esp; 49 | mov eax, asmBuff; 50 | push eax; 51 | call dwCall1; 52 | call dwCall2; 53 | add esp, 0x30; 54 | } 55 | } -------------------------------------------------------------------------------- /Release/Socket_WX_helper.Build.CppClean.log: -------------------------------------------------------------------------------- 1 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.pch 2 | d:\code\c++\socket_wx_helper\release\vc142.pdb 3 | d:\code\c++\socket_wx_helper\release\pch.obj 4 | d:\code\c++\socket_wx_helper\release\zzhook.obj 5 | d:\code\c++\socket_wx_helper\release\wxid_get_info.obj 6 | d:\code\c++\socket_wx_helper\release\socketmain.obj 7 | d:\code\c++\socket_wx_helper\release\send_msg.obj 8 | d:\code\c++\socket_wx_helper\release\public.obj 9 | d:\code\c++\socket_wx_helper\release\processopt.obj 10 | d:\code\c++\socket_wx_helper\release\memopt.obj 11 | d:\code\c++\socket_wx_helper\release\init_match_pattern.obj 12 | d:\code\c++\socket_wx_helper\release\hutil.obj 13 | d:\code\c++\socket_wx_helper\release\htools.obj 14 | d:\code\c++\socket_wx_helper\release\hook_msg.obj 15 | d:\code\c++\socket_wx_helper\release\group.obj 16 | d:\code\c++\socket_wx_helper\release\gei_info.obj 17 | d:\code\c++\socket_wx_helper\release\findpattern.obj 18 | d:\code\c++\socket_wx_helper\release\dllmain.obj 19 | d:\code\c++\socket_wx_helper\release\add_friend.obj 20 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.dll 21 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.pdb 22 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.lib 23 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.exp 24 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.ipdb 25 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.iobj 26 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.tlog\cl.command.1.tlog 27 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.tlog\cl.read.1.tlog 28 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.tlog\cl.write.1.tlog 29 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.tlog\link.command.1.tlog 30 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.tlog\link.read.1.tlog 31 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.tlog\link.write.1.tlog 32 | d:\code\c++\socket_wx_helper\release\socket_wx_helper.tlog\socket_wx_helper.write.1u.tlog 33 | -------------------------------------------------------------------------------- /Release/Socket_WX_helper.dll.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | D:\code\C++\Socket_WX_helper\Release\Socket_WX_helper.dll 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Release/Socket_WX_helper.exe.recipe: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | D:\code\C++\Socket_WX_helper\Release\Socket_WX_helper.exe 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Release/Socket_WX_helper.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.exp -------------------------------------------------------------------------------- /Release/Socket_WX_helper.iobj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.iobj -------------------------------------------------------------------------------- /Release/Socket_WX_helper.ipdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.ipdb -------------------------------------------------------------------------------- /Release/Socket_WX_helper.log: -------------------------------------------------------------------------------- 1 |  pch.cpp 2 | Add_Friend.cpp 3 | dllmain.cpp 4 | FindPattern.cpp 5 | D:\code\C++\Socket_WX_helper\FindPattern.cpp(199,17): warning C4267: “=”: 从“size_t”转换到“short”,可能丢失数据 6 | Gei_Info.cpp 7 | D:\code\C++\Socket_WX_helper\Gei_Info.cpp(68): warning C4405: “ret”: 标识符是保留字 8 | Group.cpp 9 | Hook_msg.cpp 10 | HTools.cpp 11 | HUtil.cpp 12 | Init_Match_Pattern.cpp 13 | MemOpt.cpp 14 | ProcessOpt.cpp 15 | PubLic.cpp 16 | Send_msg.cpp 17 | socketMain.cpp 18 | D:\code\C++\Socket_WX_helper\socketMain.cpp(13,1): warning C4005: “Log”: 宏重定义 19 | D:\code\C++\Socket_WX_helper\ZZHook.h(4): message : 参见“Log”的前一个定义 20 | D:\code\C++\Socket_WX_helper\socketMain.cpp(210,9): warning C4101: “optVal”: 未引用的局部变量 21 | wxid_Get_Info.cpp 22 | ZZHook.cpp 23 | D:\code\C++\Socket_WX_helper\ZZHook.cpp(71,11): warning C4477: “printf_s”: 格式字符串“%X”需要类型“unsigned int”的参数,但可变参数 1 拥有了类型“BYTE *” 24 | 正在创建库 D:\code\C++\Socket_WX_helper\Release\Socket_WX_helper.lib 和对象 D:\code\C++\Socket_WX_helper\Release\Socket_WX_helper.exp 25 | 正在生成代码 26 | Previous IPDB not found, fall back to full compilation. 27 | All 1030 functions were compiled because no usable IPDB/IOBJ from previous compilation was found. 28 | 已完成代码的生成 29 | Socket_WX_helper.vcxproj -> D:\code\C++\Socket_WX_helper\Release\Socket_WX_helper.dll 30 | -------------------------------------------------------------------------------- /Release/Socket_WX_helper.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.pdb -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/CL.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.tlog/CL.command.1.tlog -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/CL.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.tlog/CL.read.1.tlog -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/CL.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.tlog/CL.write.1.tlog -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/Socket_WX_helper.lastbuildstate: -------------------------------------------------------------------------------- 1 | PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.28.29333:TargetPlatformVersion=10.0.18362.0:VcpkgTriplet=x86-windows: 2 | Release|Win32|D:\code\C++\Socket_WX_helper\| 3 | -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/Socket_WX_helper.write.1u.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.tlog/Socket_WX_helper.write.1u.tlog -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/link.command.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.tlog/link.command.1.tlog -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/link.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.tlog/link.read.1.tlog -------------------------------------------------------------------------------- /Release/Socket_WX_helper.tlog/link.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/Socket_WX_helper.tlog/link.write.1.tlog -------------------------------------------------------------------------------- /Release/Socket_WX_helper.vcxproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | D:\code\C++\Socket_WX_helper\Release\Socket_WX_helper.dll 2 | -------------------------------------------------------------------------------- /Release/vc142.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Release/vc142.pdb -------------------------------------------------------------------------------- /Release/vcpkg.applocal.log: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /Send_msg.cpp: -------------------------------------------------------------------------------- 1 | #include "PubLic.h" 2 | #include "pch.h" 3 | #include 4 | DWORD getWeChatwinADD(); 5 | 6 | extern DWORD Send_Normal_msg_ADD; 7 | 8 | struct wxString 9 | { 10 | wchar_t* pStr; 11 | int strLen; 12 | int strMaxLen; 13 | char fillbuff[0x8]; 14 | }; 15 | 16 | typedef struct _WXSTRING { 17 | wchar_t* pstr; 18 | int len; 19 | int maxLen; 20 | int fill1 = 0; 21 | int fill2 = 0; 22 | } WxString; 23 | void SendMsg(std::wstring wxid, std::wstring message) { 24 | WxString to = { 0 }; 25 | WxString text = { 0 }; 26 | 27 | to.pstr = (wchar_t*)wxid.c_str(); 28 | to.len = wxid.size(); 29 | to.maxLen = wxid.size() * 2; 30 | 31 | text.pstr = (wchar_t*)message.c_str(); 32 | text.len = message.size(); 33 | text.maxLen = message.size(); 34 | 35 | char buff[0x20] = { 0 }; 36 | char buff_2[0x500] = { 0 }; 37 | 38 | DWORD sendCall = getWeChatwinADD() + 0x3B50E0; 39 | 40 | __asm { 41 | pushad 42 | pushfd 43 | 44 | push 0x1 45 | lea edi, buff 46 | push edi 47 | lea ebx, text 48 | push ebx 49 | lea edx, to 50 | lea ecx, buff_2 51 | call sendCall 52 | add esp, 0xc 53 | 54 | popfd 55 | popad 56 | } 57 | } 58 | 59 | //自己写的发送消息 可以用来当作参考 60 | //VOID Send_msg(wchar_t* wxid_Send, wchar_t* message_Send) { 61 | // 62 | // 63 | // 64 | // //DWORD Send_call = getWeChatwinADD() + Send_Normal_msg_ADD; //偏移 65 | // DWORD Send_call = getWeChatwinADD() + 0x3B50E0; //偏移 66 | // //组装需要的数据格式 67 | // wxString pWxid = { 0 }; 68 | // pWxid.pStr = wxid_Send; 69 | // pWxid.strLen = wcslen(wxid_Send); //wcslen 获取宽字符版本(unicode)的长度 70 | // pWxid.strMaxLen = wcslen(wxid_Send) * 2; 71 | // 72 | // wxString pMessage = { 0 }; 73 | // pMessage.pStr = message_Send; 74 | // pMessage.strLen = wcslen(message_Send); 75 | // pMessage.strMaxLen = wcslen(message_Send) * 2; 76 | // 77 | // //取出内容的地址 78 | // char* asmWxid = (char*)&pWxid.pStr; 79 | // 80 | // char* asmMessage = (char*)&pMessage.pStr; 81 | // char buff[0x87C] = { 0 }; //设置缓冲区 82 | // char buff_2[0x87C] = { 0 }; //设置缓冲区 83 | // 84 | // 85 | // /* 86 | //mov edx,dword ptr ss:[ebp-0x50] ; wxid 87 | //lea eax,dword ptr ds:[ebx+0x14] ; 0 88 | //push 0x1 ; 1 89 | //push eax ; 0 90 | //push ebx ; 聊天内容 91 | //lea ecx,dword ptr ss:[ebp-0x87C] 92 | //call WeChatWi.614E9BF0 ; 发送聊天消息 93 | // 94 | //ebx ==1160698C 95 | // 96 | //1160698C 121639D8 UNICODE "333333333" 97 | //11606990 00000009 98 | //11606994 00000009 99 | //11606998 00000000 100 | //1160699C 00000000 101 | //6A 01 push 0x1 102 | //57 push edi ; 缓冲区 103 | //53 push ebx ; 消息 104 | //8D95 78FFFFFF lea edx,dword ptr ss:[ebp-0x88] ; wxid 105 | //8D8D 58FAFFFF lea ecx,dword ptr ss:[ebp-0x5A8] 106 | //E8 70862A00 call WeChatWi.7AF750E0 ; 发送文本消息 107 | // */ 108 | // //MessageBoxA(NULL, "OK", "Ok", MB_OK); 109 | // __asm { 110 | // pushad 111 | // pushfd 112 | // 113 | // push 0x1 114 | // lea edi, buff_2 115 | // push edi 116 | // mov ebx, asmMessage 117 | // push ebx 118 | // mov edx, asmWxid //wxid 119 | // lea ecx, buff 120 | // call Send_call 121 | // add esp, 0xC 122 | // 123 | // popfd 124 | // popad 125 | // } 126 | //}; 127 | 128 | void SendXmlCard(std::wstring RecverWxid, std::wstring SendWxid, std::wstring NickName) 129 | { 130 | 131 | 132 | WxString pWxid = { 0 }; 133 | WxString pXml = { 0 }; 134 | wchar_t xml[0x2000] = { 0 }; 135 | pWxid.pstr = (wchar_t*)RecverWxid.c_str(); 136 | pWxid.len = RecverWxid.size(); 137 | pWxid.maxLen = RecverWxid.size() * 2; 138 | 139 | swprintf_s(xml, L"", (wchar_t*)SendWxid.c_str(), (wchar_t*)NickName.c_str(), (wchar_t*)SendWxid.c_str()); 140 | pXml.pstr = xml; 141 | pXml.len = wcslen(xml); 142 | pXml.maxLen = wcslen(xml) * 2; 143 | 144 | char* asmWxid = (char*)&pWxid.pstr; 145 | char* asmXml = (char*)&pXml.pstr; 146 | char buff[0x400] = { 0 }; 147 | DWORD callAdd = (DWORD)GetModuleHandle(L"WeChatWin.dll") + 0x3B50E0; 148 | 149 | //typedef int(__fastcall* SendXml)(char buf[], char *wxid, char* xmlCard, DWORD, DWORD); 150 | //SendXml(buff,asmWxid, asmXml, 0x0, 0x2A); 151 | 152 | //push 0x2A; 0x2A 153 | //lea eax, dword ptr ss : [ebp - 0x28] 154 | //mov edx, esi; 对方的wxid 155 | //push 0x0; 0 0 156 | //push eax; 卡片xml 157 | //lea ecx, dword ptr ss : [ebp - 0x284] 缓冲区 158 | //call WeChatWi.79E950E0 159 | __asm { 160 | mov eax, asmXml 161 | push 0x2A 162 | mov edx, asmWxid 163 | push 0x0 164 | push eax 165 | lea ecx, buff 166 | call callAdd 167 | add esp, 0xC 168 | } 169 | } 170 | 171 | 172 | 173 | void Send_Pic(std::wstring wxid,std::wstring pic) { 174 | //std::wstring wxid = L"wxid_4zr616ir6fi122"; 175 | //std::wstring pic = L"C:/aaaa.jpg"; 176 | 177 | WxString pWxid = { 0 }; 178 | pWxid.pstr = (wchar_t*)wxid.c_str(); 179 | pWxid.len = wxid.size(); 180 | pWxid.maxLen = wxid.size() * 2; 181 | 182 | WxString pPic = { 0 }; 183 | pPic.pstr = (wchar_t*)pic.c_str(); 184 | pPic.len = pic.size(); 185 | pPic.maxLen = pic.size() * 2; 186 | char CONST_1[4] = { 1 }; 187 | char buf[0x500] = { 0 }; 188 | 189 | //52EF4AB8 E8 93BFFFFF call WeChatWi.52EF0A50 190 | 191 | 192 | //52B40000 193 | //52C4CB80 53 push ebx; 图片 194 | // 52C4CB81 8D85 78FFFFFF lea eax, dword ptr ss : [ebp - 0x88] 195 | // 52C4CB87 C645 FC 09 mov byte ptr ss : [ebp - 0x4] , 0x9 196 | // 52C4CB8B 50 push eax; wxid 197 | // 52C4CB8C 8D85 B0FCFFFF lea eax, dword ptr ss : [ebp - 0x350] 198 | // 52C4CB92 50 push eax; 1 199 | // 52C4CB93 E8 886BF5FF call WeChatWi.52BA3720 200 | // 52C4CB98 8BC8 mov ecx, eax 201 | // 52C4CB9A C645 FC 01 mov byte ptr ss : [ebp - 0x4] , 0x1 202 | // 52C4CB9E E8 FD7D2A00 call WeChatWi.52EF49A0 203 | // 52C4CBA3 C645 FC 0A mov byte ptr ss : [ebp - 0x4] , 0xA 204 | // 52C4CBA7 E8 44E81D00 call WeChatWi.52E2B3F0 205 | 206 | DWORD call_1 = getWeChatwinADD() + 0x63720; 207 | DWORD call_2 = getWeChatwinADD() + 0x3B49A0; 208 | DWORD call_3 = getWeChatwinADD() + 0x2EB3F0; 209 | __asm { 210 | lea ebx, pPic 211 | push ebx 212 | lea eax, pWxid 213 | push eax 214 | lea eax, CONST_1 215 | push eax 216 | call call_1 217 | mov ecx, eax 218 | call call_2 219 | call call_3 220 | } 221 | 222 | } -------------------------------------------------------------------------------- /Socket_WX_helper.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30320.27 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Socket_WX_helper", "Socket_WX_helper.vcxproj", "{7F03E5C6-3271-484C-BF26-0DD88D4133E1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Debug|x64.ActiveCfg = Debug|x64 17 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Debug|x64.Build.0 = Debug|x64 18 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Debug|x86.ActiveCfg = Debug|Win32 19 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Debug|x86.Build.0 = Debug|Win32 20 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Release|x64.ActiveCfg = Release|x64 21 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Release|x64.Build.0 = Release|x64 22 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Release|x86.ActiveCfg = Release|Win32 23 | {7F03E5C6-3271-484C-BF26-0DD88D4133E1}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {61C84845-DCFA-44DD-BB8E-3BF155823C12} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Socket_WX_helper.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {7f03e5c6-3271-484c-bf26-0dd88d4133e1} 25 | SocketWXhelper 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | 79 | 80 | true 81 | 82 | 83 | false 84 | 85 | 86 | 87 | Level3 88 | true 89 | WIN32;_DEBUG;SOCKETWXHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 90 | true 91 | Use 92 | pch.h 93 | false 94 | 95 | 96 | Windows 97 | true 98 | false 99 | 100 | 101 | 102 | 103 | Level3 104 | true 105 | true 106 | true 107 | WIN32;NDEBUG;SOCKETWXHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 108 | true 109 | Use 110 | pch.h 111 | MultiThreaded 112 | D:\C_head\jsonxx-master\include;%(AdditionalIncludeDirectories) 113 | 114 | 115 | Windows 116 | true 117 | true 118 | true 119 | false 120 | 121 | 122 | 123 | 124 | Level3 125 | true 126 | _DEBUG;SOCKETWXHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 127 | true 128 | Use 129 | pch.h 130 | 131 | 132 | Windows 133 | true 134 | false 135 | 136 | 137 | 138 | 139 | Level3 140 | true 141 | true 142 | true 143 | NDEBUG;SOCKETWXHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 144 | true 145 | Use 146 | pch.h 147 | 148 | 149 | Windows 150 | true 151 | true 152 | true 153 | false 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | Create 184 | Create 185 | Create 186 | Create 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /Socket_WX_helper.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 头文件 20 | 21 | 22 | 头文件 23 | 24 | 25 | 头文件 26 | 27 | 28 | 头文件 29 | 30 | 31 | 头文件 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 头文件 41 | 42 | 43 | 头文件 44 | 45 | 46 | 头文件 47 | 48 | 49 | 头文件 50 | 51 | 52 | 头文件 53 | 54 | 55 | 头文件 56 | 57 | 58 | 59 | 60 | 源文件 61 | 62 | 63 | 源文件 64 | 65 | 66 | 源文件 67 | 68 | 69 | 源文件 70 | 71 | 72 | 源文件 73 | 74 | 75 | 源文件 76 | 77 | 78 | 源文件 79 | 80 | 81 | 源文件 82 | 83 | 84 | 源文件 85 | 86 | 87 | 源文件 88 | 89 | 90 | 源文件 91 | 92 | 93 | 源文件 94 | 95 | 96 | 源文件 97 | 98 | 99 | 源文件 100 | 101 | 102 | 源文件 103 | 104 | 105 | 源文件 106 | 107 | 108 | 源文件 109 | 110 | 111 | -------------------------------------------------------------------------------- /Socket_WX_helper.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | D:\software\WX\WeChat\WeChat.exe 5 | true 6 | WindowsLocalDebugger 7 | 8 | 9 | 10 | 11 | WindowsLocalDebugger 12 | false 13 | 14 | -------------------------------------------------------------------------------- /Static/add_public.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Static/add_public.png -------------------------------------------------------------------------------- /Static/recv_msg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Static/recv_msg.png -------------------------------------------------------------------------------- /Static/sendxmlcard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Static/sendxmlcard.png -------------------------------------------------------------------------------- /Static/wxid获取详细信息.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Static/wxid获取详细信息.jpg -------------------------------------------------------------------------------- /Static/发送普通消息.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Static/发送普通消息.png -------------------------------------------------------------------------------- /Static/收款.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Static/收款.png -------------------------------------------------------------------------------- /Static/获取好友列表.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/Static/获取好友列表.png -------------------------------------------------------------------------------- /ZZHook.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/ZZHook.cpp -------------------------------------------------------------------------------- /ZZHook.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/ZZHook.h -------------------------------------------------------------------------------- /cvtcode.hpp: -------------------------------------------------------------------------------- 1 | //@Unicode To Utf-8 2 | static inline std::string uc2u8(std::wstring unicode) 3 | { 4 | int len = WideCharToMultiByte(CP_UTF8, 0, unicode.c_str(), -1, NULL, 0, NULL, NULL); 5 | char* utf8 = (char*)malloc(len); 6 | memset(utf8, 0, len); 7 | WideCharToMultiByte(CP_UTF8, 0, unicode.c_str(), -1, utf8, len, NULL, NULL); 8 | std::string str(utf8); 9 | free(utf8); 10 | return str; 11 | } 12 | //@Utf-8 To Unicode 13 | static inline std::wstring u82uc(const std::string utf8) 14 | { 15 | if (utf8.empty()) 16 | { 17 | return std::wstring(); 18 | } 19 | 20 | int len = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, NULL, 0); 21 | wchar_t *unicode = (wchar_t*)malloc((len * sizeof(wchar_t))); 22 | wmemset(unicode, 0, len); 23 | MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, (LPWSTR)unicode, len); 24 | std::wstring str(unicode); 25 | free(unicode); 26 | return str; 27 | } 28 | //@Gbk To Utf-8 29 | static inline std::string gbk2u8(const std::string gbk) 30 | { 31 | //Gbk To Unicode 32 | int len = MultiByteToWideChar(CP_ACP, 0, gbk.c_str(), -1, NULL, 0); 33 | wchar_t* unicode = (wchar_t*)malloc((len * sizeof(wchar_t))); 34 | wmemset(unicode, 0, len); 35 | MultiByteToWideChar(CP_ACP, 0, gbk.c_str(), -1, unicode, len); 36 | 37 | //Unicode To Utf-8 38 | len = WideCharToMultiByte(CP_UTF8, 0, unicode, -1, NULL, 0, NULL, NULL); 39 | char * utf8 = (char*)malloc((len * sizeof(char))); 40 | memset(utf8, 0, len); 41 | WideCharToMultiByte(CP_UTF8, 0, unicode, -1, utf8, len, NULL, NULL); 42 | 43 | std::string str(utf8); 44 | free(unicode); 45 | free(utf8); 46 | return str; 47 | } 48 | //@UTF-8 To GBK 49 | static inline std::string u82gbk(const std::string utf8) 50 | { 51 | //Utf-8 To Unicode 52 | int len = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, NULL, 0); 53 | wchar_t* unicode = (wchar_t*)malloc((len * sizeof(wchar_t))); 54 | wmemset(unicode, 0, len); 55 | MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, unicode, len); 56 | 57 | //Unicode To Gbk 58 | len = WideCharToMultiByte(CP_ACP, 0, unicode, -1, NULL, 0, NULL, NULL); 59 | char* gbk = (char*)malloc((len * sizeof(char))); 60 | memset(gbk, 0, len); 61 | WideCharToMultiByte(CP_ACP, 0, unicode, -1, gbk, len, NULL, NULL); 62 | 63 | std::string str(gbk); 64 | free(unicode); 65 | free(gbk); 66 | return str; 67 | } 68 | //@Gbk To Unicode 69 | static inline std::wstring gbk2uc(const std::string gbk) 70 | { 71 | int len = MultiByteToWideChar(CP_ACP, 0, gbk.c_str(), -1, NULL, 0); 72 | wchar_t* unicode = (wchar_t*)malloc((len * sizeof(wchar_t))); 73 | wmemset(unicode, 0, len); 74 | MultiByteToWideChar(CP_ACP, 0, gbk.c_str(), -1, unicode, len); 75 | 76 | std::wstring str(unicode); 77 | free(unicode); 78 | return str; 79 | } 80 | //@Unicode To Gbk 81 | static inline std::string uc2gbk(const std::wstring unicode) 82 | { 83 | int len = WideCharToMultiByte(CP_ACP, 0, unicode.c_str(), -1, NULL, 0, NULL, NULL); 84 | char* gbk = (char*)malloc((len * sizeof(char))); 85 | WideCharToMultiByte(CP_ACP, 0, unicode.c_str(), -1, gbk, len, NULL, NULL); 86 | 87 | std::string str(gbk); 88 | free(gbk); 89 | return str; 90 | } 91 | //@Unicode To Utf-8 92 | static inline int uc2u8(__out char* utf8, const wchar_t* unicode) 93 | { 94 | int len = WideCharToMultiByte(CP_UTF8, 0, unicode, -1, NULL, 0, NULL, NULL); 95 | WideCharToMultiByte(CP_UTF8, 0, unicode, -1, utf8, len, NULL, NULL); 96 | return len; 97 | } 98 | //@Utf-8 To Unicode 99 | static inline int u82uc(__out wchar_t* unicode, const char* utf8) 100 | { 101 | int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, NULL, 0); //-1 include '\0' 102 | MultiByteToWideChar(CP_UTF8, 0, utf8, -1, (LPWSTR)unicode, len); 103 | return len; 104 | } -------------------------------------------------------------------------------- /dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : 定义 DLL 应用程序的入口点。 2 | #include "pch.h" 3 | #include "socketMain.h" 4 | #pragma warning(disable:4996) 5 | #include 6 | 7 | VOID Send_Data(std::string data); 8 | void Start_Socket(); 9 | BOOL APIENTRY DllMain( HMODULE hModule, 10 | DWORD ul_reason_for_call, 11 | LPVOID lpReserved 12 | ) 13 | { 14 | switch (ul_reason_for_call) 15 | { 16 | case DLL_PROCESS_ATTACH: 17 | { 18 | //MessageBoxA(NULL, "DLL_PROCESS_ATTACH", NULL, MB_OK); 19 | CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)Start_Socket, hModule, 0, NULL); 20 | } 21 | case DLL_THREAD_ATTACH: 22 | case DLL_THREAD_DETACH: 23 | case DLL_PROCESS_DETACH: 24 | //MessageBox(NULL, L"over", L"over", MB_OK); 25 | break; 26 | } 27 | return TRUE; 28 | } 29 | 30 | //把发送数据的代码领出来写再这 31 | //int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) 32 | //{ 33 | // //你来 注释掉 34 | // Start_Socket(); 35 | // 36 | // return 0; 37 | //} 38 | -------------------------------------------------------------------------------- /framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 4 | // Windows 头文件 5 | #include 6 | -------------------------------------------------------------------------------- /pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: 与预编译标头对应的源文件 2 | 3 | #include "pch.h" 4 | 5 | // 当使用预编译的头时,需要使用此源文件,编译才能成功。 6 | -------------------------------------------------------------------------------- /pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: 这是预编译标头文件。 2 | // 下方列出的文件仅编译一次,提高了将来生成的生成性能。 3 | // 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 4 | // 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 5 | // 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // 添加要在此处预编译的标头 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /socketMain.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhuzhu-Top/Wx_Socket_Helper/8c3c1fee6b12004419bc2bdc06a55b8b944942c9/socketMain.cpp -------------------------------------------------------------------------------- /socketMain.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void Start_Socket(); 4 | -------------------------------------------------------------------------------- /wxid_Get_Info.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "pch.h" 3 | 4 | --------------------------------------------------------------------------------