Showing preview only (281K chars total). Download the full file or copy to clipboard to get everything.
Repository: TonyChen56/WeChatRobot
Branch: master
Commit: 45e4b1b49856
Files: 108
Total size: 258.0 KB
Directory structure:
gitextract_n0tizw0f/
├── CLAUDE.md
├── README.md
├── README_DETAILS.md
├── WeChat 3.2.1.154安装包下载.txt
├── WeChatHelper/
│ ├── CAutoFunction.cpp
│ ├── CAutoFunction.h
│ ├── CPublic.cpp
│ ├── CPublic.h
│ ├── ChatRecord.cpp
│ ├── ChatRecord.h
│ ├── ChatRoomOperate.cpp
│ ├── ChatRoomOperate.h
│ ├── FriendList.cpp
│ ├── FriendList.h
│ ├── Function.cpp
│ ├── Function.h
│ ├── InitWeChat.cpp
│ ├── InitWeChat.h
│ ├── Login.cpp
│ ├── Login.h
│ ├── MainWindow.cpp
│ ├── MainWindow.h
│ ├── SelfInformation.cpp
│ ├── SelfInformation.h
│ ├── WeChatHelper.cpp
│ ├── WeChatHelper.vcxproj
│ ├── WeChatHelper.vcxproj.filters
│ ├── WeChatHelper.vcxproj.user
│ ├── WndMsgLoop.cpp
│ ├── WndMsgLoop.h
│ ├── data.h
│ ├── dllmain.cpp
│ ├── message.h
│ ├── offset.h
│ ├── stdafx.cpp
│ ├── stdafx.h
│ └── targetver.h
├── WeChatRobot/
│ ├── CAboutAuthor.cpp
│ ├── CAboutAuthor.h
│ ├── CAddChatRoomMember.cpp
│ ├── CAddChatRoomMember.h
│ ├── CAddUser.cpp
│ ├── CAddUser.h
│ ├── CChatRecords.cpp
│ ├── CChatRecords.h
│ ├── CChatRoomMember.cpp
│ ├── CChatRoomMember.h
│ ├── CCreateChatRoom.cpp
│ ├── CCreateChatRoom.h
│ ├── CDecryptImage.cpp
│ ├── CDecryptImage.h
│ ├── CFollowAccount.cpp
│ ├── CFollowAccount.h
│ ├── CFriendInfo.cpp
│ ├── CFriendInfo.h
│ ├── CFriendList.cpp
│ ├── CFriendList.h
│ ├── CFunctions.cpp
│ ├── CFunctions.h
│ ├── CInformation.cpp
│ ├── CInformation.h
│ ├── CInjectTools.cpp
│ ├── CInjectTools.h
│ ├── CInviteGroupMember.cpp
│ ├── CInviteGroupMember.h
│ ├── CMain.cpp
│ ├── CMain.h
│ ├── CModifyVersion.cpp
│ ├── CModifyVersion.h
│ ├── CMultiOpen.cpp
│ ├── CMultiOpen.h
│ ├── CMyTableCtrl.cpp
│ ├── CMyTableCtrl.h
│ ├── COpenUrl.cpp
│ ├── COpenUrl.h
│ ├── CPay.cpp
│ ├── CPay.h
│ ├── CRoomAnnouncement.cpp
│ ├── CRoomAnnouncement.h
│ ├── CSendChatRoomAt.cpp
│ ├── CSendChatRoomAt.h
│ ├── CSendMsg.cpp
│ ├── CSendMsg.h
│ ├── CSendXmlAricle.cpp
│ ├── CSendXmlAricle.h
│ ├── CSendXmlCard.cpp
│ ├── CSendXmlCard.h
│ ├── CSetRemark.cpp
│ ├── CSetRemark.h
│ ├── CSetRoomName.cpp
│ ├── CSetRoomName.h
│ ├── WeChatRobot.aps
│ ├── WeChatRobot.cpp
│ ├── WeChatRobot.h
│ ├── WeChatRobot.rc
│ ├── WeChatRobot.vcxproj
│ ├── WeChatRobot.vcxproj.filters
│ ├── WeChatRobot.vcxproj.user
│ ├── WeChatRobotDlg.cpp
│ ├── WeChatRobotDlg.h
│ ├── data.h
│ ├── message.h
│ ├── res/
│ │ └── WeChatRobot.rc2
│ ├── resource.h
│ ├── stdafx.cpp
│ ├── stdafx.h
│ └── targetver.h
└── WeChatRobot.sln
================================================
FILE CONTENTS
================================================
================================================
FILE: CLAUDE.md
================================================
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
**WeChatRobot** is a PC WeChat automation tool consisting of two components:
1. **WeChatRobot.exe** - MFC-based GUI client application that provides the user interface
2. **WeChatHelper.dll** - DLL injected into WeChat process to hook WeChat functions and perform operations
The project uses **WM_COPYDATA** for inter-process communication between the client and the injected DLL.
⚠️ **Important Notice**: This project is a legacy WeChat hooking tool and has not been maintained for a long time. It is provided for learning purposes only and targets a specific old version of WeChat (2.6.8.52).
## Build System
### Requirements
- **Visual Studio 2017** (VS 141 toolset) with C++ desktop development workload
- Windows SDK version 10.0.17763.0
- MFC (statically linked in Win32, dynamically linked in x64)
- OpenSSL 1.0.2l-win32-msvc100 (for WeChatRobot Debug Win32 build)
### Build Configurations
The solution supports two platforms and two configurations:
**Platforms:**
- Win32 (x86)
- x64
**Configurations:**
- Debug
- Release
### Build Commands
Open `WeChatRobot.sln` in Visual Studio 2017 and build using:
```bash
# Build entire solution
msbuild WeChatRobot.sln /p:Configuration=Release /p:Platform=x64
# Build specific project
msbuild WeChatRobot\WeChatRobot.vcxproj /p:Configuration=Release /p:Platform=x64
msbuild WeChatHelper\WeChatHelper.vcxproj /p:Configuration=Release /p:Platform=x64
# Clean build
msbuild WeChatRobot.sln /t:Clean /p:Configuration=Release
```
**Build Outputs:**
- `WeChatRobot.exe` → Release/
- `WeChatHelper.dll` → Release/
## Architecture
### Project Structure
```
WeChatRobot/
├── WeChatRobot/ # MFC GUI Client Application
│ ├── *.cpp/*.h # Dialog implementations for each feature
│ ├── data.h # Client-side data structures
│ ├── message.h # Message definitions
│ ├── WeChatRobot.vcxproj # Client project file
│ └── WeChatRobot.rc # MFC resource file
│
├── WeChatHelper/ # DLL Injected into WeChat
│ ├── *.cpp/*.h # Hook implementations
│ ├── data.h # Server-side data structures
│ ├── offset.h # WeChat function offsets/addresses
│ ├── message.h # Message structures
│ └── WeChatHelper.vcxproj # DLL project file
│
├── assets/ # Documentation images
├── Release/ # Build outputs
└── WeChatRobot.sln # Visual Studio solution
```
### Component Communication
**WeChatRobot (Client):**
- MFC dialog-based application
- Provides GUI for all operations
- Sends commands to WeChatHelper via WM_COPYDATA
- Receives data back from WeChatHelper
- Handles user interactions and displays results
**WeChatHelper (Server/DLL):**
- Injected into WeChat process via `CInjectTools`
- Hooks WeChat functions using addresses defined in `offset.h`
- Intercepts messages, handles, and operations
- Communicates back to WeChatRobot via WM_COPYDATA
### Key Data Structures
**Communication Structures** (defined in both `data.h` files):
- `MessageStruct` - Generic communication messages
- `ChatMessageData` - Chat message data (type, source, sender, content)
- `PersonalInformation` - WeChat user profile information
- `UserInfo` / `UserInfoDetail` - Friend/group member information
- `XmlCardMessage` - WeChat card messages
- `AtMsg` - @ message in groups
- `SendXmlArticleStruct` - XML article messages
**Message Types** are handled via the message structures in `message.h`.
### Core Offset Addresses
The `WeChatHelper/offset.h` file contains hardcoded offsets for WeChat 2.6.8.52:
- Function hooks: `WxSendMessage`, `WxReciveMessage`, `WxFriendList`, etc.
- Data offsets: `MsgContentOffset`, `MsgSourceOffset`, `WxidOffset`, etc.
- Self info base: `WxSelfInfoBase` with various member offsets
⚠️ These offsets are version-specific and will not work with newer WeChat versions.
## Development Workflow
### Adding New Features
1. **In WeChatRobot (Client):**
- Create new dialog class (e.g., `CNewFeature.cpp/h`)
- Add to resource file (`WeChatRobot.rc`)
- Implement UI and command handling
- Send WM_COPYDATA messages to WeChatHelper
2. **In WeChatHelper (Server):**
- Implement hook/operation logic
- Handle WM_COPYDATA messages
- Use offsets from `offset.h` for hooking
### Inter-Process Communication
**Sending from WeChatRobot:**
```cpp
COPYDATASTRUCT cds;
cds.dwData = COMMAND_TYPE;
cds.cbData = sizeof(DataStruct);
cds.lpData = &dataStruct;
// Send to WeChatHelper window
::SendMessage(helperWindowHWND, WM_COPYDATA, (WPARAM)this->m_hWnd, (LPARAM)&cds);
```
**Receiving in WeChatHelper:**
```cpp
BOOL CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_COPYDATA)
{
COPYDATASTRUCT* pCopyData = (COPYDATASTRUCT*)lParam;
// Process command based on pCopyData->dwData
}
}
```
### Testing
1. Start WeChat (version 2.6.8.52)
2. Copy `WeChatRobot.exe` and `WeChatHelper.dll` to same directory
3. Run `WeChatRobot.exe`
4. Click "注入" to inject DLL into WeChat process
5. Test features through the GUI
## Technical Notes
### Dependency Injection
The `CInjectTools` class handles DLL injection into WeChat process. It locates the WeChat window and uses Windows API to inject `WeChatHelper.dll`.
### Hooking Mechanism
WeChatHelper uses function hooking to intercept WeChat operations:
- Calculates actual function addresses using base address + offset
- Hooks functions by replacing prologue with jump instructions
- Intercepts messages before they're processed by WeChat
### Message Handling
All chat messages are intercepted and parsed. The system extracts:
- Message type (text, image, file, etc.)
- Sender information
- Message content
- Source (group or individual chat)
### Known Limitations
- **Version锁定**: Only works with WeChat 2.6.8.52
- **Architecture依赖**: Uses hardcoded offsets that change between versions
- **稳定性**: 多年未维护,可能存在兼容性问题
- **仅供学习**: 不应用于生产环境或商业用途
## Security Considerations
⚠️ **Warning**: This project involves:
- DLL injection into another process
- Function hooking and code interception
- Reverse engineering of proprietary software
Use only for educational purposes in controlled environments. Do not use for:
- Violating WeChat's terms of service
- Unauthorized automation or spam
- Commercial applications
- Any illegal activities
## Documentation and Resources
- **README.md** - Project overview and feature list with screenshots
- **assets/** - Screenshots and documentation images
- **CSDN Blog Posts** (referenced in README):
- PC微信逆向:HOOK拦截二维码
- PC微信逆向:发送与接收消息分析
- PC微信逆向:数据库文件解密
## Common Tasks
### Building for Production
Use Release configuration with static MFC linking for standalone executables:
- Win32 Release: Static MFC linking
- x64 Release: Dynamic MFC linking with Whole Program Optimization
### Debugging
Use Debug configuration to troubleshoot issues:
- Debug information enabled
- Runtime checks enabled
- Multi-threaded debug runtime library
### Adding New Message Types
1. Define struct in both `WeChatRobot/data.h` and `WeChatHelper/data.h`
2. Add to `MessageUnion` in WeChatHelper's data.h
3. Implement handler in both projects
4. Update WM_COPYDATA command types
### Modifying Offsets
When WeChat updates, new offsets must be found using:
- Debugger (x64dbg/OllyDbg)
- Disassembler (IDA Pro)
- Memory scanning tools
Process:
1. Attach debugger to WeChat
2. Locate target function
3. Find data structure offsets
4. Update `offset.h`
5. Rebuild and test
## Legal and Ethical Use
**This project is provided "as is" for educational purposes only.**
- Use only on your own systems
- Do not violate WeChat's terms of service
- Respect user privacy and data protection laws
- Do not use for spam, harassment, or illegal activities
- Authors disclaim all liability for misuse
The author explicitly states this project is not maintained and should be used for learning about Windows programming, MFC, and reverse engineering techniques only.
================================================
FILE: README.md
================================================
# WeChatRobot
> ⚠️ **本项目已停止维护,仅供学习参考**
📖 **完整项目文档请查看:[README_DETAILS.md](README_DETAILS.md)**
---
## 个人动态
微信相关的项目已经不在维护
最近**全职在做海外SaaS产品**,目前已经实现**月入千刀**,正在向**月入万刀**的目标前进!
**如果你也对此有兴趣,欢迎关注我的社媒**
**如果你也在做同样的事情,欢迎在推特私信和我交流**
## 推特 @guishou_56

### 公众号 Niko的出海记录

## 即刻 Niko_

---
## 鬼手社交小课堂
技术大哥们,加我之前请务必学习一下我的什么叫有效社交和无效社交
### 无效社交

上来直接躺尸,不懂商业互吹,不懂提供价值=无效社交;”看看有没有合作机会“,中译中,“看看有没有白嫖的机会”
从github加过来的,我没见过一个会主动夸人的;加之前想清楚能给我提供什么价值,提供不了请不要加好友,我还得删,挺累的
我本来不想说的这么直接,但是没办法,搞技术的情商实在太低了,搞的我烦不胜烦,不直接不行!
## 有效社交

有效社交=上来肯定对方+商业互吹+自我介绍+提供价值
================================================
FILE: README_DETAILS.md
================================================
# 项目详细信息
## 实现功能

## 项目介绍
编译环境为VS2017 只支持微信2.6.8.52版本。附上2.6.8.52微信版本的安装包
链接:https://pan.baidu.com/s/1kZTBDPHNSSbyC1tVP-Lj8g
提取码:d9oj


项目分为两个端,WeChatRobot和WeChatHelper。WeChatRobot作为客户端负责和服务端进行通信,将服务端传回的数据显示到界面。WeChatHelper作为服务端,注入到微信进程,进行取数据和HOOK的相关操作,并且将取回的数据发回给客户端。
客户端和服务端之间采用WM_COPYDATA的方式进行进程通讯,互相传输数据
## 效果演示
下面演示部分效果
### 初始化
将WeChatRobot.exe和WeChatHelper.dll放在同一个目录下,先打开微信,再打开exe

### 截取二维码

点击显示二维码 微信会自动跳转并截取二维码显示到客户端,再次点击可以刷新二维码
### 检测微信登陆状态&显示所有联系人

这里由于WM_COPYDATA通信状态下是阻塞的原因 所以联系人多的话可能会有些卡顿
### 发送文本 图片 和文件消息

### 添加&删除好友

### 接收并显示所有类型消息

### 无限多开

### 解密数据库

### 自动聊天

### 自动收款

### 自动提取微信表情
微信的表情加密存放在下面的目录
``C:\Users\GuiShou\Documents\WeChat Files\crt873217126\FileStorage\CustomEmotion``

这个功能会将所有的未加密的表情存放到Temp目录下的WeChatExpressions文件夹里
还有很多效果,就不一一录制演示Gif了
## 技术细节
PCXX逆向:使用HOOK拦截二维码:https://blog.csdn.net/qq_38474570/article/details/92798577
PCXX逆向:发送与接收消息的分析与代码实现:https://blog.csdn.net/qq_38474570/article/details/93339861
PC微信逆向:两种姿势教你解密数据库文件:https://blog.csdn.net/qq_38474570/article/details/96606530
## 声明
**本项目仅供技术研究,请勿用于任何商业用途,请勿用于非法用途,如有任何人凭此做何非法事情,均于作者无关,特此声明。**
================================================
FILE: WeChat 3.2.1.154安装包下载.txt
================================================
链接:https://pan.baidu.com/s/1Eqmwo3vt-RRh4rVxCM5v8g
提取码:1x09
--来自百度网盘超级会员V6的分享
================================================
FILE: WeChatHelper/CAutoFunction.cpp
================================================
#include "stdafx.h"
#include "CAutoFunction.h"
#include "Function.h"
#include <atlconv.h>
#include <direct.h> //_mkdirͷļ
#include <io.h> //_accessͷļ
#include <iostream>
#include <cstdio>
#include <ctime>
#include "ChatRecord.h"
#include <Shlobj.h>
#include <Shlwapi.h>
#include <atlconv.h>
#include <wininet.h>
#pragma comment(lib,"Shlwapi.lib")
#pragma comment(lib,"Wininet.lib")
//------------------------------------------------------------------------------------------------
BYTE bjmpcode[5] = { 0 };
DWORD dwReternAddress = (DWORD)GetModuleHandle(L"WeChatWin.dll") + WxGetExpressionsAddr + 5; //صַ
DWORD dwCallAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll") + WxGetExpressionsCallAddr;
//************************************************************
// : AgreeUserRequest
// ˵: ͬ
// : GuiShou
// ʱ : 2019/7/17
// : v1 v2
// ֵ: void
//************************************************************
void AgreeUserRequest(wchar_t* v1, wchar_t* v2)
{
DWORD base = GetWeChatWinBase();
DWORD callAdd1 = base + WxAgreeUserRequestCall1;
DWORD callAdd2 = base + WxAgreeUserRequestCall2;
DWORD callAdd3 = base + WxAgreeUserRequestCall3;
DWORD callAdd4 = base + WxAgreeUserRequestCall4;
DWORD params = base + WxAgreeUserRequestParam;
DWORD* asmP = (DWORD*)params;
v1Info userInfoV1 = { 0 };
v2Info userInfoV2 = { 0 };
userInfoV1.v2 = (DWORD)&userInfoV2.fill;
userInfoV1.v1 = v1;
userInfoV1.v1Len = wcslen(v1);
userInfoV1.maxV1Len = wcslen(v1) * 2;
userInfoV2.v2 = v2;
userInfoV2.v2Len = wcslen(v2);
userInfoV2.maxV2Len = wcslen(v2) * 2;
char* asmUser = (char*)&userInfoV1.fill;
char buff[0x14] = { 0 };
char buff2[0x48] = { 0 };
char* asmBuff = buff2;
__asm
{
mov ecx, asmUser;
push 0x11;
sub esp, 0x14;
push esp;
call callAdd1;
mov ecx, asmUser;
lea eax, buff;
push eax;
call callAdd2;
mov esi, eax;
sub esp, 0x8;
mov ecx, asmP;
call callAdd3;
mov ecx, asmBuff;
mov edx, ecx;
push edx;
push eax;
push esi;
call callAdd4;
}
}
//************************************************************
// : AutoAgreeUserRequest
// ˵: Զͬ
// : GuiShou
// ʱ : 2019/7/17
// : msg Ϣ
// ֵ: void
//************************************************************
void AutoAgreeUserRequest(wstring msg)
{
int v1strat = msg.find(L"v3_");
int v1end = msg.find(L"@stranger");
wstring v1;
v1 = msg.substr(v1strat, v1end - v1strat + 9);
//ҵv2
int v2strat = msg.find(L"v4_");
int v2end = msg.rfind(L"@stranger");
wstring v2;
v2 = msg.substr(v2strat, v2end - v2strat + 9);
//ͬcall
AgreeUserRequest((wchar_t*)v1.c_str(), (wchar_t*)v2.c_str());
}
//************************************************************
// : CllectMoney
// ˵: տ
// : GuiShou
// ʱ : 2019/7/15
// : transferid תID wxid ID
// ֵ: void
//************************************************************
void CllectMoney(wchar_t* transferid, wchar_t* wxid)
{
CllectMoneyStruct cllect;
cllect.ptransferid = transferid;
cllect.transferidLen = wcslen(transferid) + 1;
cllect.transferidMaxLen = (wcslen(transferid) + 1) * 2;
cllect.pwxid = wxid;
cllect.wxidLen = wcslen(wxid) + 1;
cllect.wxidMaxLen = (wcslen(wxid) + 1) * 2;
char* asmBuff = (char*)&cllect.ptransferid;
DWORD dwWeChatWinAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll");
DWORD dwCall1 = dwWeChatWinAddr + WxCllectMoneyCall1;
DWORD dwCall2 = dwWeChatWinAddr + WxCllectMoneyCall2;
__asm
{
sub esp, 0x30;
mov ecx, esp;
mov eax, asmBuff;
push eax;
call dwCall1;
call dwCall2;
add esp, 0x30;
}
}
//************************************************************
// : AutoCllectMoney
// ˵: Զտ
// : GuiShou
// ʱ : 2019/7/17
// : msg Ϣ
// ֵ: void
//************************************************************
void AutoCllectMoney(wstring msg,wchar_t* wxid)
{
// ҵ<transferid>ַλ
int pos1 = msg.find(L"<transferid>");
//ҵ]]></transferid>ַλ
int pos2 = msg.find(L"]]></transferid>");
//ȡַ
wstring noneed = L"<transferid><![CDATA[";
int noneedLen = noneed.length();
//ȡתID
wstring transferid;
transferid = msg.substr(pos1 + noneedLen, (pos2 - pos1) - noneedLen);
//տcall ʵԶտ
CllectMoney((wchar_t*)transferid.c_str(), wxid);
}
//************************************************************
// : AddCardUser
// ˵: Ƭ
// : GuiShou
// ʱ : 2019/7/18
// : v1 msg Ϣ
// ֵ: void
//************************************************************
void AddCardUser(wchar_t* v1, wchar_t* msg)
{
DWORD dwWeChatWinAddr = GetWeChatWinBase();
DWORD dwParam1 = dwWeChatWinAddr + WxAddWxUserParam1;
DWORD dwCall1 = dwWeChatWinAddr + WxAddWxUserCall1;
DWORD dwCall2 = dwWeChatWinAddr + WxAddWxUserCall2;
DWORD dwCall3 = dwWeChatWinAddr + WxAddWxUserCall3;
DWORD dwCall4 = dwWeChatWinAddr + WxAddWxUserCall4;
DWORD dwCall5 = dwWeChatWinAddr + WxAddWxUserCall5;
GeneralStruct pV1(v1);
char* asmV1 = (char*)&pV1.pstr;
char buff3[0x100] = { 0 };
char* buff = buff3;
__asm
{
sub esp, 0x18;
mov ecx, esp;
push dwParam1;
call dwCall1;
sub esp, 0x18;
mov eax, buff;
mov ecx, esp;
push eax;
call dwCall2;
push 0x11;
sub esp, 0x14;
mov ecx, esp;
push - 0x1;
mov edi, msg;
push edi;
call dwCall3;
push 0x2;
sub esp, 0x14;
mov ecx, esp;
mov ebx, asmV1;
push ebx;
call dwCall4;
mov ecx, eax;
call dwCall5;
}
}
//************************************************************
// : AutoAddCardUser
// ˵: ԶƬ
// : GuiShou
// ʱ : 2019/7/18
// : msg Ϣ
// ֵ: void
//************************************************************
void AutoAddCardUser(wstring msg)
{
//õV1
int v1strat = msg.find(L"v1_");
int v1end = msg.find(L"@stranger");
wstring v1;
v1 = msg.substr(v1strat, v1end - v1strat + 9);
//ƬѺ
AddCardUser((wchar_t*)v1.c_str(), (wchar_t*)L"ͨ~ͨ~ ");
}
//************************************************************
// : HookExtractExpression
// ˵: HOOKȡCall
// : GuiShou
// ʱ : 2019/7/21
// : void
// ֵ: void
//************************************************************
void HookExtractExpression()
{
HookAnyAddress(GetWeChatWinBase() + WxGetExpressionsAddr, ExtractExpression);
}
//************************************************************
// : ExtractExpression
// ˵: ȡ
// : GuiShou
// ʱ : 2019/7/21
// : void
// ֵ: void
//************************************************************
void __declspec(naked) ExtractExpression()
{
__asm
{
pushad;
push eax;
call OutputExpression;
popad;
//ָǵĴ
call dwCallAddr;
//طصַ
jmp dwReternAddress;
}
}
//************************************************************
// : OutputExpression
// ˵:
// : GuiShou
// ʱ : 2019/7/21
// : dwExpressionAddr ַ
// ֵ: void
//************************************************************
void __stdcall OutputExpression(DWORD dwExpressionAddr)
{
//ȡͼƬ
DWORD dwImageLen = *((DWORD*)(dwExpressionAddr + 4));
//ȡͼƬ
DWORD dwImage = *((DWORD*)(dwExpressionAddr));
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);
}
//************************************************************
// : CreateFileWithCurrentTime
// ˵: ݵǰʱ䴴ļ
// : GuiShou
// ʱ : 2019/9/24
// : filedir ļĿ¼ filepostfixļ filedata ļʼַ filedatalenļ
// ֵ: void
//************************************************************
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);
}
//************************************************************
// : CreateDir
// ˵: Ŀ¼
// : GuiShou
// ʱ : 2019/7/21
// : dir Ŀ¼
// ֵ: void
//************************************************************
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)
{
_mkdir(str2.c_str()); //Ŀ¼
}
str1 = str1.substr(m + 1, str1.size());
}
}
//************************************************************
// : GetXmlContent
// ˵: ȡҪXML
// : GuiShou
// ʱ : 2019/11/15
// : fullxmlcontent XML str1 ҪȡXMLߵַ str2 ҪȡXMLұߵַ
// ֵ: wstring ҪȡXML
//************************************************************
wstring GetXmlContent(wstring fullxmlcontent, wstring str1, wstring str2)
{
wstring targetstring;
// ҵ<title>ַλ
int pos1 = fullxmlcontent.find(str1);
//ҵ</title>ַλ
int pos2 = fullxmlcontent.find(str2);
if (pos1==wstring::npos|| pos2== wstring::npos)
{
return L"NULL";
}
//ȡַ
wstring noneedString1 = str1;
int noneedLen1 = noneedString1.length();
targetstring = fullxmlcontent.substr(pos1 + noneedLen1, pos2 - pos1 - noneedLen1);
return targetstring;
}
================================================
FILE: WeChatHelper/CAutoFunction.h
================================================
#pragma once
#include <atlstr.h>
void AgreeUserRequest(wchar_t* v1, wchar_t* v2); //ͬ
void AutoAgreeUserRequest(wstring msg); //Զͬ
void CllectMoney(wchar_t* transferid, wchar_t* wxid); //տ
void AutoCllectMoney(wstring msg, wchar_t* wxid); //Զտ
void AddCardUser(wchar_t* v1, wchar_t* msg); //Ƭ
void AutoAddCardUser(wstring msg); //ԶƬ
void CreateDir(const char *dir); //Ŀ¼
void ExtractExpression(); //ȡ
void HookExtractExpression();//HOOKȡ
void __stdcall OutputExpression(DWORD dwExpressionAddr); //
void CreateFileWithCurrentTime(char* filedir, char* filepostfix, DWORD filedata, DWORD filedatalen); //õǰʱ䴴ļ
wstring GetXmlContent(wstring fullxmlcontent, wstring str1, wstring str2); //ȡҪXML
================================================
FILE: WeChatHelper/CPublic.cpp
================================================
#include "stdafx.h"
#include "CPublic.h"
//************************************************************
// : HookAnyAddress
// ˵: Hookַ
// : GuiShou
// ʱ : 2019/11/13
// : dwHookAddr ҪHOOKĵַ dwJmpAddressתĵַ dwBackAddress صĵַ
// ֵ: void
//************************************************************
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress)
{
//װת
BYTE jmpCode[5] = { 0 };
jmpCode[0] = 0xE9;
//ƫ
*(DWORD*)& jmpCode[1] = (DWORD)dwJmpAddress - dwHookAddr - 5;
// ǰڻԭ
DWORD OldProtext = 0;
// ΪҪдݣΪDzдģҪ
VirtualProtect((LPVOID)dwHookAddr, 5, PAGE_EXECUTE_READWRITE, &OldProtext);
//дԼĴ
memcpy((void*)dwHookAddr, jmpCode, 5);
// ִ˲֮Ҫлԭ
VirtualProtect((LPVOID)dwHookAddr, 5, OldProtext, &OldProtext);
}
//************************************************************
// : GetWeChatWinBase
// ˵: ȡWeChatWinַ
// : GuiShou
// ʱ : 2019/11/13
// : void
// ֵ: void
//************************************************************
DWORD GetWeChatWinBase()
{
return (DWORD)GetModuleHandle(TEXT("WeChatWin.dll"));
}
//************************************************************
// : UTF8ToUnicode
// ˵: UTF8תΪUnicode(ĬϱΪUTF8)
// : GuiShou
// ʱ : 2019/7/7
// : str Ҫתַ
// ֵ: wchar_t صַ
//************************************************************
wchar_t * UTF8ToUnicode(const char* str)
{
int textlen = 0;
wchar_t * result;
textlen = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
result = (wchar_t *)malloc((textlen + 1) * sizeof(wchar_t));
memset(result, 0, (textlen + 1) * sizeof(wchar_t));
MultiByteToWideChar(CP_UTF8, 0, str, -1, (LPWSTR)result, textlen);
return result;
}
wstring UTF8ToUnicode2(const char* str)
{
int textlen = 0;
wchar_t* result;
textlen = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0);
result = (wchar_t *)malloc((textlen + 1) * sizeof(wchar_t));
memset(result, 0, (textlen + 1) * sizeof(wchar_t));
MultiByteToWideChar(CP_UTF8, 0, str, -1, (LPWSTR)result, textlen);
wstring tempstr(result);
free(result);
result = NULL;
return tempstr;
}
void DebugCode(LPVOID pAddress)
{
char buff[40] = { 0 };
sprintf_s(buff, "%p", pAddress);
MessageBoxA(0, buff, "ַ", 0);
}
================================================
FILE: WeChatHelper/CPublic.h
================================================
#pragma once
#include <string>
using namespace std;
void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress); //HOOKַ
DWORD GetWeChatWinBase(); //ȡWeChatWinַ
wchar_t * UTF8ToUnicode(const char* str);
wstring UTF8ToUnicode2(const char* str);
void DebugCode(LPVOID pAddress);
================================================
FILE: WeChatHelper/ChatRecord.cpp
================================================
#include "stdafx.h"
#include <string>
#include <Shlwapi.h>
#pragma comment(lib,"Shlwapi.lib")
#include "ChatRecord.h"
#include "FriendList.h"
#include "CAutoFunction.h"
#include "Function.h"
#include <stdio.h>
#include <WINSOCK2.H>
#pragma comment(lib,"ws2_32.lib")
using namespace std;
#define SERVER_ADDRESS "127.0.0.1" //IPַ
#define PORT 8080 //Ķ˿ں
#define MSGSIZE 1024 //շĴС
BOOL g_AutoChat = FALSE; //ǷԶ
BOOL isSendTuLing = FALSE; //ǷѾ˻
wchar_t tempwxid[50]; //ID
//صַ
DWORD RetkReciveMsgAddr = GetWeChatWinBase() + WxReciveMessage + 5;
//ǵcallĵַ
DWORD OverReciveMsgCallAddr = GetWeChatWinBase() + WxReciveMessageCall;
//************************************************************
// : HookChatRecord
// ˵: HOOK¼
// : GuiShou
// ʱ : 2019/7/6
// : void
// ֵ: void
//************************************************************
void HookChatRecord()
{
HookAnyAddress(GetWeChatWinBase() + WxReciveMessage, RecieveWxMesage);
}
//************************************************************
// : RecieveMesage
// ˵: Ϣ
// : GuiShou
// ʱ : 2019/7/6
// : void
// ֵ: void
//************************************************************
__declspec(naked) void RecieveWxMesage()
{
//ֳ
__asm
{
pushad;
push eax;
call SendWxMessage;
popad;
//ñǵcall
call OverReciveMsgCallAddr;
//תصַ
jmp RetkReciveMsgAddr;
}
}
//************************************************************
// : ReceiveMsgProc
// ˵: Ϣ̻߳ص
// : GuiShou
// ʱ : 2019/11/8
// : Context
// ֵ: void
//************************************************************
void DealWithMsg(LPVOID Context)
{
try
{
ChatMessageData* msg = (ChatMessageData*)Context;
BOOL isFriendMsg = FALSE; //ǷǺϢ
BOOL isImageMessage = FALSE; //ǷͼƬϢ
BOOL isRadioMessage = FALSE; //ǷƵϢ
BOOL isVoiceMessage = FALSE; //ǷϢ
BOOL isBusinessCardMessage = FALSE; //ǷƬϢ
BOOL isExpressionMessage = FALSE; //ǷƬϢ
BOOL isLocationMessage = FALSE; //ǷλϢ
BOOL isSystemMessage = FALSE; //ǷϵͳϢ
BOOL isPos_File_Money_XmlLink = FALSE; //Ƿλ ļ ת˺Ϣ
BOOL isFriendRequestMessage = FALSE; //ǷǺϢ
BOOL isOther = FALSE; //ǷϢ
switch (msg->dwtype)
{
case 0x01:
memcpy(msg->sztype, L"", sizeof(L""));
break;
case 0x03:
memcpy(msg->sztype, L"ͼƬ", sizeof(L"ͼƬ"));
isImageMessage = TRUE;
break;
case 0x22:
memcpy(msg->sztype, L"", sizeof(L""));
isVoiceMessage = TRUE;
break;
case 0x25:
memcpy(msg->sztype, L"ȷ", sizeof(L"ȷ"));
isFriendRequestMessage = TRUE;
break;
case 0x28:
memcpy(msg->sztype, L"POSSIBLEFRIEND_MSG", sizeof(L"POSSIBLEFRIEND_MSG"));
isOther = TRUE;
break;
case 0x2A:
memcpy(msg->sztype, L"Ƭ", sizeof(L"Ƭ"));
isBusinessCardMessage = TRUE;
break;
case 0x2B:
memcpy(msg->sztype, L"Ƶ", sizeof(L"Ƶ"));
isRadioMessage = TRUE;
break;
case 0x2F:
//ʯͷ
memcpy(msg->sztype, L"", sizeof(L""));
isExpressionMessage = TRUE;
break;
case 0x30:
memcpy(msg->sztype, L"λ", sizeof(L"λ"));
isLocationMessage = TRUE;
break;
case 0x31:
//ʵʱλ
//ļ
//ת
//
//տ
memcpy(msg->sztype, L"ʵʱλáļתˡ", sizeof(L"ʵʱλáļתˡ"));
isPos_File_Money_XmlLink = TRUE;
break;
case 0x32:
memcpy(msg->sztype, L"VOIPMSG", sizeof(L"VOIPMSG"));
isOther = TRUE;
break;
case 0x33:
memcpy(msg->sztype, L"ųʼ", sizeof(L"ųʼ"));
isOther = TRUE;
break;
case 0x34:
memcpy(msg->sztype, L"VOIPNOTIFY", sizeof(L"VOIPNOTIFY"));
isOther = TRUE;
break;
case 0x35:
memcpy(msg->sztype, L"VOIPINVITE", sizeof(L"VOIPINVITE"));
isOther = TRUE;
break;
case 0x3E:
memcpy(msg->sztype, L"СƵ", sizeof(L"СƵ"));
isRadioMessage = TRUE;
break;
case 0x270F:
memcpy(msg->sztype, L"SYSNOTICE", sizeof(L"SYSNOTICE"));
isOther = TRUE;
break;
case 0x2710:
//ϵͳϢ
//
memcpy(msg->sztype, L"ϵͳϢ", sizeof(L"ϵͳϢ"));
isSystemMessage = TRUE;
break;
case 0x2712:
//Ϣ
memcpy(msg->sztype, L"Ϣ", sizeof(L"Ϣ"));
break;
default:
break;
}
wstring fullmessgaedata(msg->content); //Ϣ
wchar_t* tempcontent = msg->content; //Ϣ
//IDжǷǺϢ
wstring wxid_wstr = msg->wxid;
if (wxid_wstr.find(L"@im.chatroom") != wxid_wstr.npos)
{
memcpy(msg->source, L"ҵȺϢ", sizeof(L"ҵȺϢ"));
}
else if (wxid_wstr.find(L"@chatroom") != wxid_wstr.npos)
{
memcpy(msg->source, L"ȺϢ", sizeof(L"ȺϢ"));
}
else
{
memcpy(msg->source, L"Ϣ", sizeof(L"Ϣ"));
isFriendMsg = TRUE;
memcpy(msg->sendername, L"NULL", sizeof(L"NULL"));
}
//IDתΪdz/Ⱥ
wstring transformwxid(msg->wxid);
swprintf_s(msg->wxname, L"%s", GetNickNameByWxid(transformwxid).c_str());
//ȺIDתΪdz
if (isFriendMsg == FALSE)
{
//IDȡϸϢ
swprintf_s(msg->sendername, L"%s", GetNicknameByWxid(msg->sender));
}
//ʾϢ ʾϢ ֹ
if (StrStrW(msg->wxid, L"gh"))
{
isFriendMsg = FALSE;
//˷Ϣ ϢѾ
if ((StrCmpW(msg->wxid, ChatRobotWxID) == 0) && isSendTuLing)
{
SendTextMessage(tempwxid, msg->content);
isSendTuLing = FALSE;
}
//IDΪgh_3dfda90e39d6 ˵տϢ
else if ((StrCmpW(msg->wxid, L"gh_3dfda90e39d6") == 0))
{
swprintf_s(msg->content, L"%s", L"տ");
}
else
{
//IDдgh ˵ǹں
swprintf_s(msg->content, L"%s", L"ںŷ,ֻϲ鿴");
}
}
//ͼƬϢ
else if (isImageMessage == TRUE)
{
swprintf_s(msg->content, L"%s", L"յͼƬϢ");
}
else if (isRadioMessage == TRUE)
{
swprintf_s(msg->content, L"%s", L"յƵϢ,ֻϲ鿴");
}
else if (isVoiceMessage == TRUE)
{
swprintf_s(msg->content, L"%s", L"յϢ,ֻϲ鿴");
}
else if (isBusinessCardMessage == TRUE)
{
//ԶƬ
//AutoAddCardUser(fullmessgaedata);
swprintf_s(msg->content, L"%s", L"յƬϢ,ԶӺ");
}
else if (isExpressionMessage == TRUE)
{
swprintf_s(msg->content, L"%s", L"յϢ,ֻϲ鿴");
}
else if (isFriendRequestMessage == TRUE)
{
//Զͨ
AutoAgreeUserRequest(fullmessgaedata);
swprintf_s(msg->content, L"%s", L"յ,Զͨ");
}
//XMLºԶתϢ
else if (isPos_File_Money_XmlLink == TRUE)
{
//жǷתϢ
//жǷתϢ
if (StrStrW(tempcontent, L"<type>2000</type>"))
{
//Զտ
memcpy(msg->sztype, L"תϢ", sizeof(L"תϢ"));
AutoCllectMoney(fullmessgaedata, msg->wxid);
swprintf_s(msg->content, L"%s", L"յתϢ,Զտ");
}
//<type>5 </type> XMLºͽȺ
else if (StrStrW(tempcontent, L"<type>5</type>"))
{
//Ⱥ
if (fullmessgaedata.find(L"<![CDATA[Ⱥ]]></title>") != wstring::npos&&fullmessgaedata.find(L"<url><![CDATA[") != wstring::npos)
{
memcpy(msg->sztype, L"Ⱥ", sizeof(L"Ⱥ"));
swprintf_s(msg->content, L"%s", L"յȺ,ֻϲ鿴");
}
//ѡ֪ͨ
else if (fullmessgaedata.find(L"ѡ֪ͨ") != wstring::npos)
{
memcpy(msg->sztype, L"ѡ", sizeof(L"ѡ"));
swprintf_s(msg->content, L"%s", L"ںѡ֪ͨ,ֻϲ鿴");
}
else
{
// ˵XML
memcpy(msg->sztype, L"XMLϢ", sizeof(L"XMLϢ"));
swprintf_s(msg->content, L"%s", L"յXMLϢ,ֻϲ鿴");
}
}
//ļϢ
else if (StrStrW(tempcontent, L"<type>6</type>"))
{
memcpy(msg->sztype, L"ļϢ", sizeof(L"ļϢ"));
swprintf_s(msg->content, L"%s", L"յļ 뼰ʱ鿴");
}
//ʵʱλϢ
else if (StrStrW(tempcontent, L"<type>17</type>"))
{
memcpy(msg->sztype, L"ʵʱλ", sizeof(L"ʵʱλ"));
swprintf_s(msg->content, L"%s", L"յʵʱλ ֻϲ鿴");
}
//ϲת¼
else if (StrStrW(tempcontent, L"¼</title>"))
{
memcpy(msg->sztype, L"¼Ϣ", sizeof(L"¼Ϣ"));
swprintf_s(msg->content, L"%s", L"յϲת¼ ֻϲ鿴");
}
}
else if (isLocationMessage == TRUE)
{
swprintf_s(msg->content, L"%s", L"յλϢ,ֻϲ鿴");
}
else if (isSystemMessage == TRUE)
{
//ﴦȺϢ
if ((StrStrW(tempcontent, L"ƳȺ") || StrStrW(tempcontent, L"Ⱥ")))
{
wcscpy_s(msg->content, wcslen(tempcontent) + 1, tempcontent);
}
else
{
swprintf_s(msg->content, L"%s", L"յϵͳϢ,ֻϲ鿴");
}
}
//Ϣ֮
else
{
//жϢ ȳͲʾ
if (wcslen(tempcontent) > 200)
{
swprintf_s(msg->content, L"%s", L"Ϣݹ Ѿ");
}
}
//ﴦԶ
if (isFriendMsg == TRUE && g_AutoChat == TRUE && isSendTuLing == FALSE)
{
//һID
wcscpy_s(tempwxid, wcslen(msg->wxid) + 1, msg->wxid);
//õϢ
SendTextMessage((wchar_t*)ChatRobotWxID, msg->content);
isSendTuLing = TRUE;
}
//͵ƶ
HWND hWnd = FindWindow(NULL, TEXT(""));
if (hWnd == NULL)
{
OutputDebugStringA("δҵִ");
return;
}
COPYDATASTRUCT chatmsg;
chatmsg.dwData = WM_ShowChatRecord;//һֵ, ־
chatmsg.cbData = sizeof(ChatMessageData);// strlen(szSendBuf);//͵ݵij
chatmsg.lpData = msg;// szSendBuf;//͵ݵʼַ(ΪNULL)
SendMessage(hWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&chatmsg);
delete msg;
}
catch (...)
{
OutputDebugStringA("¼쳣");
}
}
//************************************************************
// : SendMessage
// ˵: յϢͻ
// : GuiShou
// ʱ : 2019/7/6
// : void
// ֵ: void
//************************************************************
void __stdcall SendWxMessage(DWORD r_eax)
{
if (IsBadReadPtr((void*)r_eax, 4) || IsBadReadPtr((void*)(r_eax + MsgTypeOffset), 4) || IsBadReadPtr((void*)(r_eax + MsgContentOffset), 4) || IsBadReadPtr((void*)(r_eax + WxidOffset), 4) || IsBadReadPtr((void*)(r_eax + GroupMsgSenderOffset), 4))
{
return;
}
try
{
ChatMessageData* msg = new ChatMessageData;
//ȡϢ
msg->dwtype = *((DWORD*)(r_eax + MsgTypeOffset));
//ȡϢ
LPVOID pContent = *((LPVOID *)(r_eax + MsgContentOffset));
swprintf_s(msg->content, L"%s", (wchar_t*)pContent);
//ȡID/ȺID
LPVOID pWxid = *((LPVOID *)(r_eax + WxidOffset));
swprintf_s(msg->wxid, L"%s", (wchar_t*)pWxid);
if (StrStrW(msg->wxid, L"gh_"))
{
return;
}
//ȡϢ
LPVOID pSender = *((LPVOID *)(r_eax + GroupMsgSenderOffset));
swprintf_s(msg->sender, L"%s", (wchar_t*)pSender);
//ȡϢ
LPVOID pSource = *((LPVOID *)(r_eax + MsgSourceOffset));
swprintf_s(msg->source, L"%s", (wchar_t*)pSource);
//̴߳Ϣ
HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)DealWithMsg, msg, 0, NULL);
CloseHandle(hThread);
}
catch (...)
{
OutputDebugStringA("Ϣ쳣....");
}
}
//************************************************************
// : GetMsgByAddress
// ˵: ӵַлȡϢ
// : GuiShou
// ʱ : 2019/7/6
// : DWORD memAddress Ŀַ
// ֵ: LPCWSTR Ϣ
//************************************************************
std::wstring GetMsgByAddress(DWORD memAddress)
{
wstring tmp;
DWORD msgLength = *(DWORD*)(memAddress + 4);
if (msgLength > 0) {
WCHAR* msg = new WCHAR[msgLength + 1]{ 0 };
wmemcpy_s(msg, msgLength + 1, (WCHAR*)(*(DWORD*)memAddress), msgLength + 1);
tmp = msg;
delete[]msg;
}
return tmp;
}
================================================
FILE: WeChatHelper/ChatRecord.h
================================================
#pragma once
#include <string>
void HookChatRecord(); //HOOK¼
void RecieveWxMesage(); //Ϣ
void __stdcall SendWxMessage(DWORD r_eax); //Ϣͻ
std::wstring GetMsgByAddress(DWORD memAddress); //ӵַлȡϢ
================================================
FILE: WeChatHelper/ChatRoomOperate.cpp
================================================
#include "stdafx.h"
#include "ChatRoomOperate.h"
#include <atlconv.h>
//************************************************************
// : SetWxRoomAnnouncement
// ˵: Ⱥ
// : GuiShou
// ʱ : 2019/7/4
// : chartoomwxid ȺID Announcement Ⱥ
// ֵ: void
//************************************************************
void SetWxRoomAnnouncement(wchar_t* chatroomwxid, wchar_t* Announcement)
{
//ȡWeChatWinĻַ
DWORD callAdrress = GetWeChatWinBase()+ WxSetRoomAnnouncement;
//װ
CHAR bufferA[0xD0] = { 0 };
DWORD* bufA = (DWORD*)& bufferA;
CHAR buffer[0xD0] = { 0 };
DWORD* buf = (DWORD*)& buffer;
buf[0] = (DWORD)chatroomwxid;
buf[1] = wcslen(chatroomwxid);
buf[2] = wcslen(chatroomwxid) * 2;
buf[3] = 0;
buf[4] = 0;
buf[0 + 5] = (DWORD)Announcement;
buf[1 + 5] = wcslen(Announcement);
buf[2 + 5] = wcslen(Announcement) * 2;
buf[3 + 5] = 0;
buf[4 + 5] = 0;
bufA[0] = (DWORD)& buffer;
bufA[1] = bufA[0] + 0x60;
bufA[2] = bufA[0] + 0x60;
DWORD r_esp = 0;
__asm
{
//ջĴ
mov r_esp, esp;
lea eax, bufferA;
push eax;
call callAdrress;
//ָջĴ
mov eax, r_esp;
mov esp, eax;
}
}
//************************************************************
// : QuitChatRoom
// ˵: ˳Ⱥ
// : GuiShou
// ʱ : 2019/7/9
// : chartoomwxid ȺID
// ֵ: void
//************************************************************
void QuitChatRoom(wchar_t* chatroomwxid)
{
DWORD dwBaseAddress = GetWeChatWinBase();
DWORD dwCallAddr = dwBaseAddress + WxQuitChatRoom;
//
GeneralStruct structWxid(chatroomwxid);
DWORD* asmMsg = (DWORD*)&structWxid.pstr;
__asm
{
mov ebx, asmMsg;
push ebx;
call dwCallAddr;
}
}
//************************************************************
// : AddGroupMember
// ˵: ȺԱ
// : GuiShou
// ʱ : 2019/7/9
// : chartoomwxid ȺID wxid ID
// ֵ: void
//************************************************************
void AddGroupMember(wchar_t* chatroomwxid, wchar_t* wxid)
{
DWORD dwBase = GetWeChatWinBase();
DWORD dwCallAddr1 = dwBase + WxAddGroupMemberCall1;
DWORD dwCallAddr2 = dwBase + WxAddGroupMemberCall2;
DWORD dwCallAddr3 = dwBase + WxAddGroupMemberCall3;
DWORD dwCallAddr4 = dwBase + WxAddGroupMemberCall4;
DWORD dwParam = dwBase + WxAddGroupMemberParam1;
DWORD dwParam2 = dwBase + WxAddGroupMemberParam2;
//Ҫ
GeneralStruct wxidStruct(wxid);
RoomIdStruct chatroomStruct = { 0 };
chatroomStruct.str = chatroomwxid;
chatroomStruct.strLen = wcslen(chatroomwxid)*2;
chatroomStruct.maxLen = wcslen(chatroomwxid) * 4;
char wxidBuff[0xC] = { 0 };
char tempWxid[0x14] = { 0 };
char tempBuff[0x14] = { 0 };
char* pWxid = (char*)&wxidStruct.pstr;
char* pChatRoom = (char*)&chatroomStruct.fill2;
__asm {
pushad;
lea esi, wxidBuff;
mov ecx, esi;
mov eax, pWxid;
push eax;
call dwCallAddr1;
push 0;
push dwParam;
lea ecx, tempWxid;
call dwCallAddr2;
sub esp, 0x14;
mov ecx, pChatRoom;
mov eax, esp;
push eax;
call dwCallAddr3;
push esi;
mov ecx, dwParam2;
call dwCallAddr4;
popad;
}
}
//************************************************************
// : ShowChatRoomUser
// ˵: ʾȺԱ
// : GuiShou
// ʱ : 2019/7/13
// : void
// ֵ: void
//************************************************************
void ShowChatRoomUser(wchar_t* chatroomwxid)
{
//
DWORD dwWxidArr = 0; //IDݵĵַ
char buff[0x164] = { 0 };
char userListBuff[0x174] = { 0 };
//
GeneralStruct pWxid(chatroomwxid);
char* asmWxid = (char *)&pWxid.pstr;
//call
DWORD dwCall1 = GetWeChatWinBase() + WxGetRoomUserWxidCall1;
DWORD dwCall2 = GetWeChatWinBase() + WxGetRoomUserWxidCall2;
DWORD dwCall3 = GetWeChatWinBase() + WxGetRoomUserWxidCall3;
DWORD dwCall4 = GetWeChatWinBase() + WxGetRoomUserWxidCall4;
//ȡȺԱ
__asm
{
lea ecx, buff[16];
call dwCall1;
lea eax, buff[16];
push eax;
mov ebx, asmWxid;
push ebx;
call dwCall2;
mov ecx, eax;
call dwCall3;
lea eax, buff;
push eax;
lea ecx, buff[16];
call dwCall4;
mov dwWxidArr, eax;
}
//õID
wchar_t test[0x100] = { 0 };
wchar_t tempWxid[0x100] = { 0 };
char tempWxidA[0x100] = { 0 };
DWORD userList = *((DWORD *)dwWxidArr); //userListIDб 3.1ASCIIʽID
DWORD testTmp = dwWxidArr + 0xB4;
int Len = *((int *)testTmp); //ȡIDĸ
for (int i = 0; i < Len; i++)
{
DWORD temWxidAdd = userList + (i * 0x18); //0x18ÿIDļ
int flags = (int)(*((LPVOID*)(temWxidAdd + 0x14)));
if (flags == 0xF)
{
sprintf_s(tempWxidA, "%s", (char*)temWxidAdd);
}
else
{
sprintf_s(tempWxidA, "%s", (char*)*((LPVOID *)temWxidAdd));
}
USES_CONVERSION;
//2.ͨIDȡȺԱϢ
GetUserInfoByWxid(A2W(tempWxidA));
}
//֮Ϣ
HWND hWnd = FindWindow(NULL, TEXT("ChatRoomMember"));
if (hWnd == NULL)
{
OutputDebugStringA("δҵChatRoomMember");
return;
}
COPYDATASTRUCT userinfodata;
userinfodata.dwData = WM_ShowChatRoomMembersDone;//һֵ, ־
userinfodata.cbData = 0;// strlen(szSendBuf);//͵ݵij
userinfodata.lpData = NULL;// szSendBuf;//͵ݵʼַ(ΪNULL)
SendMessage(hWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&userinfodata);
}
//************************************************************
// : GetUserInfoByWxid
// ˵: ͨIDȡûϢ
// : GuiShou
// ʱ : 2019/7/13
// : userwxid ID
// ֵ: void
//************************************************************
void GetUserInfoByWxid(wchar_t* userwxid)
{
DWORD WechatBase = (DWORD)GetModuleHandle(L"WeChatWin.dll");
DWORD dwCall1 = WechatBase + WxGetUserInfoWithNoNetworkCall1;
DWORD dwCall2 = WechatBase + WxGetUserInfoWithNoNetworkCall2;
DWORD dwCall3 = WechatBase + WxGetUserInfoWithNoNetworkCall3;
char buff[0x508] = { 0 };
char * asmHeadBuff = buff;
char * asmBuff = &buff[0x18];
GeneralStruct pWxid(userwxid);
char* asmWxid = (char*)&pWxid.pstr;
__asm
{
pushad;
mov edi, asmWxid; //IDṹ
mov eax, asmBuff; //
push eax;
sub esp, 0x14;
mov ecx, esp;
push - 0x1;
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;
push dword ptr ds : [edi]; //ID
call dwCall1; //call1
call dwCall2; //call2
mov eax, asmHeadBuff;
push eax;
mov ecx, asmBuff;
call dwCall3;
popad
}
LPVOID lpWxid = *((LPVOID *)((DWORD)buff + 0x20)); //ID
LPVOID lpWxcount = *((LPVOID *)((DWORD)buff + 0x34)); //˺
LPVOID lpNickName = *((LPVOID *)((DWORD)buff + 0x7C)); //dz
//װṹ
UserInfo *userinfo = new UserInfo;
swprintf_s(userinfo->UserId, L"%s", (wchar_t*)lpWxid);
swprintf_s(userinfo->UserNickName, L"%s", (wchar_t*)lpNickName);
swprintf_s(userinfo->UserNumber, L"%s", (wchar_t*)lpWxcount);
//͵ͻ
HWND hWnd = FindWindow(NULL, TEXT("ChatRoomMember"));
if (hWnd == NULL)
{
OutputDebugStringA("δҵChatRoomMember");
return;
}
COPYDATASTRUCT userinfodata;
userinfodata.dwData = WM_ShowChatRoomMembers;//һֵ, ־
userinfodata.cbData = sizeof(UserInfo);// strlen(szSendBuf);//͵ݵij
userinfodata.lpData = userinfo;// szSendBuf;//͵ݵʼַ(ΪNULL)
SendMessage(hWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&userinfodata);
delete userinfo;
}
//************************************************************
// : SetRoomName
// ˵: Ⱥ
// : GuiShou
// ʱ : 2019/7/14
// : roomwxid ȺID roomnameȺ
// ֵ: void
//************************************************************
void SetRoomName(wchar_t* roomwxid, wchar_t* roomname)
{
GeneralStruct pRoomwxid(roomwxid);
GeneralStruct pRoomname(roomname);
char* asmWxid = (char*)&pRoomwxid.pstr;
char* asmRoomname = (char*)&pRoomname.pstr;
DWORD dwWeChatWinAddr = GetWeChatWinBase();
DWORD dwCall1 = dwWeChatWinAddr + WxSetRoomName;
__asm
{
mov edx, asmRoomname;
mov ecx, asmWxid;
call dwCall1;
}
}
//************************************************************
// : SendRoomAtMsg
// ˵: ͰϢ
// : GuiShou
// ʱ : 2019/7/26
// : chatroomid ȺID memberwxid ȺԱID membernicknameȺԱdz msg Ϣ
// ֵ: void
//************************************************************
void SendRoomAtMsg(wchar_t* chatroomid, wchar_t* memberwxid, wchar_t* membernickname, wchar_t* msg)
{
//callװݸʽ
DWORD dwDllBase = GetWeChatWinBase();
DWORD dwPackageMsgDataCall = dwDllBase + WxPackageMsgData;
DWORD dwSendTextCall = dwDllBase + WxSendMessage;
//װı
wchar_t tempmsg[500] = { 0 };
swprintf_s(tempmsg, L"@%s %s", membernickname, msg);
//װIDݽṹ
GeneralStruct wxid(memberwxid);
//װȺIDݽṹ
GeneralStruct roomid(chatroomid);
//װϢıݽṹ
GeneralStruct textcontent(tempmsg);
//0x81C
BYTE buff[0x81C] = { 0 };
//IDݽṹָ
wchar_t* pWxid = (wchar_t*)&wxid.pstr;
//ȺIDݽṹָ
wchar_t* pRoomId = (wchar_t*)&roomid.pstr;
//Ϣıݽṹָ
wchar_t* pTextContent = (wchar_t*)&textcontent.pstr;
//װݽṹ建
char databuff[16] = { 0 };
//װݸʽcall
__asm
{
mov eax, pWxid; //IDṹ
push eax;
lea ecx, databuff;
call dwPackageMsgDataCall;
}
//callͰϢ
__asm
{
mov edx, pRoomId; //ȺIDṹ
lea eax, databuff; //װݽṹ
push 0x1;
push eax;
mov ebx, pTextContent; //Ϣıָ
push ebx;
lea ecx, buff; //0x81C
call dwSendTextCall; //Ϣcall
add esp, 0xC;
}
}
//************************************************************
// : DelRoomMember
// ˵: ɾȺԱ
// : GuiShou
// ʱ : 2019/7/26
// : roomid ȺID memberwxid ȺԱID
// ֵ: void
//************************************************************
void DelRoomMember(wchar_t* roomid, wchar_t* memberwxid)
{
//õcallݵַ
DWORD dwCall1 = GetWeChatWinBase() + WxDelRoomMemberCall1;
DWORD dwCall2 = GetWeChatWinBase() + WxDelRoomMemberCall2;
DWORD dwCall3 = GetWeChatWinBase() + WxDelRoomMemberCall3;
//װȺIDṹ
GeneralStruct roomiddata(roomid);
//װIDṹ
wchar_t wxidbuff[0xD0] = { 0 };
DWORD* dwBuff = (DWORD*)&wxidbuff;
dwBuff[0] = (DWORD)memberwxid;
dwBuff[1] = wcslen(memberwxid);
dwBuff[2] = wcslen(memberwxid) * 2;
dwBuff[3] = 0;
dwBuff[4] = 0;
wchar_t datatbuffer[0xD0] = { 0 };
DWORD* dwDatabuf = (DWORD*)&datatbuffer;
dwDatabuf[0] = (DWORD)& wxidbuff;
dwDatabuf[1] = dwDatabuf[0] + 0x14;
dwDatabuf[2] = dwDatabuf[0] + 0x14;
__asm
{
pushad;
sub esp, 0x14;
mov ecx, esp;
lea ebx, roomiddata.pstr;
push ebx;
call dwCall1;
lea edi, datatbuffer;
push edi;
call dwCall2;
mov ecx, eax;
call dwCall3;
popad;
}
}
================================================
FILE: WeChatHelper/ChatRoomOperate.h
================================================
#pragma once
void SetWxRoomAnnouncement(wchar_t* chatroomwxid,wchar_t* Announcement); //Ⱥ
void QuitChatRoom(wchar_t* chatroomwxid); //˳Ⱥ
void AddGroupMember(wchar_t* chatroomwxid, wchar_t* wxid); //ȺԱ
void ShowChatRoomUser(wchar_t* chatroomwxid); //ʾȺԱ
void GetUserInfoByWxid(wchar_t* userwxid); //ͨIDȡûϢ
void SetRoomName(wchar_t* roomwxid, wchar_t* roomname); //Ⱥ
void DelRoomMember(wchar_t* roomid, wchar_t* memberwxid); //ɾȺԱ
void SendRoomAtMsg(wchar_t* chatroomid, wchar_t* memberwxid, wchar_t* membernickname, wchar_t* msg); //ͰϢ
================================================
FILE: WeChatHelper/FriendList.cpp
================================================
#include "stdafx.h"
#include "FriendList.h"
#include "shellapi.h"
#include <sstream>
#include <iomanip>
#include <strstream>
#include <map>
#include <iostream>
#include <fstream>
#include "ChatRecord.h"
#pragma comment(lib, "Version.lib")
//кбmap
map<wstring, wstring> g_userinfolist;
DWORD overWritedCallAdd= GetWeChatWinBase() + WxFriendListCall;
DWORD jumBackAddress= GetWeChatWinBase() + WxFriendList+5;
//Ƽб
wstring g_referencenumber[11] =
{
L"fmessage",L"qqmail",L"medianote",L"qmessage",L"newsapp",L"filehelper"
L"weixin", L"tmessage", L"mphelper",L"gh_7aac992b0363", L"qqsafe"
};
//************************************************************
// : HookGetFriendList
// ˵: HOOKȡбcall
// : GuiShou
// ʱ : 2019/7/4
// : void
// ֵ: void
//************************************************************
void HookGetFriendList()
{
HookAnyAddress(GetWeChatWinBase() + WxFriendList, GetUserListInfo);
}
//************************************************************
// : GetUserListInfo
// ˵: ȡûϢ
// : GuiShou
// ʱ : 2019/7/4
// : void
// ֵ: void
//************************************************************
__declspec(naked) void GetUserListInfo()
{
__asm
{
pushad;
push esi;
call SendUserListInfo;
popad;
//䱻ǵĴ
call overWritedCallAdd;
//رHOOKָһָ
jmp jumBackAddress
}
}
//************************************************************
// : ReSendUser
// ˵: ٴηͺϢ
// : GuiShou
// ʱ : 2019/7/4
// : user
// ֵ: void
//************************************************************
void ReSendUser(UserListInfo* user)
{
HWND hWnd = NULL;
while (true)
{
//͵ƶ
hWnd = FindWindow(NULL, TEXT(""));
if (hWnd == NULL)
{
Sleep(200);
continue;
}
break;
}
COPYDATASTRUCT userinfo;
userinfo.dwData = WM_GetFriendList;//һֵ, ־
userinfo.cbData = sizeof(UserListInfo);// strlen(szSendBuf);//͵ݵij
userinfo.lpData = user;// szSendBuf;//͵ݵʼַ(ΪNULL)
SendMessage(hWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&userinfo);
delete user;
}
//************************************************************
// : SendUserListInfo
// ˵: ͺб
// : GuiShou
// ʱ : 2019/7/4
// : r_esi бڵָ
// ֵ: void
//************************************************************
void __stdcall SendUserListInfo(DWORD r_esi)
{
//źšȺ
wstring wxid = GetMsgByAddress(r_esi + 0x8);
wstring nickname = GetMsgByAddress(r_esi + 0x64);
//бȥ
map<wstring, wstring>::iterator it;
it = g_userinfolist.find(wxid);
//ֵend() ˵ҵ ֱӷطֹظ
if (it != g_userinfolist.end())
{
return;
}
//ûҵ 뵽
g_userinfolist.insert(make_pair(wxid, nickname));
//ųƼб
for (int i = 0; i < 11; i++)
{
if (g_referencenumber[i] == wxid)
{
return;
}
}
unique_ptr<UserListInfo> user(new UserListInfo);
LPVOID pUserWxid = *((LPVOID *)(r_esi + 0x8)); //ID
LPVOID pUserNumber = *((LPVOID *)(r_esi + 0x1C)); //ź
LPVOID pUserNick = *((LPVOID *)(r_esi + 0x64)); //dz
LPVOID pUserReMark = *((LPVOID *)(r_esi + 0x50)); //ע
swprintf_s(user->UserId, L"%s", (wchar_t*)pUserWxid);
swprintf_s(user->UserNumber, L"%s", (wchar_t*)pUserNumber);
swprintf_s(user->UserNickName, L"%s", (wchar_t*)pUserNick);
swprintf_s(user->UserRemark, L"%s", (wchar_t*)pUserReMark);
//͵ƶ
HWND hWnd = FindWindow(NULL, TEXT(""));
if (hWnd == NULL)
{
UserListInfo* outuser = new UserListInfo;
swprintf_s(outuser->UserId, L"%s", (wchar_t*)pUserWxid);
swprintf_s(outuser->UserNumber, L"%s", (wchar_t*)pUserNumber);
swprintf_s(outuser->UserNickName, L"%s", (wchar_t*)pUserNick);
swprintf_s(outuser->UserRemark, L"%s", (wchar_t*)pUserReMark);
HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ReSendUser, outuser, 0, NULL);
CloseHandle(hThread);
}
COPYDATASTRUCT userinfo;
userinfo.dwData = WM_GetFriendList;//һֵ, ־
userinfo.cbData = sizeof(UserListInfo);// strlen(szSendBuf);//͵ݵij
userinfo.lpData = user.get();// szSendBuf;//͵ݵʼַ(ΪNULL)
SendMessage(hWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&userinfo);
}
//************************************************************
// : SendTextMessage
// ˵: ıϢ
// : GuiShou
// ʱ : 2019/7/4
// : wxid ID msgϢ
// ֵ: void
//************************************************************
void SendTextMessage(wchar_t* wxid, wchar_t* msg)
{
//õϢcallĵַ
DWORD dwSendCallAddr = GetWeChatWinBase() + WxSendMessage;
//װID/ȺIDĽṹ
GeneralStruct id(wxid);
//Ϣ
GeneralStruct text(msg);
//ȡIDϢĵַ
char* pWxid = (char*)&id.pstr;
char* pWxmsg = (char*)&text.pstr;
char buff[0x81C] = { 0 };
char buff2[0x81C] = { 0 };
//ŷϢcall
__asm {
push 0x1;
lea edi, buff2;
push edi;
mov ebx, pWxmsg;
push ebx;
lea ecx, buff;
mov edx, pWxid;
call dwSendCallAddr;
add esp, 0xC;
}
}
//************************************************************
// : SendFileMessage
// ˵: ļϢ
// : GuiShou
// ʱ : 2019/7/4
// : wxid ID filepath ļ·
// ֵ: void
//************************************************************
void SendFileMessage(wchar_t* wxid, wchar_t* filepath)
{
//Ҫĵַ
DWORD dwBase = GetWeChatWinBase();
DWORD dwCall1 = dwBase + WxFileMessage1;
DWORD dwCall2 = dwBase + WxFileMessage2;
DWORD dwCall3 = dwBase + WxFileMessage3; //
DWORD dwCall4 = dwBase + WxFileMessage4; //Ϣ
DWORD dwParams = dwBase + WxFileMessageParam;
char buff[0x528] = { 0 };
//Ҫ
GeneralStruct wxidStruct(wxid);
GeneralStruct filePathStruct(filepath);
//ȡҪݵĵַ
char* pFilePath = (char*)&filePathStruct.pstr;
char* pWxid = (char*)&wxidStruct.pstr;
__asm {
pushad;
sub esp, 0x14;
lea eax, buff;
mov ecx, esp;
push eax;
call dwCall2;
push 0;
sub esp, 0x14;
mov ecx, esp;
push - 0x1;
push dwParams;
call dwCall1;
sub esp, 0x14;
mov ecx, esp;
mov ebx, pFilePath;
push ebx;
call dwCall2;
sub esp, 0x14;
mov eax, pWxid;
mov ecx, esp;
push eax;
call dwCall2;
lea eax, buff;
push eax;
call dwCall3;
mov ecx, eax;
call dwCall4;
popad;
}
}
//************************************************************
// : SendImageMessage
// ˵: ͼƬϢ
// : GuiShou
// ʱ : 2019/7/7
// : wxid ID filepath ͼƬ·
// ֵ: void
//************************************************************
void SendImageMessage(wchar_t* wxid, wchar_t* filepath)
{
//װIDݽṹ
GeneralStruct imagewxid(wxid);
//װļ·ݽṹ
GeneralStruct imagefilepath(filepath);
char buff[0x528] = { 0 };
char buff2[0x60] = { 0 };
DWORD dwCall3 = GetWeChatWinBase() + WxSendImageCall3;
DWORD dwCall1 = GetWeChatWinBase()+ WxSendImageCall1;
DWORD dwCall2 = GetWeChatWinBase() + WxSendImageCall2;
//ŷͼƬGidCreateBimapFileCM ֮ͼƬһֱռ ɾ patchĴ
unsigned char oldcode[5] = {0};
unsigned char fix[5] = { 0x31,0xC0,0x90,0x90,0x90 };
DWORD dwPathcAddr = GetWeChatWinBase() + WxPatchAddr;
//Ĵ
DWORD dwOldAttr = 0;
VirtualProtect((LPVOID)dwPathcAddr, 5, PAGE_EXECUTE_READWRITE, &dwOldAttr);
//ȱԭָ
memcpy(oldcode, (LPVOID)dwPathcAddr, 5);
//Patch
memcpy((LPVOID)dwPathcAddr, fix, 5);
__asm
{
pushad;
sub esp, 0x14;
lea eax, buff2;
mov ecx, esp;
push eax;
call dwCall3;
lea ebx, imagefilepath;
push ebx;
lea eax, imagewxid;
push eax;
lea eax, buff;
push eax;
call dwCall1;
mov ecx, eax;
call dwCall2;
popad;
}
//ָ֮
memcpy((LPVOID)dwPathcAddr, oldcode, 5);
//ָ
VirtualProtect((LPVOID)dwPathcAddr, 5, dwOldAttr, &dwOldAttr);
}
//************************************************************
// : WxDeleteUser
// ˵: ɾ
// : GuiShou
// ʱ : 2019/7/8
// : wxid ID
// ֵ: void
//************************************************************
void DeleteUser(wchar_t* wxid)
{
DWORD dwBaseAddress = GetWeChatWinBase();
//
GeneralStruct structWxid(wxid);
DWORD* asmMsg = (DWORD*)&structWxid.pstr;
DWORD dwCallAddr = dwBaseAddress + WxDeleteUser;
__asm
{
mov ecx, 0;
push ecx;
mov esi, asmMsg;
push esi;
call dwCallAddr;
}
}
//************************************************************
// : SendXmlCard
// ˵: XMLƬ
// : GuiShou
// ʱ : 2019/7/10
// : RecverWxid ID SendWxidҪ͵ID NickNamedz
// ֵ: void
//************************************************************
void SendXmlCard(wchar_t* RecverWxid, wchar_t* SendWxid, wchar_t* NickName)
{
wchar_t xml[0x2000] = { 0 };
swprintf_s(xml, L"<?xml version=\"1.0\"?><msg bigheadimgurl=\"http://wx.qlogo.cn/mmhead/ver_1/7IiaGRVxyprWcBA9v2IA1NLRa1K5YbEX5dBzmcEKw4OupNxsYuYSBt1zG91O6p07XlIOQIFhPCC3hU1icJMk3z28Ygh6IhfZrV4oYtXZXEU5A/0\" smallheadimgurl=\"http://wx.qlogo.cn/mmhead/ver_1/7IiaGRVxyprWcBA9v2IA1NLRa1K5YbEX5dBzmcEKw4OupNxsYuYSBt1zG91O6p07XlIOQIFhPCC3hU1icJMk3z28Ygh6IhfZrV4oYtXZXEU5A/132\" username=\"%s\" nickname=\"%s\" fullpy=\"?\" shortpy=\"\" alias=\"%s\" imagestatus=\"3\" scene=\"17\" province=\"\" city=\"й\" sign=\"\" sex=\"2\" certflag=\"0\" certinfo=\"\" brandIconUrl=\"\" brandHomeUrl=\"\" brandSubscriptConfigUrl= \"\" brandFlags=\"0\" regionCode=\"CN_BeiJing_BeiJing\" />", SendWxid, NickName, SendWxid);
GeneralStruct pWxid(RecverWxid);
GeneralStruct pXml(xml);
char* asmWxid = (char *)&pWxid.pstr;
char* asmXml = (char *)&pXml.pstr;
char buff[0x20C] = { 0 };
DWORD callAdd = GetWeChatWinBase() + WxSendXmlCard;
__asm {
mov eax, asmXml
push 0x2A
mov edx, asmWxid
push 0x0
push eax
lea ecx, buff
call callAdd
add esp, 0xC
}
}
//************************************************************
// : wstringToString
// ˵: wstringתString
// : GuiShou
// ʱ : 2019/9/17
// : wstr
// ֵ: string
//************************************************************
std::string wstringToString(const std::wstring& wstr)
{
LPCWSTR pwszSrc = wstr.c_str();
int nLen = WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, NULL, 0, NULL, NULL);
if (nLen == 0)
return std::string("");
char* pszDst = new char[nLen];
if (!pszDst)
return std::string("");
WideCharToMultiByte(CP_ACP, 0, pwszSrc, -1, pszDst, nLen, NULL, NULL);
std::string str(pszDst);
delete[] pszDst;
pszDst = NULL;
return str;
}
//************************************************************
// : GetNickNameByWxid
// ˵: ݺбID/ȺIDȡdz/Ⱥdz
// : GuiShou
// ʱ : 2020/2/10
// : nickname dz
// ֵ: void
//************************************************************
wstring GetNickNameByWxid(wstring wxid)
{
map<wstring, wstring>::iterator it;
it = g_userinfolist.find(wxid);
if (it != g_userinfolist.end())
{
return it->second;
}
else
{
return L"NULL";
}
}
//************************************************************
// : GetNicknameByWxid
// ˵: IDȡdz
// : GuiShou
// ʱ : 2020/2/10
// : wxid ID
// ֵ: wchar_t* dz
//************************************************************
wchar_t* GetNicknameByWxid(wchar_t* userwxid)
{
DWORD dwCall1 = GetWeChatWinBase() + WxGetUserInfoByWxidCall1;
DWORD dwCall2 = GetWeChatWinBase() + WxGetUserInfoByWxidCall2;
DWORD dwCall3 = GetWeChatWinBase() + WxGetUserInfoByWxidCall3;
GeneralStruct pWxid(userwxid);
char* asmWxid = (char*)& pWxid.pstr;
char buff[0x3D8] = { 0 };
DWORD userData = 0; //ûݵĵַ
__asm
{
pushad;
lea edi, buff;
push edi;
sub esp, 0x14;
mov eax, asmWxid;
mov ecx, esp;
push eax;
call dwCall1;
call dwCall2;
call dwCall3;
mov userData, edi;
popad;
}
wchar_t tempnickname[100] = { 0 };
DWORD wxNickAdd = userData + 0x64; //dz
swprintf_s(tempnickname, L"%s", (wchar_t*)(*((LPVOID*)wxNickAdd)));
wchar_t* nickname = new wchar_t[100]{ 0 };
memcpy(nickname, tempnickname, wcslen(tempnickname) * 2);
return nickname;
}
================================================
FILE: WeChatHelper/FriendList.h
================================================
#pragma once
void HookGetFriendList(); //HOOKȡбcall
void GetUserListInfo(); //ȡб
void __stdcall SendUserListInfo(DWORD r_esi); //ͺб
void SendTextMessage(wchar_t* wxid, wchar_t* msg); //ıϢ
void SendFileMessage(wchar_t* wxid, wchar_t* filepath); //ļϢ
void SendImageMessage(wchar_t* wxid, wchar_t* filepath);//ͼƬϢ
void DeleteUser(wchar_t* wxid); //ɾ
void SendXmlCard(wchar_t* RecverWxid, wchar_t* SendWxid, wchar_t* NickName); //XMLƬ
std::string wstringToString(const std::wstring& wstr);
wchar_t* GetNicknameByWxid(wchar_t* userwxid);
wstring GetNickNameByWxid(wstring wxid);
================================================
FILE: WeChatHelper/Function.cpp
================================================
#include "stdafx.h"
#include "Function.h"
#include <stdlib.h >
#include <vector>
#include "FriendList.h"
vector<wstring> g_wxidgroup; //嶯̬ID
//************************************************************
// : AddWxUser
// ˵: Ӻ
// : GuiShou
// ʱ : 2019/7/13
// : wxid ID msgӺʱҪ͵Ϣ
// ֵ: void
//************************************************************
void AddWxUser(wchar_t* wxid, wchar_t* msg)
{
DWORD dwWeChatWinAddr = GetWeChatWinBase();
DWORD dwParam1 = dwWeChatWinAddr + WxAddWxUserParam1;
DWORD dwCall1 = dwWeChatWinAddr + WxAddWxUserCall1;
DWORD dwCall2 = dwWeChatWinAddr + WxAddWxUserCall2;
DWORD dwCall3 = dwWeChatWinAddr + WxAddWxUserCall3;
DWORD dwCall4 = dwWeChatWinAddr + WxAddWxUserCall4;
DWORD dwCall5 = dwWeChatWinAddr + WxAddWxUserCall5;
GeneralStruct pWxid(wxid);
GeneralStruct pMsg(msg);
char* asmWxid = (char*)&pWxid.pstr;
char* asmMsg = (char*)&pMsg.pstr;
DWORD asmMsgText = (DWORD)pMsg.pstr;
char buff3[0x100] = { 0 };
char* buff = buff3;
__asm
{
sub esp, 0x18;
mov ecx, esp;
push dwParam1;
call dwCall1;
sub esp, 0x18;
mov eax, buff;
mov ecx, esp;
push eax;
call dwCall2;
push 0x6;
sub esp, 0x14;
mov ecx, esp;
push -0x1;
mov edi, msg;
push edi;
call dwCall3;
push 0x2;
sub esp, 0x14;
mov ecx, esp;
mov ebx, asmWxid;
push ebx;
call dwCall4;
mov ecx, eax;
call dwCall5;
}
}
//************************************************************
// : OpenUrl
// ˵:
// : GuiShou
// ʱ : 2019/9/10
// : void
// ֵ: void
//************************************************************
void OpenUrl(wchar_t* Url)
{
GeneralStruct pUrl(Url);
char* asmpUrl = (char*)&pUrl.pstr;
DWORD dwWeChatWinAddr = GetWeChatWinBase();
DWORD callAdd1 = dwWeChatWinAddr + WxOpenUrlCall1;
DWORD callAdd2 = dwWeChatWinAddr + WxOpenUrlCall2;
__asm {
pushad
sub esp, 0x14
mov eax, asmpUrl
mov ecx, esp
push eax
call callAdd1
call callAdd2
add esp, 0x14
popad
}
}
//************************************************************
// : AntiRevoke
// ˵:
// : GuiShou
// ʱ : 2019/7/15
// : void
// ֵ: void
//************************************************************
void AntiRevoke()
{
unsigned char fix[1] = { 0xEB };
DWORD dwPathcAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll") + WxAntiRevoke;
//Ĵ
DWORD dwOldAttr = 0;
VirtualProtect((LPVOID)dwPathcAddr, 1, PAGE_EXECUTE_READWRITE, &dwOldAttr);
//Patch
memcpy((LPVOID)dwPathcAddr, fix, 1);
//ָ
VirtualProtect((LPVOID)dwPathcAddr, 5, dwOldAttr, &dwOldAttr);
}
================================================
FILE: WeChatHelper/Function.h
================================================
#pragma once
#include <string>
using namespace std;
void AddWxUser(wchar_t* wxid, wchar_t* msg); //Ӻ
void AntiRevoke(); //
void OpenUrl(wchar_t * Url); //
================================================
FILE: WeChatHelper/InitWeChat.cpp
================================================
#include "stdafx.h"
#include <strstream>
#include <iostream>
#pragma comment(lib,"Version.lib")
//************************************************************
// : IsWxVersionValid
// ˵: Ű汾Ƿƥ
// : GuiShou
// ʱ : 2019/6/30
// : void
// ֵ: BOOL
//************************************************************
BOOL IsWxVersionValid()
{
DWORD wxBaseAddress = (DWORD)GetModuleHandle(TEXT("WeChatWin.dll"));
const string wxVersoin = "3.2.1.154";
WCHAR VersionFilePath[MAX_PATH];
if (GetModuleFileName((HMODULE)wxBaseAddress, VersionFilePath, MAX_PATH) == 0)
{
return FALSE;
}
string asVer = "";
VS_FIXEDFILEINFO* pVsInfo;
unsigned int iFileInfoSize = sizeof(VS_FIXEDFILEINFO);
int iVerInfoSize = GetFileVersionInfoSize(VersionFilePath, NULL);
if (iVerInfoSize != 0) {
char* pBuf = new char[iVerInfoSize];
if (GetFileVersionInfo(VersionFilePath, 0, iVerInfoSize, pBuf)) {
if (VerQueryValue(pBuf, TEXT("\\"), (void**)& pVsInfo, &iFileInfoSize)) {
int s_major_ver = (pVsInfo->dwFileVersionMS >> 16) & 0x0000FFFF;
int s_minor_ver = pVsInfo->dwFileVersionMS & 0x0000FFFF;
int s_build_num = (pVsInfo->dwFileVersionLS >> 16) & 0x0000FFFF;
int s_revision_num = pVsInfo->dwFileVersionLS & 0x0000FFFF;
//Ѱ汾ַ
strstream wxVer;
wxVer << s_major_ver << "." << s_minor_ver << "." << s_build_num << "." << s_revision_num;
wxVer >> asVer;
}
}
delete[] pBuf;
}
//汾ƥ
if (asVer == wxVersoin)
{
return TRUE;
}
//汾ƥ
return FALSE;
}
//************************************************************
// : CheckIsLogin
// ˵: Ƿ½
// : GuiShou
// ʱ : 2019/6/30
// : void
// ֵ: void
//************************************************************
void CheckIsLogin()
{
//ȡWeChatWinĻַ
DWORD dwWeChatWinAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll");
while (true)
{
DWORD dwIsLogin = dwWeChatWinAddr + LoginSign_Offset;
if (*(DWORD*)dwIsLogin != 0)
{
//ҵ½ھ
HWND hLogin = FindWindow(NULL, L"Login");
if (hLogin == NULL)
{
OutputDebugStringA("δҵLogin");
return;
}
COPYDATASTRUCT login_msg;
login_msg.dwData = WM_Login;
login_msg.lpData = NULL;
login_msg.cbData = 0;
//Ϣƶ
SendMessage(hLogin, WM_COPYDATA, (WPARAM)hLogin, (LPARAM)&login_msg);
break;
}
Sleep(500);
}
}
================================================
FILE: WeChatHelper/InitWeChat.h
================================================
#pragma once
#include "stdafx.h"
BOOL IsWxVersionValid(); //鵱ǰŰ汾
void CheckIsLogin(); //Ƿ½
================================================
FILE: WeChatHelper/Login.cpp
================================================
#include "stdafx.h"
#include "Login.h"
DWORD dwRetAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll") + WxQrCodeOffset + 5; //صַ
DWORD dwOverAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll") + WxQrCodeOffsetCall; //ǵcall
//************************************************************
// : HookQrCode
// ˵: HOOKŶά
// : GuiShou
// ʱ : 2019/6/30
// : DWORD dwHookOffset Ҫhookƫ
// ֵ: void
//************************************************************
void HookQrCode()
{
HookAnyAddress(GetWeChatWinBase()+ WxQrCodeOffset, ShowPic);
}
//************************************************************
// : ShowPic
// ˵: ʾά
// : GuiShou
// ʱ : 2019/6/16
// : void
// ֵ: void
//************************************************************
void __declspec(naked) ShowPic()
{
__asm
{
pushad;
pushfd;
push ecx;
call SaveImg;
popfd;
popad;
call dwOverAddr;
jmp dwRetAddr;
}
}
//************************************************************
// : SaveImg
// ˵: άͼƬ
// : GuiShou
// ʱ : 2019/6/30
// : DWORD qrcode άͼƬڵĵַ
// ֵ: void
//************************************************************
void __stdcall SaveImg(DWORD qrcode)
{
//ȡͼƬ
DWORD dwPicLen = qrcode + 0x4;
size_t cpyLen = (size_t)*((LPVOID*)dwPicLen);
//ͼƬ
char PicData[0xFFF] = { 0 };
memcpy(PicData, *((LPVOID*)qrcode), cpyLen);
char szTempPath[MAX_PATH] = { 0 };
char szPicturePath[MAX_PATH] = { 0 };
GetTempPathA(MAX_PATH, szTempPath);
sprintf_s(szPicturePath, "%s%s", szTempPath, "qrcode.png");
//ļдTempĿ¼
HANDLE hFile = CreateFileA(szPicturePath, GENERIC_ALL, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == NULL)
{
OutputDebugStringA("ͼƬļʧ");
return;
}
DWORD dwRead = 0;
if (WriteFile(hFile, PicData, cpyLen, &dwRead, NULL) == 0)
{
OutputDebugStringA("дͼƬļʧ");
return;
}
CloseHandle(hFile);
}
//************************************************************
// : GotoQrCode
// ˵: תά봰
// : GuiShou
// ʱ : 2019/6/16
// : void
// ֵ: void
//************************************************************
void GotoQrCode()
{
DWORD dwBaseAddress = (DWORD)GetModuleHandle(L"WeChatWin.dll");
DWORD dwCallAddr1 = dwBaseAddress + WxGoToQrCode1;
DWORD dwCallAddr2 = dwBaseAddress + WxGoToQrCode2;
__asm
{
call dwCallAddr1;
mov ecx, eax;
call dwCallAddr2;
}
}
================================================
FILE: WeChatHelper/Login.h
================================================
#pragma once
#include "stdafx.h"
void HookQrCode(); //HOOKά
void ShowPic(); //ʾά
void __stdcall SaveImg(DWORD qrcode); //ά
void GotoQrCode(); //תά
================================================
FILE: WeChatHelper/MainWindow.cpp
================================================
#include "stdafx.h"
#include "MainWindow.h"
void LogoutWeChat()
{
DWORD dwBaseAddress = (DWORD)GetModuleHandle(L"WeChatWin.dll");
DWORD dwCallAddress = dwBaseAddress + WxLogout;
HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)dwCallAddress, 0, NULL, 0);
if (hThread != 0)
{
CloseHandle(hThread);
}
}
================================================
FILE: WeChatHelper/MainWindow.h
================================================
#pragma once
#include "stdafx.h"
void LogoutWeChat();
================================================
FILE: WeChatHelper/SelfInformation.cpp
================================================
#include "stdafx.h"
#include "SelfInformation.h"
#include "Function.h"
#include "CPublic.h"
//************************************************************
// : GetSelfInformation
// ˵: ȡϢ
// : GuiShou
// ʱ : 2019/12/4
// : void
// ֵ: void
//************************************************************
//void GetInformation()
//{
// Information *info = new Information;
// char tempcontent[0x300];
// //ȡWeChatWinĻַ
// DWORD dwWeChatWinAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll");
//
// //ID Ҫź źָ źַ
// memset(tempcontent, 0, 0x300);
// DWORD pWxid = dwWeChatWinAddr + 0x161C814;
// //С6ߴ20 ˵طǸָ
// sprintf_s(tempcontent, "%s", (char*)(dwWeChatWinAddr + 0x161C814));
// if (strlen(tempcontent) < 0x6 || strlen(tempcontent) > 0x14)
// {
// //˵µź IDõַ
// sprintf_s(tempcontent, "%s", (char*)(*(DWORD*)(dwWeChatWinAddr + 0x161C814)));
// }
// else
// {
// sprintf_s(tempcontent, "%s", (char*)(dwWeChatWinAddr + 0x161C814));
// }
// wcscpy_s(info->wxid, wcslen(UTF8ToUnicode(tempcontent)) + 1, UTF8ToUnicode(tempcontent));
//
// //ID
// //char wxid[0x1000] = { 0 };
// //DWORD pWxid = dwWeChatWinAddr + 0x161C814;
// //sprintf_s(wxid, "%s", (char*)(*(DWORD*)pWxid));
// //if (strlen(wxid) < 40)
// //{
// // wcscpy_s(info->wxid, wcslen(UTF8ToUnicode(wxid)) + 1, UTF8ToUnicode(wxid));
// //}
// //else
// //{
// // wcscpy_s(info->wxid, wcslen(L"IDʱʾ") + 1, L"IDʱʾ");
// //}
//
// //Ա
// char sex[4] = { 0 };
// memcpy(sex, (void*)(pWxid + 0x160), 1);
//
// if (sex[0] == 1)
// {
// wcscpy_s(info->wxsex, wcslen(L"") + 1, L"");
// }
// if (sex[0] == 2)
// {
// wcscpy_s(info->wxsex, wcslen(L"Ů") + 1, L"Ů");
// }
//
// //dz
// char nickname[40] = { 0 };
// if (*(DWORD*)(pWxid + 0x78 + 0x14) == 0xF)
// {
// sprintf_s(nickname, "%s", (char*)(pWxid + 0x78));
// wcscpy_s(info->nickname, wcslen(UTF8ToUnicode(nickname)) + 1, UTF8ToUnicode(nickname));
// }
// else
// {
// DWORD pNickName = pWxid + 0x78;
// sprintf_s(nickname, "%s", (char*)(*(DWORD*)pNickName));
// wcscpy_s(info->nickname, wcslen(UTF8ToUnicode(nickname)) + 1, UTF8ToUnicode(nickname));
// }
//
// //˺
// char wxcount[40] = { 0 };
// sprintf_s(wxcount, "%s", (char*)(pWxid + 0x1DC));
// wcscpy_s(info->wxcount, wcslen(UTF8ToUnicode(wxcount)) + 1, UTF8ToUnicode(wxcount));
//
// //ֻ
// char phone[40] = { 0 };
// sprintf_s(phone, "%s", (char*)(pWxid + 0xAC));
// wcscpy_s(info->phonenumber, wcslen(UTF8ToUnicode(phone)) + 1, UTF8ToUnicode(phone));
//
// //½豸
// char device[15] = { 0 };
// sprintf_s(device, "%s", (char*)(pWxid + 0x4B4));
// wcscpy_s(info->device, wcslen(UTF8ToUnicode(device)) + 1, UTF8ToUnicode(device));
//
// //
// char nation[10] = { 0 };
// sprintf_s(nation, "%s", (char*)(pWxid + 0x254));
// wcscpy_s(info->nation, wcslen(UTF8ToUnicode(nation)) + 1, UTF8ToUnicode(nation));
//
// //ʡ
// char province[20] = { 0 };
// sprintf_s(province, "%s", (char*)(pWxid + 0x164));
// wcscpy_s(info->province, wcslen(UTF8ToUnicode(province)) + 1, UTF8ToUnicode(province));
//
// //
// char city[20] = { 0 };
// sprintf_s(city, "%s", (char*)(pWxid + 0x17C));
// wcscpy_s(info->city, wcslen(UTF8ToUnicode(city)) + 1, UTF8ToUnicode(city));
//
//
// //Сͷ
// char header[0x100] = { 0 };
// DWORD pHeader = pWxid + 0x358;
// sprintf_s(header, "%s", (char*)(*(DWORD*)pHeader));
// wcscpy_s(info->smallheader, wcslen(UTF8ToUnicode(header)) + 1, UTF8ToUnicode(header));
//
//
// //ͷ
// char bigheader[0x100] = { 0 };
// DWORD pbigheader = pWxid + 0x340;
// sprintf_s(bigheader, "%s", (char*)(*(DWORD*)pbigheader));
// wcscpy_s(info->bigheader, wcslen(UTF8ToUnicode(bigheader)) + 1, UTF8ToUnicode(bigheader));
//
// //͵ͻ
// HWND hInformation = FindWindow(NULL, L"Information");
// if (hInformation == NULL)
// {
// OutputDebugStringA("δҵInformation");
// return;
// }
// COPYDATASTRUCT information_msg;
// information_msg.dwData = WM_GetInformation;
// information_msg.lpData = info;
// information_msg.cbData = sizeof(Information);
// //Ϣƶ
// SendMessage(hInformation, WM_COPYDATA, (WPARAM)hInformation, (LPARAM)&information_msg);
//
// delete info;
//}
void GetInformation()
{
unique_ptr<PersonalInformation> info(new PersonalInformation);
DWORD dwWeChatWin = GetWeChatWinBase();
char tempcontent[0x300];
//ź
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxCount));
//жǷΪ0 0˵źΪ
if (tempcontent[0] == 0)
{
wcscpy_s(info->wxcount, wcslen(L"NULL") + 1, L"NULL");
}
else
{
wcscpy_s(info->wxcount, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
}
//ID Ҫź źָ źַ
memset(tempcontent, 0, 0x300);
DWORD pWxid = dwWeChatWin + WxID;
//С6ߴ20 ˵طǸָ
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxID));
if (strlen(tempcontent) < 0x6 || strlen(tempcontent) > 0x14)
{
//˵µź IDõַ
sprintf_s(tempcontent, "%s", (char*)(*(DWORD*)(dwWeChatWin + WxID)));
}
else
{
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxID));
}
wcscpy_s(info->wxid, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//Сͷ
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(*(DWORD*)(dwWeChatWin + WxSmallHeader)));
wcscpy_s(info->smallheader, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//ͷ
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(*(DWORD*)(dwWeChatWin + WxBigHeader)));
wcscpy_s(info->bigheader, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxNation));
wcscpy_s(info->nation, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//ʡ
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxProvince));
wcscpy_s(info->province, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxCity));
wcscpy_s(info->city, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//ֻ
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxPhoneNumber));
wcscpy_s(info->phonenumber, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//dz
memset(tempcontent, 0, 0x300);
if (*(DWORD*)(dwWeChatWin + WxNickName + 0x14) == 0xF)
{
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxNickName));
}
else
{
sprintf_s(tempcontent, "%s", (char*)(*(DWORD*)(dwWeChatWin + WxNickName)));
}
wcscpy_s(info->nickname, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//Ŀ¼
swprintf_s(info->cachedir, L"%s", (wchar_t*)(*(DWORD*)(dwWeChatWin + WxCacheDir)));
//½豸
memset(tempcontent, 0, 0x300);
sprintf_s(tempcontent, "%s", (char*)(dwWeChatWin + WxDevice));
wcscpy_s(info->device, wcslen(UTF8ToUnicode2(tempcontent).c_str()) + 1, UTF8ToUnicode2(tempcontent).c_str());
//Ա
DWORD nSex = *(DWORD*)(dwWeChatWin + WxSex);
if (nSex == 1)
{
wcscpy_s(info->wxsex, wcslen(L"") + 1, L"");
}
else if (nSex == 2)
{
wcscpy_s(info->wxsex, wcslen(L"Ů") + 1, L"Ů");
}
else
{
wcscpy_s(info->wxsex, wcslen(L"δ") + 1, L"δ");
}
HWND hInformation = FindWindow(NULL, L"Information");
if (hInformation == NULL)
{
OutputDebugStringA("δҵInformation");
return;
}
COPYDATASTRUCT information_msg;
information_msg.dwData = WM_GetInformation;
information_msg.lpData = info.get();
information_msg.cbData = sizeof(PersonalInformation);
//Ϣƶ
SendMessage(hInformation, WM_COPYDATA, (WPARAM)hInformation, (LPARAM)&information_msg);
}
================================================
FILE: WeChatHelper/SelfInformation.h
================================================
#pragma once
void GetInformation();
================================================
FILE: WeChatHelper/WeChatHelper.cpp
================================================
// WeChatHelper.cpp : 定义 DLL 应用程序的导出函数。
//
#include "stdafx.h"
================================================
FILE: WeChatHelper/WeChatHelper.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{6B65B0BF-7949-4C08-904B-5F51D8D3988F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>WeChatHelper</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;WECHATHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;WECHATHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;WECHATHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;WECHATHELPER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="CAutoFunction.h" />
<ClInclude Include="ChatRecord.h" />
<ClInclude Include="ChatRoomOperate.h" />
<ClInclude Include="CPublic.h" />
<ClInclude Include="data.h" />
<ClInclude Include="FriendList.h" />
<ClInclude Include="Function.h" />
<ClInclude Include="InitWeChat.h" />
<ClInclude Include="Login.h" />
<ClInclude Include="MainWindow.h" />
<ClInclude Include="message.h" />
<ClInclude Include="offset.h" />
<ClInclude Include="SelfInformation.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="WndMsgLoop.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="CAutoFunction.cpp" />
<ClCompile Include="ChatRecord.cpp" />
<ClCompile Include="ChatRoomOperate.cpp" />
<ClCompile Include="CPublic.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="FriendList.cpp" />
<ClCompile Include="Function.cpp" />
<ClCompile Include="InitWeChat.cpp" />
<ClCompile Include="Login.cpp" />
<ClCompile Include="MainWindow.cpp" />
<ClCompile Include="SelfInformation.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="WeChatHelper.cpp" />
<ClCompile Include="WndMsgLoop.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: WeChatHelper/WeChatHelper.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="初始化微信">
<UniqueIdentifier>{0b9b27f1-635b-4b63-9580-930b8d72841d}</UniqueIdentifier>
</Filter>
<Filter Include="窗口消息循环">
<UniqueIdentifier>{4b5b4735-0ae3-4e6b-8cdb-2af5f879882b}</UniqueIdentifier>
</Filter>
<Filter Include="登陆窗口">
<UniqueIdentifier>{fc4286b8-5328-472a-a362-c3b84ee68237}</UniqueIdentifier>
</Filter>
<Filter Include="主窗口">
<UniqueIdentifier>{4b22a285-3804-41a4-a099-5f661e054c87}</UniqueIdentifier>
</Filter>
<Filter Include="好友列表">
<UniqueIdentifier>{eefc2ad3-9bc5-47a6-aa77-b4e015e0ea95}</UniqueIdentifier>
</Filter>
<Filter Include="聊天记录">
<UniqueIdentifier>{db5c4a94-9e79-4224-afae-c1f02e131232}</UniqueIdentifier>
</Filter>
<Filter Include="功能窗口">
<UniqueIdentifier>{6b03db46-3e31-4358-88dc-52c5eccc57c9}</UniqueIdentifier>
</Filter>
<Filter Include="好友列表\群相关操作">
<UniqueIdentifier>{cb6e8977-d569-4964-b82f-3493e8e177de}</UniqueIdentifier>
</Filter>
<Filter Include="好友列表\好友列表">
<UniqueIdentifier>{6267f3a4-1be9-4758-b7a7-014ced3b6ad0}</UniqueIdentifier>
</Filter>
<Filter Include="自动功能">
<UniqueIdentifier>{9791c407-f3b4-44c9-843a-f9b5d6fdab8d}</UniqueIdentifier>
</Filter>
<Filter Include="自定义数据">
<UniqueIdentifier>{d493d5fb-ef85-41d0-9d36-6bf3bdce98c9}</UniqueIdentifier>
</Filter>
<Filter Include="自定义数据\偏移">
<UniqueIdentifier>{680edb83-20e0-4c82-86cb-c20dc4961136}</UniqueIdentifier>
</Filter>
<Filter Include="自定义数据\自定义消息">
<UniqueIdentifier>{e391b322-e0a0-4eb2-88b8-0eaa4a819d2c}</UniqueIdentifier>
</Filter>
<Filter Include="自定义数据\结构体">
<UniqueIdentifier>{05fd2c1f-b15c-4077-b8d7-3d72ac79a0e4}</UniqueIdentifier>
</Filter>
<Filter Include="公共类">
<UniqueIdentifier>{88bc72d9-339d-44e6-927b-1743ff5c1beb}</UniqueIdentifier>
</Filter>
<Filter Include="功能窗口\个人信息">
<UniqueIdentifier>{53948c82-56cf-4eca-acab-1b2031c1c890}</UniqueIdentifier>
</Filter>
<Filter Include="功能窗口\功能窗口">
<UniqueIdentifier>{60dea528-288d-4c73-9274-bc0b03f2f4f9}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="targetver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="InitWeChat.h">
<Filter>初始化微信</Filter>
</ClInclude>
<ClInclude Include="message.h">
<Filter>自定义数据\自定义消息</Filter>
</ClInclude>
<ClInclude Include="offset.h">
<Filter>自定义数据\偏移</Filter>
</ClInclude>
<ClInclude Include="WndMsgLoop.h">
<Filter>窗口消息循环</Filter>
</ClInclude>
<ClInclude Include="stdafx.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Login.h">
<Filter>登陆窗口</Filter>
</ClInclude>
<ClInclude Include="MainWindow.h">
<Filter>主窗口</Filter>
</ClInclude>
<ClInclude Include="ChatRecord.h">
<Filter>聊天记录</Filter>
</ClInclude>
<ClInclude Include="ChatRoomOperate.h">
<Filter>好友列表\群相关操作</Filter>
</ClInclude>
<ClInclude Include="FriendList.h">
<Filter>好友列表\好友列表</Filter>
</ClInclude>
<ClInclude Include="CAutoFunction.h">
<Filter>自动功能</Filter>
</ClInclude>
<ClInclude Include="data.h">
<Filter>自定义数据\结构体</Filter>
</ClInclude>
<ClInclude Include="CPublic.h">
<Filter>公共类</Filter>
</ClInclude>
<ClInclude Include="SelfInformation.h">
<Filter>功能窗口\个人信息</Filter>
</ClInclude>
<ClInclude Include="Function.h">
<Filter>功能窗口\功能窗口</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="WeChatHelper.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="dllmain.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="InitWeChat.cpp">
<Filter>初始化微信</Filter>
</ClCompile>
<ClCompile Include="WndMsgLoop.cpp">
<Filter>窗口消息循环</Filter>
</ClCompile>
<ClCompile Include="Login.cpp">
<Filter>登陆窗口</Filter>
</ClCompile>
<ClCompile Include="MainWindow.cpp">
<Filter>主窗口</Filter>
</ClCompile>
<ClCompile Include="ChatRecord.cpp">
<Filter>聊天记录</Filter>
</ClCompile>
<ClCompile Include="FriendList.cpp">
<Filter>好友列表\好友列表</Filter>
</ClCompile>
<ClCompile Include="ChatRoomOperate.cpp">
<Filter>好友列表\群相关操作</Filter>
</ClCompile>
<ClCompile Include="CAutoFunction.cpp">
<Filter>自动功能</Filter>
</ClCompile>
<ClCompile Include="CPublic.cpp">
<Filter>公共类</Filter>
</ClCompile>
<ClCompile Include="SelfInformation.cpp">
<Filter>功能窗口\个人信息</Filter>
</ClCompile>
<ClCompile Include="Function.cpp">
<Filter>功能窗口\功能窗口</Filter>
</ClCompile>
</ItemGroup>
</Project>
================================================
FILE: WeChatHelper/WeChatHelper.vcxproj.user
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
<LocalDebuggerDebuggerType>Auto</LocalDebuggerDebuggerType>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
================================================
FILE: WeChatHelper/WndMsgLoop.cpp
================================================
#include "stdafx.h"
#include "WndMsgLoop.h"
#include "InitWeChat.h"
#include "Login.h"
#include "MainWindow.h"
#include "FriendList.h"
#include "ChatRecord.h"
#include "Function.h"
#include "ChatRoomOperate.h"
#include "CAutoFunction.h"
#include "SelfInformation.h"
#include <stdio.h>
extern BOOL g_AutoChat; //Զ
//************************************************************
// : RegisterWindow
// ˵: ʼ
// : GuiShou
// ʱ : 2019/6/30
// : HMODULE hModule
// ֵ: void
//************************************************************
void InitWindow(HMODULE hModule)
{
//鵱ǰŰ汾
if (IsWxVersionValid())
{
//ȡWeChatWinĻַ
DWORD dwWeChatWinAddr = (DWORD)GetModuleHandle(L"WeChatWin.dll");
//Ƿ½
DWORD dwIsLogin = dwWeChatWinAddr + LoginSign_Offset;
if (*(DWORD*)dwIsLogin == 0) //0˵δ¼
{
//̳߳ŵ½״̬
HANDLE hThread= CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CheckIsLogin, 0, 0, NULL);
CloseHandle(hThread);
//HOOKȡбcall
HookGetFriendList();
//HOOKϢ
HookChatRecord();
//
AntiRevoke();
//HOOKȡ
//HookExtractExpression();
//עᴰ
RegisterWindow(hModule);
}
else
{
//Ѿ½ Ϣͻ
HWND hLogin = FindWindow(NULL, L"Login");
if (hLogin == NULL)
{
OutputDebugStringA("δҵLogin");
return;
}
COPYDATASTRUCT login_msg;
login_msg.dwData = WM_AlreadyLogin;
login_msg.lpData = NULL;
login_msg.cbData = 0;
//Ϣƶ
SendMessage(hLogin, WM_COPYDATA, (WPARAM)hLogin, (LPARAM)&login_msg);
}
}
else
{
MessageBoxA(NULL, "ǰŰ汾ƥ䣬WeChat 3.2.1.154", "", MB_OK);
}
}
//************************************************************
// : RegisterWindow
// ˵: עᴰ
// : GuiShou
// ʱ : 2019/6/30
// : HMODULE hModule ھ
// ֵ: void
//************************************************************
void RegisterWindow(HMODULE hModule)
{
//1 һ
WNDCLASS wnd;
wnd.style = CS_VREDRAW | CS_HREDRAW;//
wnd.lpfnWndProc = WndProc;//ڻصָ.
wnd.cbClsExtra = NULL;
wnd.cbWndExtra = NULL;
wnd.hInstance = hModule;
wnd.hIcon = NULL;
wnd.hCursor = NULL;
wnd.hbrBackground = (HBRUSH)COLOR_WINDOW;
wnd.lpszMenuName = NULL;
wnd.lpszClassName = TEXT("WeChatHelper");
//2 עᴰ
RegisterClass(&wnd);
//3
HWND hWnd = CreateWindow(
TEXT("WeChatHelper"), //
TEXT("WeChatHelper"),//
WS_OVERLAPPEDWINDOW,//ڷ
10, 10, 500, 300, //λ
NULL, //ھ
NULL, //˵
hModule, //ʵ
NULL //WM_CREATEϢʱĸӲ
);
//4 ʾ
ShowWindow(hWnd, SW_HIDE);
UpdateWindow(hWnd);
//5 ϢѭϢã
MSG msg = {};
// 5.1ȡϢ
while (GetMessage(&msg, 0, 0, 0))
{
// 5.2Ϣ
TranslateMessage(&msg);
// 5.3תϢص
DispatchMessage(&msg);
}
}
//************************************************************
// : WndProc
// ˵: ص ںͿƶͨ
// : GuiShou
// ʱ : 2019/6/30
// : HWND hWnd,UINT Message,WPARAM wParam,LPARAM lParam
// ֵ: LRESULT
//************************************************************
LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
if (Message == WM_COPYDATA)
{
COPYDATASTRUCT *pCopyData = (COPYDATASTRUCT*)lParam;
//ͨϢṹ
MessageUnion *msg = (MessageUnion*)pCopyData->lpData;
switch (pCopyData->dwData)
{
//ʾά
case WM_ShowQrPicture:
{
GotoQrCode();
HookQrCode();
}
break;
//˳
case WM_Logout:
{
LogoutWeChat();
}
break;
//ıϢ
case WM_SendTextMessage:
{
SendTextMessage(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//ļϢ
case WM_SendFileMessage:
{
SendFileMessage(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//ͼƬϢ
case WM_SendImageMessage:
{
SendImageMessage(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//ȡϢ
case WM_GetInformation:
{
GetInformation();
}
break;
//Ⱥ
case WM_SetRoomAnnouncement:
{
SetWxRoomAnnouncement(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//ɾ
case WM_DeleteUser:
{
DeleteUser((wchar_t*)pCopyData->lpData);
}
break;
//˳Ⱥ
case WM_QuitChatRoom:
{
QuitChatRoom((wchar_t*)pCopyData->lpData);
}
break;
//ȺԱ
case WM_AddGroupMember:
{
AddGroupMember(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//Ƭ
case WM_SendXmlCard:
{
SendXmlCard(msg->xmlcardmsg.RecverWxid, msg->xmlcardmsg.SendWxid, msg->xmlcardmsg.NickName);
}
break;
//ʾȺԱ
case WM_ShowChatRoomMembers:
{
ShowChatRoomUser((wchar_t*)pCopyData->lpData);
}
break;
//Ӻ
case WM_AddUser:
{
AddWxUser(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//Ⱥ
case WM_SetRoomName:
{
SetRoomName(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//Զ
case WM_AutoChat:
{
g_AutoChat = TRUE;
}
break;
//ȡԶ
case WM_CancleAutoChat:
{
g_AutoChat = FALSE;
}
break;
//ͰϢ
case WM_SendAtMsg:
{
SendRoomAtMsg(msg->atmsg.chatroomid, msg->atmsg.membermsgdata1, msg->atmsg.membernickname, msg->atmsg.msgmsgdata2);
}
break;
//ɾȺԱ
case WM_DelRoomMember:
{
DelRoomMember(msg->genericmsg.msgdata1, msg->genericmsg.msgdata2);
}
break;
//URL
case WM_OpenUrl:
{
OpenUrl((wchar_t*)pCopyData->lpData);
}
break;
default:
break;
}
}
return DefWindowProc(hWnd, Message, wParam, lParam);
}
================================================
FILE: WeChatHelper/WndMsgLoop.h
================================================
#pragma once
#include "stdafx.h"
void InitWindow(HMODULE hModule); //ʼ
void RegisterWindow(HMODULE hModule); //עᴰ
LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam); //ڻص
================================================
FILE: WeChatHelper/data.h
================================================
#pragma once
//ͨýṹ
struct GeneralStruct
{
wchar_t* pstr;
int iLen;
int iMaxLen;
int full1;
int full2;
GeneralStruct(wchar_t* pString)
{
pstr = pString;
iLen = wcslen(pString);
iMaxLen = iLen * 2;
full1 = 0;
full2 = 0;
}
};
//洢WM_COPYDATAϢͨ
union MessageUnion
{
//ͨϢṹ
struct MessageStruct
{
wchar_t msgdata1[MAX_PATH];
wchar_t msgdata2[MAX_PATH];
}genericmsg;
//ƬϢṹ
struct XmlCardMessage
{
wchar_t RecverWxid[50]; //ߵID
wchar_t SendWxid[50]; //Ҫ͵ID
wchar_t NickName[50]; //dz
}xmlcardmsg;
//ͰϢ
struct AtMsg
{
wchar_t chatroomid[50] = { 0 };
wchar_t membermsgdata1[50] = { 0 };
wchar_t membernickname[50] = { 0 };
wchar_t msgmsgdata2[100] = { 0 };
}atmsg;
//XMLϢ
struct SendXmlArticleStruct
{
wchar_t title[50];
wchar_t subtitle[50];
wchar_t urllink[200];
wchar_t picpath[260];
wchar_t selfwxid[50];
wchar_t recverwxid[50];
}xmlartmsg;
};
//ϢĽṹ
struct PersonalInformation
{
wchar_t wxid[40]; //ID
wchar_t wxcount[40]; //˺
wchar_t v1[150]; //V1
wchar_t nickname[50]; //dz
wchar_t remark[50]; //ע
wchar_t wxsex[10]; //Ա
wchar_t phonenumber[30]; //ֻ
wchar_t device[20]; //½豸
wchar_t nation[20]; //
wchar_t province[20]; //ʡ
wchar_t city[20]; //
wchar_t area[20]; //
wchar_t language[10]; //
wchar_t bigheader[0x100]; //ͷ
wchar_t smallheader[0x100]; //Сͷ
wchar_t signature[50]; //ǩ
wchar_t background[0x100]; //Ȧ
wchar_t cachedir[MAX_PATH]; //Ŀ¼
wchar_t startdir[MAX_PATH]; //Ŀ¼
};
//ıעṹ 0x22Bλñ1
struct SetRemarkStruct
{
int full1 = 0x800; //4
int full2 = 0; //8
wchar_t* UnicodeWxid; //0xC
int UnicodeWxidLen; //0x10
int UnicodeWxidMaxLen; //0x14
int full5 = 0; //0x18
int full6 = 0; //0x1C
char full3[0x34] = { 0 }; //0x20
wchar_t* Remark; //0x54
int RemarkLen; //0x58
int RemarkMaxLen; //0x5C
int full7 = 0; //0x60
int full8 = 0; //0x64
char full9[0x1C3] = { 0 }; //0x68
int full10 = 1; //0x228
char full11[0x259] = { 0 }; //0x68
};
//¼Ϣṹ
struct ChatMessageData
{
DWORD dwtype; //Ϣ
wchar_t sztype[0x20]; //Ϣ
wchar_t source[0x400]; //ϢԴ
wchar_t wxid[0x40]; //ID/ȺID
wchar_t wxname[0x200]; ///Ⱥ
wchar_t sender[0x100]; //Ϣ
wchar_t sendername[0x100]; //Ϣdz
wchar_t content[0x5000]; //Ϣ
};
//V1
struct v1Info
{
int fill = 0;
wchar_t* v1 = 0;
int v1Len;
int maxV1Len;
char fill2[0x41C] = { 0 };
DWORD v2 = { 0 };
};
//V2
struct v2Info
{
char fill[0x24C] = { 0 };
DWORD fill3 = 0x25;
char fill4[0x40] = { 0 };
wchar_t* v2;
int v2Len;
int maxV2Len;
char fill2[0x8] = { 0 };
};
//տṹ
struct CllectMoneyStruct
{
wchar_t* ptransferid;
int transferidLen;
int transferidMaxLen;
char full[0x8] = { 0 };
wchar_t* pwxid;
int wxidLen;
int wxidMaxLen;
char full2[0x8] = { 0 };
};
//ͼƬṹ
struct DwonImgStruct
{
//92C
char fill[0x14] = { 0 };
DWORD params = 0;
DWORD params1 = 0;
char fill2[0x10] = { 0 };
DWORD params2 = 0;
char fill3[0x38] = { 0 };
wchar_t * imgXml;
int xmlLen = 0;
int xmlMaxLen = 0;
char fill4[0xC8] = { 0 };
wchar_t * thumbImgPath;
int thumbLen = 0;
int thumbMaxLen = 0;
char fill5[0x8] = { 0 };
wchar_t * hImgPath;
int hImgLen = 0;
int hImgMaxLen = 0;
char fill6[0x700] = { 0 };
};
//ͨIDȡûϢṹ
struct UserInfo
{
wchar_t UserId[0x100];
wchar_t UserNumber[0x100];
wchar_t UserNickName[0x100];
};
//бϢṹ
struct UserListInfo
{
wchar_t UserId[80];
wchar_t UserNumber[80];
wchar_t UserRemark[80];
wchar_t UserNickName[80];
};
//ϸϢ
struct UserInfoDetail
{
wchar_t UserId[50]; //ID
wchar_t UserNumber[50]; //˺
wchar_t V1[200]; //V1
wchar_t Remark[50]; //ע
wchar_t UserNickName[50]; //dz
wchar_t smallHeader[1024] = { 0 }; //Сͷ
wchar_t bigHeader[1024] = { 0 }; //ͷ
};
//ȺȺIDṹ
struct RoomIdStruct
{
char fill2[0x8] = { 0 };
wchar_t* str;
int strLen = 0;
int maxLen = 0;
char fill[0x8] = { 0 };
};
================================================
FILE: WeChatHelper/dllmain.cpp
================================================
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "stdafx.h"
#include "WndMsgLoop.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
//启动线程来初始化界面
HANDLE hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)InitWindow, hModule, 0, NULL);
CloseHandle(hThread);
}
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
================================================
FILE: WeChatHelper/message.h
================================================
#pragma once
#define WM_Login 0
#define WM_ShowQrPicture 1
#define WM_Logout 2
#define WM_GetFriendList 3
#define WM_ShowChatRecord 4
#define WM_SendTextMessage 5
#define WM_SendFileMessage 6
#define WM_GetInformation 7
#define WM_SendImageMessage 8
#define WM_SetRoomAnnouncement 9
#define WM_DeleteUser 10
#define WM_QuitChatRoom 11
#define WM_AddGroupMember 12
#define WM_SendXmlCard 13
#define WM_ShowChatRoomMembers 14
#define WM_ShowChatRoomMembersDone 15
#define WM_DecryptDatabase 16
#define WM_AddUser 17
#define WM_SetRoomName 18
#define WM_AutoChat 19
#define WM_CancleAutoChat 20
#define WM_AlreadyLogin 21
#define WM_SendAtMsg 22
#define WM_DelRoomMember 23
#define WM_OpenUrl 24
#define WM_InviteGroupMember 26
#define WM_SendXmlArticle 27
#define WM_GetFriendInfomations 28
#define WM_TimerToSend 29
#define WM_CancelTimerToSend 30
#define WM_SetRemark 31
#define WM_CreateChatRoom 32
#define WM_ModifyVersion 33
#define WM_DecodeImage 34
#define WM_SendVideoMessage 35
#define WM_SendGifMessage 36
#define WM_TopMsg 37
#define WM_CancleTopMsg 38
#define WM_OpenNewMsgNotify 39
#define WM_MsgNoDisturb 40
#define WM_FollowPublicAccount 41
#define WM_KeywordsReplyOpen 43
#define WM_KeywordsReplyClose 44
#define WM_TimerID 888
//ID
#define ChatRobotWxID L"gh_f0e9306d8d03"
================================================
FILE: WeChatHelper/offset.h
================================================
#pragma once
#define WxFriendList 0x5244A8 //好友列表 1
#define WxFriendListCall 0x64550 //好友列表 1
#define WxReciveMessage 0x3DF42C //接收消息 1
#define WxReciveMessageCall 0x87A70 //接收消息 1
#define WxGoToQrCode1 0x264830 //跳转到二维码 1
#define WxGoToQrCode2 0x3ADE40 //跳转到二维码 1
#define WxQrCodeOffset 0x266AAC //获取二维码 1
#define WxQrCodeOffsetCall 0x58BD30 //获取二维码 1
#define WxSendMessage 0x3B63B0 //发送文本消息 1
#define WxLogout 0x4E7210 //退出 1
#define WxFileMessage1 0x58DA10 //发送文件消息 1
#define WxFileMessage2 0x58DA50 //发送文件消息 1
#define WxFileMessage3 0x68D00 //发送文件消息 1
#define WxFileMessage4 0x2C1960 //发送文件消息 1
#define WxFileMessageParam 0x17FFE10 //发送文件消息 1
#define WxSendImageCall3 0x58DA50 //发送图片消息 1
#define WxSendImageCall1 0x639F0 //发送图片消息 1
#define WxSendImageCall2 0x3B5C70 //发送图片消息 1
#define WxPatchAddr 0x3B2AE6 //发送图片消息 1
#define WxSetRoomAnnouncement 0x3074E0 //发送群公告 1
#define WxDeleteUser 0x325C80 //删除好友 1
#define WxQuitChatRoom 0x3045B0 //退出群聊 1
#define WxAddGroupMemberCall1 0x827B0 //添加群成员 1
#define WxAddGroupMemberCall2 0x58DB60 //添加群成员 1
#define WxAddGroupMemberCall3 0x932D0 //添加群成员 1
#define WxAddGroupMemberCall4 0x2FF220 //添加群成员 1
#define WxAddGroupMemberParam1 0x1AD1B34 //添加群成员 1
#define WxAddGroupMemberParam2 0x1AD2358 //添加群成员 1
#define WxSendXmlCard 0x3B63B0 //发送名片 1
#define WxGetRoomUserWxidCall1 0x512DD0 //获取群成员ID 1
#define WxGetRoomUserWxidCall2 0x379A90 //获取群成员ID 1
#define WxGetRoomUserWxidCall3 0x5193F0 //获取群成员ID 1
#define WxGetRoomUserWxidCall4 0x5137F0 //获取群成员ID 1
#define WxGetUserInfoWithNoNetworkCall1 0x58DDD0 //根据微信ID获取用户信息 1
#define WxGetUserInfoWithNoNetworkCall2 0x3245E0 //根据微信ID获取用户信息 1
#define WxGetUserInfoWithNoNetworkCall3 0x4FD8F0 //根据微信ID获取用户信息 1
#define WxGetUserInfoByWxidCall1 0x58DA50 //根据微信ID获取用户信息 1
#define WxGetUserInfoByWxidCall2 0x63930 //根据微信ID获取用户信息 1
#define WxGetUserInfoByWxidCall3 0x3245E0 //根据微信ID获取用户信息 1
#define WxAddWxUserParam1 0x1730C30 //添加好友 1
#define WxAddWxUserCall1 0x57860 //添加好友 1
#define WxAddWxUserCall2 0x83780 //添加好友 1
#define WxAddWxUserCall3 0x58DA10 //添加好友 1
#define WxAddWxUserCall4 0x58DA50 //添加好友 1
#define WxAddWxUserCall5 0x322B20 //添加好友 1
#define WxSetRoomName 0x303A50 //修改群名称 1
#define WxCllectMoneyCall1 0x9C5310 //收款 1
#define WxCllectMoneyCall2 0x9C5390 //收款 1
#define WxAgreeUserRequestCall1 0x1F0360 //同意好友请求 1
#define WxAgreeUserRequestCall2 0x5D860 //同意好友请求 1
#define WxAgreeUserRequestCall3 0x10FFA0 //同意好友请求 1
#define WxAgreeUserRequestCall4 0x1D7180 //同意好友请求 1
#define WxAgreeUserRequestParam 0x1AB2E98 //同意好友请求 1
#define WxGetExpressionsAddr 0x2D3C68 //提取微信表情 没啥用 去除
#define WxGetExpressionsCallAddr 0x2D7E60 //提取微信表情 没啥用 去除
#define WxDelRoomMemberCall1 0x58DA50 //删除群成员 1
#define WxDelRoomMemberCall2 0x7CD80 //删除群成员 1
#define WxDelRoomMemberCall3 0x2FF410 //删除群成员 1
#define WxOpenUrlCall1 0x58DA50 //打开浏览器 1
#define WxOpenUrlCall2 0x9C9CA0 //打开浏览器 1
#define WxPackageMsgData 0x827B0 //组装艾特消息数据结构 1
#define WxAntiRevoke 0x3DED99 //防撤回 1
//聊天记录偏移
#define MsgTypeOffset 0x30 //消息类型的偏移
#define MsgContentOffset 0x68 //消息内容的偏移
#define MsgSourceOffset 0x1B8 //消息来源的偏移
#define WxidOffset 0x40 //微信ID/群ID偏移
#define GroupMsgSenderOffset 0x164 //群消息发送者偏移
//个人信息 基址
#define WxSelfInfoBase 0x1AD1AF0 // 1
// 登陆标志位
#define LoginSign_Offset 0x1AD4858 // 1
//微信ID ASCII指针
#define WxID WxSelfInfoBase+0x44 //
//大头像 ASCII指针
#define WxBigHeader WxSelfInfoBase+0x384 //
//小头像 ASCII指针
#define WxSmallHeader WxSelfInfoBase+0x39C //
//国家 ASCII字符
#define WxNation WxSelfInfoBase+0x298 //
//微信号 ASCII字符
#define WxCount WxSelfInfoBase+0x220 //
//城市 ASCII字符
#define WxProvince WxSelfInfoBase+0x1A8 //
//地区 ASCII字符
#define WxCity WxSelfInfoBase+0x1C0 //
//手机号 ASCII字符
#define WxPhoneNumber WxSelfInfoBase+0xF0 //
//昵称 ASCII字符
#define WxNickName WxSelfInfoBase+0xBC //
//缓存目录 Unicode指针
#define WxCacheDir WxSelfInfoBase+0x10 //
//登陆设备 ASCII字符
#define WxDevice WxSelfInfoBase+0x510 //
//性别
#define WxSex WxSelfInfoBase+0x1A4 //
================================================
FILE: WeChatHelper/stdafx.cpp
================================================
#include "stdafx.h"
#include "message.h"
================================================
FILE: WeChatHelper/stdafx.h
================================================
// stdafx.h: 标准系统包含文件的包含文件,
// 或是经常使用但不常更改的
// 项目特定的包含文件
//
#pragma once
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容
// Windows 头文件
#include <windows.h>
#include <string>
#include <stdio.h>
#include "offset.h"
#include "data.h"
#include "message.h"
#include "CPublic.h"
#include <memory>
using namespace std;
// 在此处引用程序需要的其他标头
================================================
FILE: WeChatHelper/targetver.h
================================================
#pragma once
// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并
// 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
#include <SDKDDKVer.h>
================================================
FILE: WeChatRobot/CAboutAuthor.cpp
================================================
// CAboutAuthor.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CAboutAuthor.h"
#include "afxdialogex.h"
// CAboutAuthor 对话框
IMPLEMENT_DYNAMIC(CAboutAuthor, CDialogEx)
CAboutAuthor::CAboutAuthor(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_ABOUT_AUTHOR, pParent)
, m_kanxue(_T(""))
, m_wuaipojie(_T(""))
, m_csdn(_T(""))
, m_email(_T(""))
, m_github(_T(""))
{
}
CAboutAuthor::~CAboutAuthor()
{
}
void CAboutAuthor::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_kanxue);
DDX_Text(pDX, IDC_EDIT2, m_wuaipojie);
DDX_Text(pDX, IDC_EDIT3, m_csdn);
DDX_Text(pDX, IDC_EDIT4, m_email);
DDX_Text(pDX, IDC_EDIT5, m_github);
}
BEGIN_MESSAGE_MAP(CAboutAuthor, CDialogEx)
ON_WM_DESTROY()
END_MESSAGE_MAP()
// CAboutAuthor 消息处理程序
BOOL CAboutAuthor::OnInitDialog()
{
CDialogEx::OnInitDialog();
m_kanxue = L"鬼手56";
m_wuaipojie = L"鬼手56";
m_github = L"https://github.com/TonyChen56";
m_csdn = L"https://blog.csdn.net/qq_38474570";
m_email = L"tonychen56@qq.com";
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
================================================
FILE: WeChatRobot/CAboutAuthor.h
================================================
#pragma once
// CAboutAuthor 对话框
class CAboutAuthor : public CDialogEx
{
DECLARE_DYNAMIC(CAboutAuthor)
public:
CAboutAuthor(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CAboutAuthor();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_ABOUT_AUTHOR };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
CString m_kanxue;
CString m_wuaipojie;
CString m_csdn;
CString m_email;
CString m_github;
};
================================================
FILE: WeChatRobot/CAddChatRoomMember.cpp
================================================
// CAddChatRoomMember.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CAddChatRoomMember.h"
#include "afxdialogex.h"
// CAddChatRoomMember 对话框
IMPLEMENT_DYNAMIC(CAddChatRoomMember, CDialogEx)
CAddChatRoomMember::CAddChatRoomMember(LPCTSTR TempWxid, CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_ADD_MEMBER, pParent), m_ChatRoomWxid(TempWxid)
, m_wxid(_T(""))
{
}
CAddChatRoomMember::~CAddChatRoomMember()
{
}
void CAddChatRoomMember::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_ChatRoomWXID, m_wxid);
}
BEGIN_MESSAGE_MAP(CAddChatRoomMember, CDialogEx)
ON_BN_CLICKED(IDC_MAKE_SURE, &CAddChatRoomMember::OnBnClickedMakeSure)
END_MESSAGE_MAP()
//************************************************************
// 函数名称: OnBnClickedMakeSure
// 函数说明: 响应确定按钮
// 作 者: GuiShou
// 时 间: 2019/7/9
// 参 数: void
// 返 回 值: void
//***********************************************************
void CAddChatRoomMember::OnBnClickedMakeSure()
{
UpdateData(TRUE);
MessageStruct* addgroupmember = new MessageStruct(m_ChatRoomWxid, m_wxid);
//查找窗口
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT addgroupdata;
addgroupdata.dwData = WM_AddGroupMember;
addgroupdata.cbData = sizeof(MessageStruct);
addgroupdata.lpData = addgroupmember;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&addgroupdata);
delete addgroupmember;
m_wxid = "";
UpdateData(FALSE);
}
================================================
FILE: WeChatRobot/CAddChatRoomMember.h
================================================
#pragma once
// CAddChatRoomMember 对话框
class CAddChatRoomMember : public CDialogEx
{
DECLARE_DYNAMIC(CAddChatRoomMember)
public:
CAddChatRoomMember(LPCTSTR TempWxid, CWnd* pParent = nullptr); // 标准构造函数
virtual ~CAddChatRoomMember();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_ADD_MEMBER };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_wxid; //用户输入的微信ID
CString m_ChatRoomWxid; //从好友列表窗口传过来的群ID
afx_msg void OnBnClickedMakeSure();
};
================================================
FILE: WeChatRobot/CAddUser.cpp
================================================
// CAddUser.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CAddUser.h"
#include "afxdialogex.h"
// CAddUser 对话框
IMPLEMENT_DYNAMIC(CAddUser, CDialogEx)
CAddUser::CAddUser(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_ADD_USER, pParent)
, m_wxid(_T("wxid_fineonxis3f012"))
, m_content(_T("添加好友测试"))
{
}
CAddUser::~CAddUser()
{
}
void CAddUser::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_wxid);
DDX_Text(pDX, IDC_EDIT2, m_content);
}
BEGIN_MESSAGE_MAP(CAddUser, CDialogEx)
ON_BN_CLICKED(IDC_ADD_USER, &CAddUser::OnBnClickedAddUser)
END_MESSAGE_MAP()
// CAddUser 消息处理程序
//************************************************************
// 函数名称: OnBnClickedAddUser
// 函数说明: 响应添加好友按钮
// 作 者: GuiShou
// 时 间: 2019/7/13
// 参 数: void
// 返 回 值: void
//***********************************************************
void CAddUser::OnBnClickedAddUser()
{
UpdateData(TRUE);
MessageStruct* addUser = new MessageStruct(m_wxid, m_content);
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT adduserdata;
adduserdata.dwData = WM_AddUser;
adduserdata.cbData = sizeof(MessageStruct);
adduserdata.lpData = addUser;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&adduserdata);
m_wxid = "";
m_content = "";
UpdateData(FALSE);
delete addUser;
}
================================================
FILE: WeChatRobot/CAddUser.h
================================================
#pragma once
// CAddUser 对话框
class CAddUser : public CDialogEx
{
DECLARE_DYNAMIC(CAddUser)
public:
CAddUser(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CAddUser();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_ADD_USER };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_wxid;
CString m_content;
afx_msg void OnBnClickedAddUser();
};
================================================
FILE: WeChatRobot/CChatRecords.cpp
================================================
// CChatRecords.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CChatRecords.h"
#include "afxdialogex.h"
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CChatRecords.h"
#include "afxdialogex.h"
#include <iostream>
#include <string>
#include <string.h>
#include <locale.h>
#include <assert.h>
#include <afxwin.h>
#include <stdio.h>
#include <windows.h>
#include "Wininet.h"
#pragma comment(lib,"Wininet.lib")
#include <fstream>
#include <mmsystem.h> //多媒体播放所需的头文件
#pragma comment(lib,"winmm.lib") //多媒体播放所需的库文件
DWORD g_index=0;
//************************************************************
// 函数名称: string_To_UTF8
// 函数说明: string转UTF8
// 作 者: GuiShou
// 时 间: 2019/11/7
// 参 数: str 需要转换的字符串
// 返 回 值: string 转换后的字符串
//***********************************************************
std::string string_To_UTF8(const std::string & str)
{
int nwLen = ::MultiByteToWideChar(CP_ACP, 0, str.c_str(), -1, NULL, 0);
wchar_t * pwBuf = new wchar_t[nwLen + 1];//一定要加1,不然会出现尾巴
ZeroMemory(pwBuf, nwLen * 2 + 2);
::MultiByteToWideChar(CP_ACP, 0, str.c_str(), str.length(), pwBuf, nwLen);
int nLen = ::WideCharToMultiByte(CP_UTF8, 0, pwBuf, -1, NULL, NULL, NULL, NULL);
char * pBuf = new char[nLen + 1];
ZeroMemory(pBuf, nLen + 1);
::WideCharToMultiByte(CP_UTF8, 0, pwBuf, nwLen, pBuf, nLen, NULL, NULL);
std::string retStr(pBuf);
delete[]pwBuf;
delete[]pBuf;
pwBuf = NULL;
pBuf = NULL;
return retStr;
}
//************************************************************
// 函数名称: Wchar_tToString
// 函数说明: wchar转string
// 作 者: GuiShou
// 时 间: 2019/11/7
// 参 数: wchar 需要转换的字符串
// 返 回 值: string 转换后的字符串
//***********************************************************
std::string Wchar_tToString(wchar_t *wchar)
{
std::string szDst;
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的清除
return szDst;
}
//************************************************************
// 函数名称: StringToWchar_t
// 函数说明: string转wchar
// 作 者: GuiShou
// 时 间: 2019/11/7
// 参 数: str 需要转换的字符串
// 返 回 值: wchar_t* 转换后的字符串
//***********************************************************
wchar_t * StringToWchar_t(const std::string & str)
{
wchar_t * m_chatroommmsg = new wchar_t[str.size() * 2]; //
memset(m_chatroommmsg, 0, str.size() * 2);
setlocale(LC_ALL, "zh_CN.UTF-8");
swprintf(m_chatroommmsg, str.size() * 2, L"%S", str.c_str());
return m_chatroommmsg;
}
//************************************************************
// 函数名称: Log
// 函数说明: 记录聊天记录到本地
// 作 者: GuiShou
// 时 间: 2019/11/7
// 参 数: type 消息类型 wxid微信ID source消息来源 msgSender消息发送者 content消息内容
// 返 回 值: void
//***********************************************************
void Log(const std::string & type, const std::string & wxid, const std::string & source, const std::string & msgSender, const std::string & content)
{
setlocale(LC_ALL, "zh_CN.UTF-8");
time_t t = time(0);
char ch[64];
strftime(ch, sizeof(ch), "%Y-%m-%d %H-%M-%S", localtime(&t)); //年-月-日 时-分-秒
std::string times = ch;
std::string log;
if (strstr(msgSender.c_str(), "NULL") != NULL)
{
log = string_To_UTF8(
"************************ " + times + " ************************" +
"\n" + "消息类型:" + type +
"\n" + "消息来源:" + source +
"\n" + "微信昵称:" + wxid +
"\n" + "消息内容:" + content +
"\n" + "-------------------------------- 分割线 --------------------------------\n\n\n"
);
}
else
{
log = string_To_UTF8(
"************************ " + times + " ************************" +
"\n" + "消息类型:" + type +
"\n" + "消息来源:" + source +
"\n" + "群名称:" + wxid +
"\n" + "群发送者:" + msgSender +
"\n" + "消息内容:" + content +
"\n" + "-------------------------------- 分割线 --------------------------------\n\n\n"
);
}
FILE * fp = fopen("log.txt", "ab+");
fwrite(log.c_str(), log.length(), 1, fp);
fclose(fp);
}
IMPLEMENT_DYNAMIC(CChatRecords, CDialogEx)
CChatRecords::CChatRecords(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_CHAT_RECORDS, pParent)
{
}
CChatRecords::~CChatRecords()
{
}
void CChatRecords::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST1, m_ChatRecord);
}
BEGIN_MESSAGE_MAP(CChatRecords, CDialogEx)
ON_WM_COPYDATA()
ON_MESSAGE(WM_ShowMessage, &CChatRecords::OnShowmessage)
END_MESSAGE_MAP()
// CChatRecords 消息处理程序
BOOL CChatRecords::OnInitDialog()
{
CDialogEx::OnInitDialog();
m_ChatRecord.InsertColumn(0, L"消息类型", 0, 100);
m_ChatRecord.InsertColumn(1, L"消息来源", 0, 100);
m_ChatRecord.InsertColumn(2, L"微信昵称/群名称", 0, 150);
m_ChatRecord.InsertColumn(3, L"群发送者", 0, 150);
m_ChatRecord.InsertColumn(4, L"消息内容", 0, 465);
m_ChatRecord.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
//************************************************************
// 函数名称: OnShowmessage
// 函数说明: 响应Showmessage消息 处理父窗口发过来的消息
// 作 者: GuiShou
// 时 间: 2019/7/6
// 参 数: WPARAM wParam, LPARAM lParam
// 返 回 值: BOOL
//***********************************************************
afx_msg LRESULT CChatRecords::OnShowmessage(WPARAM wParam, LPARAM lParam)
{
//取数据
ChatMessageData *msg = (ChatMessageData*)wParam;
//显示到控件
m_ChatRecord.InsertItem(g_index, msg->sztype);
m_ChatRecord.SetItemText(g_index, 1, msg->source);
m_ChatRecord.SetItemText(g_index, 2, msg->wxname);
m_ChatRecord.SetItemText(g_index, 3, msg->sendername);
m_ChatRecord.SetItemText(g_index, 4, msg->content);
//保存聊天记录到本地
std::string type = Wchar_tToString(msg->sztype);
std::string wxid = Wchar_tToString(msg->wxname);
std::string source = Wchar_tToString(msg->source);
std::string msgSender = Wchar_tToString(msg->sendername);
std::string content = Wchar_tToString(msg->content);
Log(type.c_str(), wxid.c_str(), source.c_str(), msgSender.c_str(), content.c_str());
return 0;
}
================================================
FILE: WeChatRobot/CChatRecords.h
================================================
#pragma once
// CChatRecords 对话框
class CChatRecords : public CDialogEx
{
DECLARE_DYNAMIC(CChatRecords)
public:
CChatRecords(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CChatRecords();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_CHAT_RECORDS };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CListCtrl m_ChatRecord;
virtual BOOL OnInitDialog();
protected:
afx_msg LRESULT OnShowmessage(WPARAM wParam, LPARAM lParam);
};
================================================
FILE: WeChatRobot/CChatRoomMember.cpp
================================================
// CChatRoomMember.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CChatRoomMember.h"
#include "afxdialogex.h"
#include "CSendChatRoomAt.h"
wchar_t memberwxid[50] = { 0 }; //群成员的微信ID
wchar_t membernickname[50] = { 0 }; //群成员的微信昵称
int nSelected = 0; //选中行的行号
// CChatRoomMember 对话框
IMPLEMENT_DYNAMIC(CChatRoomMember, CDialogEx)
CChatRoomMember::CChatRoomMember(LPCTSTR TempWxid, CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_CHATROOM_MEMBER, pParent), m_ChatRoomWxid(TempWxid)
{
}
CChatRoomMember::~CChatRoomMember()
{
}
void CChatRoomMember::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_LIST1, m_ChatRoomMembers);
}
BEGIN_MESSAGE_MAP(CChatRoomMember, CDialogEx)
ON_WM_COPYDATA()
ON_NOTIFY(NM_CLICK, IDC_LIST1, &CChatRoomMember::OnClickList1)
ON_NOTIFY(NM_RCLICK, IDC_LIST1, &CChatRoomMember::OnRclickList1)
ON_COMMAND(ID_32795, &CChatRoomMember::OnSendChatRoomAt)
ON_COMMAND(ID_32796, &CChatRoomMember::OnCopyWxid)
ON_COMMAND(ID_32797, &CChatRoomMember::OnDelRoomMember)
END_MESSAGE_MAP()
// CChatRoomMember 消息处理程序
BOOL CChatRoomMember::OnInitDialog()
{
CDialogEx::OnInitDialog();
m_ChatRoomMembers.InsertColumn(0, L"序号", 0, 100);
m_ChatRoomMembers.InsertColumn(1, L"微信ID", 0, 200);
m_ChatRoomMembers.InsertColumn(2, L"微信号", 0, 200);
m_ChatRoomMembers.InsertColumn(3, L"昵称", 0, 200);
m_ChatRoomMembers.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
//拷贝群成员微信ID
wchar_t memberwxid[50] = { 0 };
wcscpy_s(memberwxid, wcslen(m_ChatRoomWxid) + 1, m_ChatRoomWxid);
//查找窗口
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT show_members;
show_members.dwData = WM_ShowChatRoomMembers;
show_members.cbData = (wcslen(memberwxid) + 1) * 2;
show_members.lpData = memberwxid;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&show_members);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
BOOL CChatRoomMember::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
static DWORD dwIndex = 0;
if (pCopyDataStruct->dwData == WM_ShowChatRoomMembers)
{
ChatRoomMemberInfo *user = (ChatRoomMemberInfo*)pCopyDataStruct->lpData;
CString index;
index.Format(L"%d", dwIndex+1);
//显示序号
m_ChatRoomMembers.InsertItem(dwIndex, index);
//显示微信ID
m_ChatRoomMembers.SetItemText(dwIndex, 1, user->UserId);
//显示微信号
m_ChatRoomMembers.SetItemText(dwIndex, 2, user->UserNumber);
//显示微信昵称
m_ChatRoomMembers.SetItemText(dwIndex, 3, user->UserNickName);
dwIndex++;
}
else if (pCopyDataStruct->dwData == WM_ShowChatRoomMembersDone)
{
//把序号清零
dwIndex = 0;
}
return CDialogEx::OnCopyData(pWnd, pCopyDataStruct);
}
//************************************************************
// 函数名称: OnRclickFriendlist
// 函数说明: 响应List控件的左键点击消息
// 作 者: GuiShou
// 时 间: 2019/7/23
// 参 数: pNMHDR pResult
// 返 回 值: void
//***********************************************************
void CChatRoomMember::OnClickList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
//拿到微信ID和微信昵称
memcpy(memberwxid, m_ChatRoomMembers.GetItemText(pNMItemActivate->iItem, 1), 40);
memcpy(membernickname, m_ChatRoomMembers.GetItemText(pNMItemActivate->iItem, 3), 40);
POSITION p = m_ChatRoomMembers.GetFirstSelectedItemPosition(); //获取选中行位置
nSelected = m_ChatRoomMembers.GetNextSelectedItem(p); //获取选中行的索引
*pResult = 0;
}
//************************************************************
// 函数名称: OnRclickList1
// 函数说明: 响应List控件的右键点击消息
// 作 者: GuiShou
// 时 间: 2019/7/23
// 参 数: pNMHDR pResult
// 返 回 值: void
//***********************************************************
void CChatRoomMember::OnRclickList1(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
//弹出好友相关的菜单
CMenu m_Menu, *tMenu;
m_Menu.LoadMenu(IDR_MENU2);
//拿到第0个下拉菜单(菜单可能有很多列 这个函数是拿到第几列)
tMenu = m_Menu.GetSubMenu(2);
//获取鼠标位置
CPoint pt;
GetCursorPos(&pt);
//弹出菜单
TrackPopupMenu(tMenu->m_hMenu, TPM_LEFTALIGN, pt.x, pt.y, 0, m_hWnd, 0);
*pResult = 0;
}
//************************************************************
// 函数名称: OnSendChatRoomAt
// 函数说明: 发送艾特消息
// 作 者: GuiShou
// 时 间: 2019/7/23
// 参 数: void
// 返 回 值: void
//***********************************************************
void CChatRoomMember::OnSendChatRoomAt()
{
unique_ptr<CSendChatRoomAt> sendat(new CSendChatRoomAt(memberwxid, membernickname, m_ChatRoomWxid));
sendat->DoModal();
}
//************************************************************
// 函数名称: OnCopyWxid
// 函数说明: 复制微信ID
// 作 者: GuiShou
// 时 间: 2019/7/25
// 参 数: void
// 返 回 值: void
//***********************************************************
void CChatRoomMember::OnCopyWxid()
{
CString strText = memberwxid;
//复制剪切板
if (!strText.IsEmpty())
{
if (OpenClipboard())
{
TCHAR* pszData;
HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, (strText.GetLength() + 1) * sizeof(TCHAR));
if (hClipboardData)
{
pszData = (TCHAR*)GlobalLock(hClipboardData);
_tcscpy_s(pszData, wcslen(strText) + 1, strText);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);//根据相应的数据选择第一个参数,(CF_TEXT)
}
CloseClipboard();
}
}
}
//************************************************************
// 函数名称: OnDelRoomMember
// 函数说明: 删除群成员
// 作 者: GuiShou
// 时 间: 2019/7/26
// 参 数: void
// 返 回 值: void
//***********************************************************
void CChatRoomMember::OnDelRoomMember()
{
if (MessageBoxA(NULL, "是否删除群成员", "Tip", MB_YESNO))
{
MessageStruct* pMember = new MessageStruct(m_ChatRoomWxid, memberwxid);
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT delmemberdata;
delmemberdata.dwData = WM_DelRoomMember;
delmemberdata.cbData = sizeof(MessageStruct);
delmemberdata.lpData = pMember;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&delmemberdata);
delete pMember;
//删除选中行
m_ChatRoomMembers.DeleteItem(nSelected); //根据索引删除
}
}
================================================
FILE: WeChatRobot/CChatRoomMember.h
================================================
#pragma once
// CChatRoomMember 对话框
class CChatRoomMember : public CDialogEx
{
DECLARE_DYNAMIC(CChatRoomMember)
public:
CChatRoomMember(LPCTSTR TempWxid, CWnd* pParent = nullptr); // 标准构造函数
virtual ~CChatRoomMember();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_CHATROOM_MEMBER };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_ChatRoomWxid; //从好友列表窗口传过来的群ID
CListCtrl m_ChatRoomMembers;
virtual BOOL OnInitDialog();
afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
afx_msg void OnClickList1(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnRclickList1(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnSendChatRoomAt();
afx_msg void OnCopyWxid();
afx_msg void OnDelRoomMember();
};
================================================
FILE: WeChatRobot/CCreateChatRoom.cpp
================================================
// CCreateChatRoom.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CCreateChatRoom.h"
#include "afxdialogex.h"
IMPLEMENT_DYNAMIC(CCreateChatRoom, CDialogEx)
CCreateChatRoom::CCreateChatRoom(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_CreateChatRoom, pParent)
, m_wxid1(_T(""))
, m_wxid2(_T(""))
{
}
CCreateChatRoom::~CCreateChatRoom()
{
}
void CCreateChatRoom::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_wxid1);
DDX_Text(pDX, IDC_EDIT2, m_wxid2);
}
BEGIN_MESSAGE_MAP(CCreateChatRoom, CDialogEx)
ON_BN_CLICKED(IDC_CreateChatRoom, &CCreateChatRoom::OnBnClickedCreatechatroom)
END_MESSAGE_MAP()
// CCreateChatRoom 消息处理程序
//************************************************************
// 函数名称: OnBnClickedCreatechatroom
// 函数说明: 创建群聊
// 作 者: GuiShou
// 时 间: 2019/10/22
// 参 数: void
// 返 回 值: void
//***********************************************************
void CCreateChatRoom::OnBnClickedCreatechatroom()
{
}
================================================
FILE: WeChatRobot/CCreateChatRoom.h
================================================
#pragma once
// CCreateChatRoom 对话框
class CCreateChatRoom : public CDialogEx
{
DECLARE_DYNAMIC(CCreateChatRoom)
public:
CCreateChatRoom(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CCreateChatRoom();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_CreateChatRoom };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_wxid1;
CString m_wxid2;
afx_msg void OnBnClickedCreatechatroom();
};
================================================
FILE: WeChatRobot/CDecryptImage.cpp
================================================
// CDecryptImage.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CDecryptImage.h"
#include "afxdialogex.h"
#include <stdio.h>
#include <atlconv.h>
#include <direct.h>
// CDecryptImage 对话框
IMPLEMENT_DYNAMIC(CDecryptImage, CDialogEx)
CDecryptImage::CDecryptImage(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_DECRYPT_IMAGE, pParent)
, m_ImagePath(_T(""))
, m_ImageDirectory(_T("C:\\Users\\XXX\\Documents\\WeChat Files\\微信ID\\FileStorage\\Image\\日期\\(只是个图片目录 告诉你在哪 别特么改!)"))
, m_key(_T(""))
{
}
CDecryptImage::~CDecryptImage()
{
}
void CDecryptImage::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_ImagePath);
DDX_Text(pDX, IDC_EDIT2, m_ImageDirectory);
DDX_Text(pDX, IDC_EDIT6, m_key);
}
BEGIN_MESSAGE_MAP(CDecryptImage, CDialogEx)
ON_BN_CLICKED(IDC_DecryptImage, &CDecryptImage::OnBnClickedDecryptimage)
ON_WM_DROPFILES()
END_MESSAGE_MAP()
// CDecryptImage 消息处理程序
BOOL CDecryptImage::OnInitDialog()
{
CDialogEx::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
//************************************************************
// 函数名称: OnBnClickedRadio1
// 函数说明: 响应点击解密按钮
// 作 者: GuiShou
// 时 间: 2019/7/8
// 参 数: void
// 返 回 值: void
//***********************************************************
void CDecryptImage::OnBnClickedDecryptimage()
{
UpdateData(TRUE);
//检查文件是否存在
if (GetFileAttributes(m_ImagePath) == INVALID_FILE_ATTRIBUTES)
{
MessageBox(L"图片不存在 请重试");
return;
}
//检测密钥是否存在
if (m_key == "")
{
MessageBox(L"密钥不能为空 请重试");
return;
}
//打开文件
HANDLE hFile = CreateFileW(m_ImagePath, GENERIC_ALL, NULL, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
MessageBoxA(NULL, "打开文件失败", "错误", 0);
return;
}
//获取文件大小
DWORD dwSize = GetFileSize(hFile, NULL);
//根据文件大小申请空间
char *lpBuff = new char[dwSize] {0};
//读取文件到内存
if (ReadFile(hFile, lpBuff, dwSize, NULL, NULL) == 0)
{
MessageBoxA(NULL, "读取文件失败", "错误", 0);
return;
}
unsigned int hexkey = 0;
USES_CONVERSION;
sscanf_s(W2A(m_key), "%x", &hexkey);
//循环异或
for (DWORD i = 0; i < dwSize; i++)
{
lpBuff[i] ^= hexkey;
}
//关闭句柄
CloseHandle(hFile);
wchar_t NewFilePath[MAX_PATH] = { 0 };
wcscpy_s(NewFilePath, wcslen(m_ImagePath) + 1, m_ImagePath);
for (DWORD i = wcslen(m_ImagePath); i > wcslen(m_ImagePath) - 4; i--)
{
NewFilePath[i] = 0;
}
wcscat_s(NewFilePath, L"png");
//打开文件
HANDLE hNewFile = CreateFileW(NewFilePath, GENERIC_ALL, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hNewFile == INVALID_HANDLE_VALUE)
{
MessageBoxA(NULL, "创建文件失败", "错误", 0);
return;
}
WriteFile(hNewFile, lpBuff, dwSize, NULL, NULL);
CloseHandle(hNewFile);
MessageBoxA(NULL, "解密成功 请在同目录下查看", "Tip", MB_OK);
m_ImagePath = "";
UpdateData(FALSE);
}
//************************************************************
// 函数名称: OnDropFiles
// 函数说明: 响应拖拽文件
// 作 者: GuiShou
// 时 间: 2019/7/8
// 参 数: HDROP hDropInfo 拖拽文件句柄
// 返 回 值: void
//************************************************************
void CDecryptImage::OnDropFiles(HDROP hDropInfo)
{
//获取文件路径
TCHAR szPath[MAX_PATH] = { 0 };
DragQueryFile(hDropInfo, 0, szPath, MAX_PATH);
//显示到控件
m_ImagePath = szPath;
UpdateData(FALSE);
CDialogEx::OnDropFiles(hDropInfo);
}
================================================
FILE: WeChatRobot/CDecryptImage.h
================================================
#pragma once
// CDecryptImage 对话框
class CDecryptImage : public CDialogEx
{
DECLARE_DYNAMIC(CDecryptImage)
public:
CDecryptImage(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CDecryptImage();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_DECRYPT_IMAGE };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedDecryptimage();
afx_msg void OnDropFiles(HDROP hDropInfo);
CString m_ImagePath;
CString m_ImageDirectory;
virtual BOOL OnInitDialog();
CString m_key;
};
================================================
FILE: WeChatRobot/CFollowAccount.cpp
================================================
// CFollowAccount.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CFollowAccount.h"
#include "afxdialogex.h"
// CFollowAccount 对话框
IMPLEMENT_DYNAMIC(CFollowAccount, CDialogEx)
CFollowAccount::CFollowAccount(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_FollowAccount, pParent)
, m_accountid(_T("gh_f014862b32a9"))
{
}
CFollowAccount::~CFollowAccount()
{
}
void CFollowAccount::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_accountid);
}
BEGIN_MESSAGE_MAP(CFollowAccount, CDialogEx)
ON_BN_CLICKED(IDC_FOLLOW, &CFollowAccount::OnBnClickedFollow)
END_MESSAGE_MAP()
// CFollowAccount 消息处理程序
//************************************************************
// 函数名称: OnBnClickedFollow
// 函数说明: 关注公众号
// 作 者: GuiShou
// 时 间: 2019/11/19
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFollowAccount::OnBnClickedFollow()
{
}
================================================
FILE: WeChatRobot/CFollowAccount.h
================================================
#pragma once
// CFollowAccount 对话框
class CFollowAccount : public CDialogEx
{
DECLARE_DYNAMIC(CFollowAccount)
public:
CFollowAccount(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CFollowAccount();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_FollowAccount };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_accountid;
afx_msg void OnBnClickedFollow();
};
================================================
FILE: WeChatRobot/CFriendInfo.cpp
================================================
// CFriendInfo.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CFriendInfo.h"
#include "afxdialogex.h"
// CFriendInfo 对话框
IMPLEMENT_DYNAMIC(CFriendInfo, CDialogEx)
CFriendInfo::CFriendInfo(LPCTSTR TempWxid, CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_FRIENDINFO, pParent), m_Wxid(TempWxid)
, m_wxid(_T(""))
, m_wxnumber(_T(""))
, m_wxv1(_T(""))
, m_wxremark(_T(""))
, m_wxnickname(_T(""))
, wxsmallheader(_T(""))
, wxbigheader(_T(""))
{
}
CFriendInfo::~CFriendInfo()
{
}
void CFriendInfo::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_wxid);
DDX_Text(pDX, IDC_EDIT2, m_wxnumber);
DDX_Text(pDX, IDC_EDIT6, m_wxv1);
DDX_Text(pDX, IDC_EDIT7, m_wxremark);
DDX_Text(pDX, IDC_EDIT8, m_wxnickname);
DDX_Text(pDX, IDC_EDIT9, wxsmallheader);
DDX_Text(pDX, IDC_EDIT10, wxbigheader);
}
BEGIN_MESSAGE_MAP(CFriendInfo, CDialogEx)
ON_WM_COPYDATA()
END_MESSAGE_MAP()
// CFriendInfo 消息处理程序
BOOL CFriendInfo::OnInitDialog()
{
CDialogEx::OnInitDialog();
return TRUE;
}
//************************************************************
// 函数名称: OnCopyData
// 函数说明: 响应CopyData消息
// 作 者: GuiShou
// 时 间: 2019/10/9
// 参 数: CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct
// 返 回 值: BOOL
//***********************************************************
BOOL CFriendInfo::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
return CDialogEx::OnCopyData(pWnd, pCopyDataStruct);
}
================================================
FILE: WeChatRobot/CFriendInfo.h
================================================
#pragma once
// CFriendInfo 对话框
class CFriendInfo : public CDialogEx
{
DECLARE_DYNAMIC(CFriendInfo)
public:
CFriendInfo(LPCTSTR TempWxid, CWnd* pParent = nullptr); // 标准构造函数
virtual ~CFriendInfo();
CString m_Wxid; //从好友列表窗口传过来的微信ID
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_FRIENDINFO };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
CString m_wxid;
CString m_wxnumber;
CString m_wxv1;
CString m_wxremark;
CString m_wxnickname;
CString wxsmallheader;
CString wxbigheader;
afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
};
================================================
FILE: WeChatRobot/CFriendList.cpp
================================================
// CFriendList.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CFriendList.h"
#include "afxdialogex.h"
#include "CSendMsg.h"
#include "CRoomAnnouncement.h"
#include "CAddChatRoomMember.h"
#include "CSendXmlCard.h"
#include "CChatRoomMember.h"
#include "CSetRoomName.h"
#include "CInviteGroupMember.h"
#include "CFriendInfo.h"
#include "CSetRemark.h"
#include <time.h>
#include <vector>
#include <fstream>
#include <atlconv.h>
#include <map>
DWORD dwIndex = 0;
wchar_t wxid[50]; //鼠标左键点击时拿到的微信ID
vector<CString> g_wxidvector; //保存微信ID的容器
//是否关注聊天机器人
BOOL isAttentTuLing = FALSE;
IMPLEMENT_DYNAMIC(CFriendList, CDialogEx)
CFriendList::CFriendList(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_FRIEND_LIST, pParent)
, m_GroupSendText(_T(""))
{
}
CFriendList::~CFriendList()
{
}
void CFriendList::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_FRIENDLIST, m_FriendList);
DDX_Text(pDX, IDC_EDIT1, m_GroupSendText);
}
BEGIN_MESSAGE_MAP(CFriendList, CDialogEx)
ON_WM_COPYDATA()
ON_MESSAGE(WM_ShowFriendList, &CFriendList::OnShowfriendlist)
ON_NOTIFY(NM_RCLICK, IDC_FRIENDLIST, &CFriendList::OnRclickFriendlist)
ON_NOTIFY(NM_CLICK, IDC_FRIENDLIST, &CFriendList::OnClickFriendlist)
ON_COMMAND(ID_32780, &CFriendList::OnSendMsg)
ON_COMMAND(ID_32784, &CFriendList::OnSetRoomAnnouncement)
ON_COMMAND(ID_32782, &CFriendList::OnCopyWxid)
ON_COMMAND(ID_32785, &CFriendList::OnCopyWxid)
ON_COMMAND(ID_32781, &CFriendList::OnDeleteUser)
ON_COMMAND(ID_32786, &CFriendList::OnQuitChatRoom)
ON_COMMAND(ID_32787, &CFriendList::OnAddGroupMember)
ON_COMMAND(ID_32783, &CFriendList::OnSendMsg)
ON_COMMAND(ID_32788, &CFriendList::OnSendXmlCard)
ON_COMMAND(ID_32789, &CFriendList::OnShowChatRoomMember)
ON_COMMAND(ID_32790, &CFriendList::OnSetRoomName)
ON_COMMAND(ID_32799, &CFriendList::OnInviteGroupMember)
ON_COMMAND(ID_32804, &CFriendList::OnGetFriendInfo)
ON_BN_CLICKED(IDC_CheckAll, &CFriendList::OnBnClickedCheckall)
ON_BN_CLICKED(IDC_ReverseChoose, &CFriendList::OnBnClickedReversechoose)
ON_BN_CLICKED(IDC_CancelAll, &CFriendList::OnBnClickedCancelall)
ON_BN_CLICKED(IDC_GroupSend, &CFriendList::OnBnClickedGroupsend)
ON_COMMAND(ID_32805, &CFriendList::OnSetRemark)
ON_COMMAND(ID_32808, &CFriendList::OnTopMsg)
ON_COMMAND(ID_32810, &CFriendList::OnTopMsg)
ON_COMMAND(ID_32809, &CFriendList::OnCancleTopMsg)
ON_COMMAND(ID_32811, &CFriendList::OnCancleTopMsg)
ON_COMMAND(ID_32812, &CFriendList::OnOpenNewMsgNotify)
ON_COMMAND(ID_32814, &CFriendList::OnOpenNewMsgNotify)
ON_COMMAND(ID_32813, &CFriendList::OnMsgNoDisturb)
ON_COMMAND(ID_32815, &CFriendList::OnMsgNoDisturb)
ON_MESSAGE(SaveFriendList, &CFriendList::OnSavefriendlist)
END_MESSAGE_MAP()
// CFriendList 消息处理程序
BOOL CFriendList::OnInitDialog()
{
CDialogEx::OnInitDialog();
m_FriendList.InsertColumn(0, L"序号", 0, 50);
m_FriendList.InsertColumn(1, L"微信ID", 0, 200);
m_FriendList.InsertColumn(2, L"微信号", 0, 200);
m_FriendList.InsertColumn(3, L"昵称", 0, 250);
m_FriendList.InsertColumn(4, L"备注", 0, 253);
m_FriendList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES| LVS_EX_CHECKBOXES);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
//************************************************************
// 函数名称: OnShowfriendlist
// 函数说明: 响应Showfriendlist消息 处理父窗口发过来的联系人
// 作 者: GuiShou
// 时 间: 2019/7/5
// 参 数: WPARAM wParam, LPARAM lParam
// 返 回 值: BOOL
//***********************************************************
afx_msg LRESULT CFriendList::OnShowfriendlist(WPARAM wParam, LPARAM lParam)
{
//取数据
UserInfo* userinfo = (UserInfo*)wParam;
CString index;
index.Format(L"%d",dwIndex+1);
//显示到List控件
//检测联系人列表中是否有聊天机器人
if (StrCmpW(userinfo->UserId,ChatRobotWxID)==0)
{
isAttentTuLing = TRUE;
}
m_FriendList.InsertItem(dwIndex, index);
m_FriendList.SetItemText(dwIndex, 1, userinfo->UserId);
m_FriendList.SetItemText(dwIndex, 2, userinfo->UserNumber);
m_FriendList.SetItemText(dwIndex, 3, userinfo->UserNickName);
m_FriendList.SetItemText(dwIndex, 4, userinfo->UserRemark);
dwIndex++;
return 0;
}
//************************************************************
// 函数名称: OnRclickFriendlist
// 函数说明: 响应List控件的右键点击消息
// 作 者: GuiShou
// 时 间: 2019/7/6
// 参 数: WPARAM wParam, LPARAM lParam
// 返 回 值: void
//***********************************************************
void CFriendList::OnRclickFriendlist(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
//判断选中的是群ID还是个人微信ID
if (StrStrW(wxid, L"chatroom") == NULL)
{
//弹出好友相关的菜单
CMenu m_Menu, *tMenu;
m_Menu.LoadMenu(IDR_MENU2);
//拿到第0个下拉菜单(菜单可能有很多列 这个函数是拿到第几列)
tMenu = m_Menu.GetSubMenu(0);
//获取鼠标位置
CPoint pt;
GetCursorPos(&pt);
//弹出菜单
TrackPopupMenu(tMenu->m_hMenu, TPM_LEFTALIGN, pt.x, pt.y, 0, m_hWnd, 0);
}
else
{
//弹出群相关的菜单
CMenu m_Menu, *tMenu;
m_Menu.LoadMenu(IDR_MENU2);
//拿到第0个下拉菜单(菜单可能有很多列 这个函数是拿到第几列)
tMenu = m_Menu.GetSubMenu(1);
//获取鼠标位置
CPoint pt;
GetCursorPos(&pt);
//弹出菜单
TrackPopupMenu(tMenu->m_hMenu, TPM_LEFTALIGN, pt.x, pt.y, 0, m_hWnd, 0);
}
*pResult = 0;
}
//************************************************************
// 函数名称: OnRclickFriendlist
// 函数说明: 响应List控件的左键点击消息
// 作 者: GuiShou
// 时 间: 2019/7/6
// 参 数: pNMHDR pResult
// 返 回 值: void
//***********************************************************
void CFriendList::OnClickFriendlist(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
//拿到微信ID
memcpy(wxid, m_FriendList.GetItemText(pNMItemActivate->iItem, 1), 40);
*pResult = 0;
}
//************************************************************
// 函数名称: OnSendMsg
// 函数说明: 响应发送消息菜单
// 作 者: GuiShou
// 时 间: 2019/7/6
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnSendMsg()
{
//利用构造函数把选中的微信ID传过去
unique_ptr<CSendMsg> pSendmsg(new CSendMsg(wxid));
pSendmsg->DoModal();
}
//************************************************************
// 函数名称: OnSendMsg
// 函数说明: 响应发送群公告菜单
// 作 者: GuiShou
// 时 间: 2019/7/7
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnSetRoomAnnouncement()
{
//利用构造函数把选中的群ID传过去
unique_ptr<CRoomAnnouncement> pRoom(new CRoomAnnouncement(wxid));
pRoom->DoModal();
}
//************************************************************
// 函数名称: OnCopyWxid
// 函数说明: 响应复制微信ID菜单
// 作 者: GuiShou
// 时 间: 2019/7/8
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnCopyWxid()
{
CString strText= wxid;
//复制剪切板
if (!strText.IsEmpty())
{
if (OpenClipboard())
{
TCHAR* pszData;
HGLOBAL hClipboardData = GlobalAlloc(GMEM_DDESHARE, (strText.GetLength() + 1) * sizeof(TCHAR));
if (hClipboardData)
{
pszData = (TCHAR*)GlobalLock(hClipboardData);
_tcscpy_s(pszData, wcslen(strText) + 1, strText);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_UNICODETEXT, hClipboardData);//根据相应的数据选择第一个参数,(CF_TEXT)
}
CloseClipboard();
}
}
}
//************************************************************
// 函数名称: OnDeleteUser
// 函数说明: 响应删除好友菜单
// 作 者: GuiShou
// 时 间: 2019/7/9
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnDeleteUser()
{
if (MessageBoxA(NULL, "是否删除好友", "Tip", MB_YESNO)==IDYES)
{
if (wcscmp(wxid,L"filehelper")==0)
{
MessageBoxA(NULL, "无法删除filehelper", "Tip", MB_OK);
return;
}
//查找窗口
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT deleteuser;
deleteuser.dwData = WM_DeleteUser;
deleteuser.cbData = (wcslen(wxid)+1)*2;
deleteuser.lpData = wxid;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&deleteuser);
//删除选中行
POSITION pos = m_FriendList.GetFirstSelectedItemPosition();
int nItem = m_FriendList.GetNextSelectedItem(pos);
m_FriendList.DeleteItem(nItem);
}
}
//************************************************************
// 函数名称: OnQuiteChatRoom
// 函数说明: 响应退出群聊菜单
// 作 者: GuiShou
// 时 间: 2019/7/9
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnQuitChatRoom()
{
if (MessageBoxA(NULL, "是否退出群聊", "Tip", MB_YESNO))
{
//查找窗口
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT quitchatroom;
quitchatroom.dwData = WM_QuitChatRoom;
quitchatroom.cbData = (wcslen(wxid) + 1) * 2;
quitchatroom.lpData = wxid;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&quitchatroom);
//删除选中行
POSITION pos = m_FriendList.GetFirstSelectedItemPosition();
int nItem = m_FriendList.GetNextSelectedItem(pos);
m_FriendList.DeleteItem(nItem);
}
}
//************************************************************
// 函数名称: OnAddGroupMember
// 函数说明: 响应邀请群成员(50人以下)
// 作 者: GuiShou
// 时 间: 2019/7/9
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnAddGroupMember()
{
unique_ptr<CAddChatRoomMember> addmember(new CAddChatRoomMember(wxid));
addmember->DoModal();
}
//************************************************************
// 函数名称: OnSendRoomMessage
// 函数说明: 响应发送xml名片菜单
// 作 者: GuiShou
// 时 间: 2019/7/10
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnSendXmlCard()
{
unique_ptr<CSendXmlCard> sendcard(new CSendXmlCard(wxid));
sendcard->DoModal();
}
//************************************************************
// 函数名称: OnShowChatRoomMember
// 函数说明: 响应查看群成员菜单
// 作 者: GuiShou
// 时 间: 2019/7/13
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnShowChatRoomMember()
{
unique_ptr<CChatRoomMember> chatroommember(new CChatRoomMember(wxid));
chatroommember->DoModal();
}
//************************************************************
// 函数名称: OnSetRoomName
// 函数说明: 响应修改群名称菜单
// 作 者: GuiShou
// 时 间: 2019/7/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnSetRoomName()
{
unique_ptr<CSetRoomName> pSetroomname(new CSetRoomName(wxid));
pSetroomname->DoModal();
}
//************************************************************
// 函数名称: OnInviteGroupMember
// 函数说明: 响应邀请群成员(50人以上)
// 作 者: GuiShou
// 时 间: 2019/9/19
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnInviteGroupMember()
{
unique_ptr<CInviteGroupMember> Invitemember(new CInviteGroupMember(wxid));
Invitemember->DoModal();
}
//************************************************************
// 函数名称: OnGetFriendInfo
// 函数说明: 响应查看好友信息菜单
// 作 者: GuiShou
// 时 间: 2019/10/9
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnGetFriendInfo()
{
}
//************************************************************
// 函数名称: OnBnClickedCheckall
// 函数说明: 全选
// 作 者: GuiShou
// 时 间: 2019/10/18
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnBnClickedCheckall()
{
for (int i = 0; i < m_FriendList.GetItemCount(); i++)
{
m_FriendList.SetCheck(i, TRUE);
}
}
//************************************************************
// 函数名称: OnBnClickedReversechoose
// 函数说明: 反选
// 作 者: GuiShou
// 时 间: 2019/10/18
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnBnClickedReversechoose()
{
for (int i = 0; i < m_FriendList.GetItemCount(); i++)
{
if (m_FriendList.GetCheck(i) == FALSE) //未被选中的
{
m_FriendList.SetCheck(i, TRUE);
}
else //选中的
{
m_FriendList.SetCheck(i, FALSE);
}
}
}
//************************************************************
// 函数名称: OnBnClickedCancelall
// 函数说明: 取消
// 作 者: GuiShou
// 时 间: 2019/10/18
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnBnClickedCancelall()
{
for (int i = 0; i < m_FriendList.GetItemCount(); i++)
{
m_FriendList.SetCheck(i, FALSE);
}
}
//************************************************************
// 函数名称: OnBnClickedGroupsend
// 函数说明: 群发
// 作 者: GuiShou
// 时 间: 2019/10/18
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnBnClickedGroupsend()
{
}
//************************************************************
// 函数名称: OnSetRemark
// 函数说明: 响应修改备注菜单
// 作 者: GuiShou
// 时 间: 2019/10/21
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnSetRemark()
{
}
//************************************************************
// 函数名称: OnTopMsg
// 函数说明: 响应置顶菜单
// 作 者: GuiShou
// 时 间: 2019/11/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnTopMsg()
{
}
//************************************************************
// 函数名称: OnCancleTopMsg
// 函数说明: 响应取消置顶菜单
// 作 者: GuiShou
// 时 间: 2019/11/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnCancleTopMsg()
{
}
//************************************************************
// 函数名称: OnOpenNewMsgNotify
// 函数说明: 响应开启新消息提醒菜单
// 作 者: GuiShou
// 时 间: 2019/11/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnOpenNewMsgNotify()
{
}
//************************************************************
// 函数名称: OnMsgNoDisturb
// 函数说明: 响应消息免打扰菜单
// 作 者: GuiShou
// 时 间: 2019/11/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFriendList::OnMsgNoDisturb()
{
}
//************************************************************
// 函数名称: OnSavefriendlist
// 函数说明: 响应保存好友列表消息
// 作 者: GuiShou
// 时 间: 2020/02/19
// 参 数: void
// 返 回 值: void
//***********************************************************
afx_msg LRESULT CFriendList::OnSavefriendlist(WPARAM wParam, LPARAM lParam)
{
wstring wxUserFileName = L"UserLists.txt";
//作为输出文件打开
ofstream ofile;
ofile.open(wxUserFileName, ios_base::trunc | ios_base::binary | ios_base::in);
//获取所有行的数量
int nRow = m_FriendList.GetItemCount();
//获取所有列的数量
int nCol = m_FriendList.GetHeaderCtrl()->GetItemCount();
//开始循环行和列
for (int i = 0; i < nRow; i++)
{
for (int j = 0; j < nCol; j++)
{
USES_CONVERSION;
CString csTemp = m_FriendList.GetItemText(i, j);
string sTemp(CW2A(csTemp.GetString()));
char const* pos = (char const*)sTemp.c_str();
//写入文件
ofile.write(pos, sTemp.length());
char const* cTab = "\t\t";
ofile.write(cTab, strlen(cTab));
}
char const* cLine = "\r\n";
ofile.write(cLine, strlen(cLine));
}
ofile.flush();
ofile.close();
return 0;
}
================================================
FILE: WeChatRobot/CFriendList.h
================================================
#pragma once
// CFriendList 对话框
class CFriendList : public CDialogEx
{
DECLARE_DYNAMIC(CFriendList)
public:
CFriendList(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CFriendList();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_FRIEND_LIST };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
CListCtrl m_FriendList;
protected:
afx_msg LRESULT OnShowfriendlist(WPARAM wParam, LPARAM lParam);
public:
afx_msg void OnRclickFriendlist(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnClickFriendlist(NMHDR *pNMHDR, LRESULT *pResult);
afx_msg void OnSendMsg();
afx_msg void OnSetRoomAnnouncement();
afx_msg void OnCopyWxid();
afx_msg void OnDeleteUser();
afx_msg void OnQuitChatRoom();
afx_msg void OnAddGroupMember();
afx_msg void OnSendXmlCard();
afx_msg void OnShowChatRoomMember();
afx_msg void OnSetRoomName();
afx_msg void OnInviteGroupMember();
afx_msg void OnGetFriendInfo();
afx_msg void OnBnClickedCheckall();
afx_msg void OnBnClickedReversechoose();
afx_msg void OnBnClickedCancelall();
CString m_GroupSendText;
afx_msg void OnBnClickedGroupsend();
afx_msg void OnSetRemark();
afx_msg void OnTopMsg();
afx_msg void OnCancleTopMsg();
afx_msg void OnOpenNewMsgNotify();
afx_msg void OnMsgNoDisturb();
protected:
afx_msg LRESULT OnSavefriendlist(WPARAM wParam, LPARAM lParam);
};
================================================
FILE: WeChatRobot/CFunctions.cpp
================================================
// CFunctions.cpp: 实现文件
//
#include "stdafx.h"
#include <direct.h>
#include <stdio.h>
#include "WeChatRobot.h"
#include "CFunctions.h"
#include "afxdialogex.h"
#include "CInformation.h"
#include "CDecryptImage.h"
#include "CMultiOpen.h"
#include "CAddUser.h"
#include "CFriendList.h"
#include "COpenUrl.h"
#include "CSendXmlAricle.h"
#include "CCreateChatRoom.h"
#include "CModifyVersion.h"
#include "CFollowAccount.h"
extern BOOL isAttentTuLing; //是否关注聊天机器人
BOOL bAutoChat = FALSE; //自动聊天
// CFunctions 对话框
IMPLEMENT_DYNAMIC(CFunctions, CDialogEx)
CFunctions::CFunctions(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_FUNCTIONS, pParent)
{
}
CFunctions::~CFunctions()
{
}
void CFunctions::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(CFunctions, CDialogEx)
ON_BN_CLICKED(IDC_INFORMATION, &CFunctions::OnBnClickedInformation)
ON_BN_CLICKED(IDC_DECRYPT_PIC, &CFunctions::OnBnClickedDecryptPic)
ON_BN_CLICKED(IDC_MULTI_OPEN, &CFunctions::OnBnClickedMultiOpen)
ON_BN_CLICKED(IDC_ADD_USER, &CFunctions::OnBnClickedAddUser)
ON_BN_CLICKED(IDC_AUTO_CHAT, &CFunctions::OnBnClickedAutoChat)
ON_BN_CLICKED(IDC_OPEN_URL, &CFunctions::OnBnClickedOpenUrl)
ON_BN_CLICKED(IDC_SendXmlArticle, &CFunctions::OnBnClickedSendxmlarticle)
ON_BN_CLICKED(IDC_SendMsgByTimer, &CFunctions::OnBnClickedSendmsgbytimer)
ON_BN_CLICKED(IDC_CreateRoom, &CFunctions::OnBnClickedCreateroom)
ON_BN_CLICKED(IDC_ModifyVersion, &CFunctions::OnBnClickedModifyversion)
ON_BN_CLICKED(IDC_FollowAccount, &CFunctions::OnBnClickedFollowaccount)
ON_BN_CLICKED(IDC_KeyWordsReply, &CFunctions::OnBnClickedKeywordsreply)
END_MESSAGE_MAP()
//************************************************************
// 函数名称: OnBnClickedInformation
// 函数说明: 响应个人信息按钮
// 作 者: GuiShou
// 时 间: 2019/7/6
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedInformation()
{
unique_ptr<CInformation> info(new CInformation);
info->DoModal();
}
//************************************************************
// 函数名称: OnBnClickedDecryptPic
// 函数说明: 响应解密图片按钮
// 作 者: GuiShou
// 时 间: 2019/7/6
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedDecryptPic()
{
CDecryptImage decryptimage;
decryptimage.DoModal();
}
//************************************************************
// 函数名称: OnBnClickedMultiOpen
// 函数说明: 响应无限多开按钮
// 作 者: GuiShou
// 时 间: 2019/7/6
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedMultiOpen()
{
PatchWeChat();
OpenWeChat();
}
//************************************************************
// 函数名称: OnBnClickedAddUser
// 函数说明: 响应添加好友按钮
// 作 者: GuiShou
// 时 间: 2019/7/13
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedAddUser()
{
CAddUser adduser;
adduser.DoModal();
}
//************************************************************
// 函数名称: OnBnClickedAutoChat
// 函数说明: 响应自动聊天按钮
// 作 者: GuiShou
// 时 间: 2019/7/16
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedAutoChat()
{
//检测是否关注聊天机器人
if (isAttentTuLing)
{
if (bAutoChat == FALSE)
{
MessageBoxW(L"自动聊天已开启");
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT autochat;
autochat.dwData = WM_AutoChat;
autochat.cbData = 0;
autochat.lpData = NULL;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&autochat);
bAutoChat = TRUE;
}
else
{
MessageBoxW(L"自动聊天已关闭");
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT autochat;
autochat.dwData = WM_CancleAutoChat;
autochat.cbData = 0;
autochat.lpData = NULL;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&autochat);
bAutoChat = FALSE;
}
}
else
{
MessageBoxW(L"请先关注小冰的宇宙公众号", L"提示", 0);
}
}
//************************************************************
// 函数名称: OnBnClickedOpenUrl
// 函数说明: 打开微信浏览器
// 作 者: GuiShou
// 时 间: 2019/9/10
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedOpenUrl()
{
COpenUrl openurl;
openurl.DoModal();
}
//************************************************************
// 函数名称: OnBnClickedSendxmlarticle
// 函数说明: 发送xml文章
// 作 者: GuiShou
// 时 间: 2019/9/30
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedSendxmlarticle()
{
}
//************************************************************
// 函数名称: OnBnClickedSendmsgbytimer
// 函数说明: 定时发送
// 作 者: GuiShou
// 时 间: 2019/10/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedSendmsgbytimer()
{
}
//************************************************************
// 函数名称: OnBnClickedCreateroom
// 函数说明: 创建群聊
// 作 者: GuiShou
// 时 间: 2019/10/22
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedCreateroom()
{
}
//************************************************************
// 函数名称: OnBnClickedModifyversion
// 函数说明: 修改版本号
// 作 者: GuiShou
// 时 间: 2019/10/28
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedModifyversion()
{
}
//************************************************************
// 函数名称: OnBnClickedFollowaccount
// 函数说明: 关注公众号
// 作 者: GuiShou
// 时 间: 2019/11/19
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedFollowaccount()
{
}
//************************************************************
// 函数名称: OnBnClickedKeywordsreply
// 函数说明: 开启或关闭关键词回复
// 作 者: GuiShou
// 时 间: 2019/11/20
// 参 数: void
// 返 回 值: void
//***********************************************************
void CFunctions::OnBnClickedKeywordsreply()
{
}
================================================
FILE: WeChatRobot/CFunctions.h
================================================
#pragma once
// CFunctions 对话框
class CFunctions : public CDialogEx
{
DECLARE_DYNAMIC(CFunctions)
public:
CFunctions(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CFunctions();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_FUNCTIONS };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedInformation();
afx_msg void OnBnClickedDecryptPic();
afx_msg void OnBnClickedMultiOpen();
afx_msg void OnBnClickedAddUser();
afx_msg void OnBnClickedAutoChat();
afx_msg void OnBnClickedOpenUrl();
afx_msg void OnBnClickedSendxmlarticle();
afx_msg void OnBnClickedSendmsgbytimer();
afx_msg void OnBnClickedCreateroom();
afx_msg void OnBnClickedModifyversion();
afx_msg void OnBnClickedFollowaccount();
afx_msg void OnBnClickedKeywordsreply();
};
================================================
FILE: WeChatRobot/CInformation.cpp
================================================
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CInformation.h"
#include "afxdialogex.h"
// CInformation 对话框
IMPLEMENT_DYNAMIC(CInformation, CDialogEx)
CInformation::CInformation(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_INFORMATION, pParent)
, m_header(_T(""))
, m_city(_T(""))
, m_province(_T(""))
, m_nation(_T(""))
, m_device(_T(""))
, m_phone(_T(""))
, m_nickname(_T(""))
, m_count(_T(""))
, m_wxid(_T(""))
, m_sex(_T(""))
, m_bigheader(_T(""))
{
}
CInformation::~CInformation()
{
}
void CInformation::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_HEADER, m_header);
DDX_Text(pDX, IDC_CITY, m_city);
DDX_Text(pDX, IDC_PROVINCE, m_province);
DDX_Text(pDX, IDC_NATION, m_nation);
DDX_Text(pDX, IDC_DEVICE, m_device);
DDX_Text(pDX, IDC_PHONE, m_phone);
DDX_Text(pDX, IDC_NICKNAME, m_nickname);
DDX_Text(pDX, IDC_ACCOUNT, m_count);
DDX_Text(pDX, IDC_WXID, m_wxid);
DDX_Text(pDX, IDC_SEX, m_sex);
DDX_Text(pDX, IDC_HEADER2, m_bigheader);
}
BEGIN_MESSAGE_MAP(CInformation, CDialogEx)
ON_WM_COPYDATA()
END_MESSAGE_MAP()
// CInformation 消息处理程序
BOOL CInformation::OnInitDialog()
{
CDialogEx::OnInitDialog();
//查找窗口
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT GetInformation;
//组装数据
GetInformation.dwData = WM_GetInformation;
GetInformation.cbData = 0;
GetInformation.lpData = NULL;
//发送获取个人信息消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&GetInformation);
return TRUE;
}
BOOL CInformation::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
//显示好友列表
if (pCopyDataStruct->dwData == WM_GetInformation)
{
//接收消息
PersonalInformation *info = (PersonalInformation*)pCopyDataStruct->lpData;
//显示到控件
m_wxid = info->wxid;
m_count = info->wxcount;
m_nickname = info->nickname;
m_phone = info->phonenumber;
m_device = info->device;
m_nation = info->nation;
m_city = info->city;
m_province = info->province;
m_header = info->smallheader;
m_bigheader = info->bigheader;
m_sex = info->wxsex;
UpdateData(FALSE);
}
return CDialogEx::OnCopyData(pWnd, pCopyDataStruct);
}
================================================
FILE: WeChatRobot/CInformation.h
================================================
#pragma once
// CInformation 对话框
class CInformation : public CDialogEx
{
DECLARE_DYNAMIC(CInformation)
public:
CInformation(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CInformation();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_INFORMATION };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
CString m_header;
CString m_city;
CString m_province;
CString m_nation;
CString m_device;
CString m_phone;
CString m_nickname;
CString m_count;
CString m_wxid;
CString m_sex;
CString m_bigheader;
};
================================================
FILE: WeChatRobot/CInjectTools.cpp
================================================
#include "stdafx.h"
#include "CInjectTools.h"
#include <direct.h>
#include <stdlib.h>
#include <TlHelp32.h>
#include <stdio.h>
#pragma comment(lib,"advapi32")
#define WECHAT_PROCESS_NAME "WeChat.exe"
#define DLLNAME "WeChatHelper.dll"
CString GetAppRegeditPath(CString strAppName)
{
//ر
HKEY hKey;
CString strAppRegeditPath("");
TCHAR szProductType[MAX_PATH];
memset(szProductType, 0, sizeof(szProductType));
DWORD dwBuflen = MAX_PATH;
LONG lRet = 0;
//Ǵע,ֻд
lRet = RegOpenKeyEx(HKEY_CURRENT_USER, //Ҫĸ
LPCTSTR(strAppName), //ҪӼ
0, //һΪ0
KEY_QUERY_VALUE, //ָʽ,Ϊ
&hKey); //ؾ
if (lRet != ERROR_SUCCESS) //жǷɹ
{
return strAppRegeditPath;
}
else
{
//濪ʼѯ
lRet = RegQueryValueEx(hKey, //עʱصľ
TEXT("Wechat"), //Ҫѯ,ѯװĿ¼
NULL, //һΪNULL0
NULL,
(LPBYTE)szProductType, //ҪĶ
&dwBuflen);
if (lRet != ERROR_SUCCESS) //жǷѯɹ
{
return strAppRegeditPath;
}
else
{
RegCloseKey(hKey);
strAppRegeditPath = szProductType;
int nPos = strAppRegeditPath.Find('-');
if (nPos >= 0)
{
CString sSubStr = strAppRegeditPath.Left(nPos - 1);//$,ʱnPos+1
strAppRegeditPath = sSubStr;
}
}
}
return strAppRegeditPath;
}
CString GetAppRegeditPath2(CString strAppName)
{
//ر
HKEY hKey;
CString strAppRegeditPath("");
TCHAR szProductType[MAX_PATH];
memset(szProductType, 0, sizeof(szProductType));
DWORD dwBuflen = MAX_PATH;
LONG lRet = 0;
//Ǵע,ֻд
lRet = RegOpenKeyEx(HKEY_CURRENT_USER, //Ҫĸ
LPCTSTR(strAppName), //ҪӼ
0, //һΪ0
KEY_QUERY_VALUE, //ָʽ,Ϊ
&hKey); //ؾ
if (lRet != ERROR_SUCCESS) //жǷɹ
{
return strAppRegeditPath;
}
else
{
//濪ʼѯ
lRet = RegQueryValueEx(hKey, //עʱصľ
TEXT("InstallPath"), //Ҫѯ,ѯװĿ¼
NULL, //һΪNULL0
NULL,
(LPBYTE)szProductType, //ҪĶ
&dwBuflen);
if (lRet != ERROR_SUCCESS) //жǷѯɹ
{
return strAppRegeditPath;
}
else
{
RegCloseKey(hKey);
strAppRegeditPath = szProductType;
}
}
return strAppRegeditPath;
}
//************************************************************
// : ProcessNameFindPID
// ˵: ͨҵID
// : GuiShou
// ʱ : 2019/6/30
// : ProcessName
// ֵ: DWORD PID
//************************************************************
DWORD ProcessNameFindPID(const char* ProcessName)
{
PROCESSENTRY32 pe32 = { 0 };
pe32.dwSize = sizeof(PROCESSENTRY32);
HANDLE hProcess = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
if (Process32First(hProcess, &pe32) == TRUE)
{
do
{
USES_CONVERSION;
if (strcmp(ProcessName, W2A(pe32.szExeFile)) == 0)
{
return pe32.th32ProcessID;
}
} while (Process32Next(hProcess, &pe32));
}
return 0;
}
//************************************************************
// : InjectDll
// ˵: עDLL
// : GuiShou
// ʱ : 2019/6/30
// : void
// ֵ: void
//************************************************************
BOOL InjectDll(HANDLE& wxPid)
{
//ȡǰĿ¼µdll
char szPath[MAX_PATH] = { 0 };
char* buffer = NULL;
if ((buffer = _getcwd(NULL, 0)) == NULL)
{
MessageBoxA(NULL, "ȡǰĿ¼ʧ", "", 0);
return FALSE;
}
sprintf_s(szPath, "%s\\%s", buffer, DLLNAME);
//ȡPid
DWORD dwPid = ProcessNameFindPID(WECHAT_PROCESS_NAME);
if (dwPid == 0)
{
CString wxStrAppName = TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Run");
CString szProductType = GetAppRegeditPath(wxStrAppName);
if (szProductType.GetLength()<5)
{
wxStrAppName = TEXT("Software\\Tencent\\WeChat");
szProductType = GetAppRegeditPath2(wxStrAppName);
szProductType.Append(L"\\WeChat.exe");
}
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
si.dwFlags = STARTF_USESHOWWINDOW;// ָwShowWindowԱЧ
si.wShowWindow = TRUE; // ˳ԱΪTRUEĻʾ½̵ڣ
// ΪFALSEĻʾ
CreateProcess(szProductType, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
HWND hWechatMainForm = NULL;
//WeChatLoginWndForPC
while (NULL == hWechatMainForm)
{
hWechatMainForm = FindWindow(TEXT("WeChatLoginWndForPC"), NULL);
Sleep(500);
}
if (NULL == hWechatMainForm)
{
return FALSE;
}
dwPid = pi.dwProcessId;
wxPid = pi.hProcess;
}
//dllǷѾע
if (CheckIsInject(dwPid))
{
//
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPid);
if (hProcess == NULL)
{
MessageBoxA(NULL, "̴ʧ", "", 0);
return FALSE;
}
//Žڴ
LPVOID pAddress = VirtualAllocEx(hProcess, NULL, MAX_PATH, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
if (pAddress == NULL)
{
MessageBoxA(NULL, "ڴʧ", "", 0);
return FALSE;
}
//дdll·Ž
if (WriteProcessMemory(hProcess, pAddress, szPath, MAX_PATH, NULL) == 0)
{
MessageBoxA(NULL, "·дʧ", "", 0);
return FALSE;
}
//ȡLoadLibraryAַ
FARPROC pLoadLibraryAddress = GetProcAddress(GetModuleHandleA("kernel32.dll"), "LoadLibraryA");
if (pLoadLibraryAddress == NULL)
{
MessageBoxA(NULL, "ȡLoadLibraryAַʧ", "", 0);
return FALSE;
}
//Զ߳עdll
HANDLE hRemoteThread = CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)pLoadLibraryAddress, pAddress, 0, NULL);
if (hRemoteThread == NULL)
{
MessageBoxA(NULL, "Զ߳עʧ", "", 0);
return FALSE;
}
CloseHandle(hRemoteThread);
CloseHandle(hProcess);
}
else
{
MessageBoxA(NULL, "dllѾע룬ظע", "ʾ", 0);
return FALSE;
}
return TRUE;
}
//************************************************************
// : CheckIsInject
// ˵: ǷѾעdll
// : GuiShou
// ʱ : 2019/6/30
// : void
// ֵ: BOOL
//************************************************************
BOOL CheckIsInject(DWORD dwProcessid)
{
HANDLE hModuleSnap = INVALID_HANDLE_VALUE;
//ʼģϢṹ
MODULEENTRY32 me32 = { sizeof(MODULEENTRY32) };
//ģ 1 2 ID
hModuleSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessid);
//Чͷfalse
if (hModuleSnap == INVALID_HANDLE_VALUE)
{
MessageBoxA(NULL, "ģʧ", "", MB_OK);
return FALSE;
}
//ͨģվȡһģϢ
if (!Module32First(hModuleSnap, &me32))
{
MessageBoxA(NULL, "ȡһģϢʧ", "", MB_OK);
//ȡʧرվ
CloseHandle(hModuleSnap);
return FALSE;
}
do
{
if (StrCmpW(me32.szModule, L"WeChatHelper.dll") == 0)
{
return FALSE;
}
} while (Module32Next(hModuleSnap, &me32));
return TRUE;
}
================================================
FILE: WeChatRobot/CInjectTools.h
================================================
#pragma once
DWORD ProcessNameFindPID(const char* ProcessName); //ͨȡID
BOOL InjectDll(HANDLE& wxPid); //עdll
BOOL CheckIsInject(DWORD dwProcessid); //DLLǷѾע
================================================
FILE: WeChatRobot/CInviteGroupMember.cpp
================================================
// CInviteGroupMember.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CInviteGroupMember.h"
#include "afxdialogex.h"
// CInviteGroupMember 对话框
IMPLEMENT_DYNAMIC(CInviteGroupMember, CDialogEx)
CInviteGroupMember::CInviteGroupMember(LPCTSTR TempGroupId, CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_InviteMember, pParent), m_ChatRoomWxid(TempGroupId)
, m_wxid(_T(""))
{
}
CInviteGroupMember::~CInviteGroupMember()
{
}
void CInviteGroupMember::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_wxid);
}
BEGIN_MESSAGE_MAP(CInviteGroupMember, CDialogEx)
ON_BN_CLICKED(IDC_INVITE, &CInviteGroupMember::OnBnClickedInvite)
END_MESSAGE_MAP()
//************************************************************
// 函数名称: OnBnClickedInvite
// 函数说明: 响应确定按钮
// 作 者: GuiShou
// 时 间: 2019/9/19
// 参 数: void
// 返 回 值: void
//***********************************************************
void CInviteGroupMember::OnBnClickedInvite()
{
}
================================================
FILE: WeChatRobot/CInviteGroupMember.h
================================================
#pragma once
// CInviteGroupMember 对话框
class CInviteGroupMember : public CDialogEx
{
DECLARE_DYNAMIC(CInviteGroupMember)
public:
CInviteGroupMember(LPCTSTR TempGroupId, CWnd* pParent = nullptr); // 标准构造函数
virtual ~CInviteGroupMember();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_InviteMember };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_ChatRoomWxid; //从好友列表窗口传过来的群ID
CString m_wxid;
afx_msg void OnBnClickedInvite();
};
================================================
FILE: WeChatRobot/CMain.cpp
================================================
// CMain.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CMain.h"
#include "afxdialogex.h"
#include "CChatRecords.h"
#include "CFriendList.h"
#include "CFunctions.h"
#include "CPay.h"
#include "CAboutAuthor.h"
IMPLEMENT_DYNAMIC(CMain, CDialogEx)
CMain::CMain(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_MAIN, pParent)
{
}
CMain::~CMain()
{
}
void CMain::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_TAB1, m_MyTable);
}
BEGIN_MESSAGE_MAP(CMain, CDialogEx)
ON_COMMAND(ID_32776, &CMain::OnWxLogout)
ON_WM_COPYDATA()
ON_COMMAND(ID_32779, &CMain::OnPayAuthor)
ON_COMMAND(ID_32778, &CMain::OnAboutAuthor)
ON_COMMAND(ID_32798, &CMain::OnSaveFriendList)
ON_WM_CLOSE()
ON_WM_DESTROY()
END_MESSAGE_MAP()
// CMain 消息处理程序
BOOL CMain::OnInitDialog()
{
CDialogEx::OnInitDialog();
// TODO: 在此添加额外的初始化
TCHAR Name[3][5] = { L"好友列表",L"聊天记录" , L"功能大全" };
for (int i = 0; i < 3; i++)
{
m_MyTable.InsertItem(i, Name[i]);
}
//给子窗口指针赋值
m_MyTable.m_Dia[0] = new CFriendList();
m_MyTable.m_Dia[1] = new CChatRecords();
m_MyTable.m_Dia[2] = new CFunctions();
//创建子窗口
UINT DiaIds[3] = { IDD_FRIEND_LIST, IDD_CHAT_RECORDS, IDD_FUNCTIONS};
for (int i = 0; i < 3; i++)
{
m_MyTable.m_Dia[i]->Create(DiaIds[i], &m_MyTable);
}
//控制两个窗口的大小
CRect rc;
m_MyTable.GetClientRect(rc);
rc.DeflateRect(2, 23, 2, 2);
for (int i = 0; i < 3; i++)
{
m_MyTable.m_Dia[i]->MoveWindow(rc);
}
//显示第一个子窗口
m_MyTable.m_Dia[0]->ShowWindow(SW_SHOW);
for (int i = 1; i < 3; i++)
{
m_MyTable.m_Dia[i]->ShowWindow(SW_HIDE);
}
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
//************************************************************
// 函数名称: OnWxLogout
// 函数说明: 响应退出微信菜单
// 作 者: GuiShou
// 时 间: 2019/6/30
// 参 数: void
// 返 回 值: void
//***********************************************************
void CMain::OnWxLogout()
{
//查找窗口
CWnd *pWnd = CWnd::FindWindow(NULL, L"WeChatHelper");
COPYDATASTRUCT logout;
logout.dwData = WM_Logout;
logout.cbData = 0;
logout.lpData = NULL;
//发送消息
pWnd->SendMessage(WM_COPYDATA, NULL, (LPARAM)&logout);
}
//************************************************************
// 函数名称: OnCopyData
// 函数说明: 响应CopyData消息
// 作 者: GuiShou
// 时 间: 2019/7/5
// 参 数: CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct
// 返 回 值: BOOL
//***********************************************************
BOOL CMain::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
//显示好友列表
if (pCopyDataStruct->dwData == WM_GetFriendList)
{
UserInfo *user = (UserInfo*)pCopyDataStruct->lpData;
//将消息发送给子窗口
m_MyTable.m_Dia[0]->SendMessage(WM_ShowFriendList, (WPARAM)user, NULL);
}
//显示聊天记录
else if (pCopyDataStruct->dwData == WM_ShowChatRecord)
{
ChatMessageData *msg = (ChatMessageData*)pCopyDataStruct->lpData;
//将消息发送给子窗口
m_MyTable.m_Dia[1]->SendMessage(WM_ShowMessage, (WPARAM)msg, NULL);
}
return CDialogEx::OnCopyData(pWnd, pCopyDataStruct);
}
//************************************************************
// 函数名称: OnPayAuthor
// 函数说明: 响应打赏作者菜单
// 作 者: GuiShou
// 时 间: 2019/7/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CMain::OnPayAuthor()
{
CPay pay;
pay.DoModal();
}
//************************************************************
// 函数名称: OnAboutAuthor
// 函数说明: 响应关于作者菜单
// 作 者: GuiShou
// 时 间: 2019/7/14
// 参 数: void
// 返 回 值: void
//***********************************************************
void CMain::OnAboutAuthor()
{
CAboutAuthor about;
about.DoModal();
}
//************************************************************
// 函数名称: OnSaveFriendList
// 函数说明: 响应保存联系人菜单
// 作 者: GuiShou
// 时 间: 2019/9/17
// 参 数: void
// 返 回 值: void
//***********************************************************
void CMain::OnSaveFriendList()
{
m_MyTable.m_Dia[0]->SendMessage(SaveFriendList, NULL, NULL);
}
//************************************************************
// 函数名称: OnClose
// 函数说明: 重载OnClose消息
// 作 者: GuiShou
// 时 间: 2019/12/10
// 参 数: void
// 返 回 值: void
//***********************************************************
void CMain::OnClose()
{
if (MessageBoxA(NULL, "是否退出程序", "Tip", MB_YESNO) == IDYES)
{
EndDialog(0);
}
}
================================================
FILE: WeChatRobot/CMain.h
================================================
#pragma once
#include "CMyTableCtrl.h"
// CMain 对话框
class CMain : public CDialogEx
{
DECLARE_DYNAMIC(CMain)
public:
CMain(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CMain();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_MAIN };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CMyTableCtrl m_MyTable;
virtual BOOL OnInitDialog();
afx_msg void OnWxLogout();
afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
afx_msg void OnPayAuthor();
afx_msg void OnAboutAuthor();
afx_msg void OnSaveFriendList();
afx_msg void OnClose();
};
================================================
FILE: WeChatRobot/CModifyVersion.cpp
================================================
// CModifyVersion.cpp: 实现文件
//
#include "stdafx.h"
#include "WeChatRobot.h"
#include "CModifyVersion.h"
#include "afxdialogex.h"
#include <atlconv.h>
// CModifyVersion 对话框
IMPLEMENT_DYNAMIC(CModifyVersion, CDialogEx)
CModifyVersion::CModifyVersion(CWnd* pParent /*=nullptr*/)
: CDialogEx(IDD_ModifyVersion, pParent)
, m_version(_T("2.7.1.85"))
{
}
CModifyVersion::~CModifyVersion()
{
}
void CModifyVersion::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_version);
}
BEGIN_MESSAGE_MAP(CModifyVersion, CDialogEx)
ON_BN_CLICKED(IDC_Modify, &CModifyVersion::OnBnClickedModify)
END_MESSAGE_MAP()
// CModifyVersion 消息处理程序
void CModifyVersion::OnBnClickedModify()
{
}
================================================
FILE: WeChatRobot/CModifyVersion.h
================================================
#pragma once
// CModifyVersion 对话框
class CModifyVersion : public CDialogEx
{
DECLARE_DYNAMIC(CModifyVersion)
public:
CModifyVersion(CWnd* pParent = nullptr); // 标准构造函数
virtual ~CModifyVersion();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_ModifyVersion };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CString m_version;
afx_msg void OnBnClickedModify();
};
================================================
FILE: WeChatRobot/CMultiOpen.cpp
================================================
#include "stdafx.h"
#include <TlHelp32.h>
#include <Shlwapi.h>
#pragma comment(lib, "shlwapi")
#include "CMultiOpen.h"
#include <stdio.h>
typedef NTSTATUS(NTAPI *NTQUERYOBJECT)(
_In_opt_ HANDLE Handle,
_In_ OBJECT_INFORMATION_CLASS ObjectInformationClass,
_Out_opt_ PVOID ObjectInformation,
_In_ ULONG ObjectInformationLength,
_Out_opt_ PULONG ReturnLength
);
typedef NTSTATUS
(NTAPI *ZWQUERYSYSTEMINFORMATION)(
IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
OUT PVOID SystemInformation,
IN ULONG SystemInformationLength,
OUT PULONG ReturnLength OPTIONAL
);
ZWQUERYSYSTEMINFORMATION ZwQuerySystemInformation = (ZWQUERYSYSTEMINFORMATION)GetProcAddress(GetModuleHandleA("ntdll.dll"), "ZwQuerySystemInformation");
NTQUERYOBJECT NtQueryObject = (NTQUERYOBJECT)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtQueryObject");
//************************************************************
// : ElevatePrivileges
// ˵: Ȩ
// : GuiShou
// ʱ : 2019/7/13
// : void
// ֵ: BOOL
//***********************************************************
BOOL ElevatePrivileges()
{
HANDLE hToken;
TOKEN_PRIVILEGES tkp;
tkp.PrivilegeCount = 1;
if(!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&hToken))
return FALSE;
LookupPrivilegeValue(NULL,SE_DEBUG_NAME,&tkp.Privileges[0].Luid);
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if(!AdjustTokenPrivileges(hToken,FALSE,&tkp,sizeof(TOKEN_PRIVILEGES),NULL,NULL))
{
return FALSE;
}
return TRUE;
}
//************************************************************
// : DuplicateHandleEx
// ˵: ƾ
// : GuiShou
// ʱ : 2019/7/13
// : void
// ֵ: BOOL
//***********************************************************
HANDLE DuplicateHandleEx(DWORD pid, HANDLE h, DWORD flags)
{
HANDLE hHandle = NULL;
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
if(hProc)
{
if(!DuplicateHandle(hProc,
(HANDLE)h, GetCurrentProcess(),
&hHandle, 0, FALSE, /*DUPLICATE_SAME_ACCESS*/flags))
{
hHandle = NULL;
}
}
CloseHandle(hProc);
return hHandle;
}
//************************************************************
// : GetProcIds
// ˵: ȡPID
// : GuiShou
// ʱ : 2019/7/13
// : Name Pids
// ֵ: int
//***********************************************************
int GetProcIds(LPWSTR Name, DWORD* Pids)
{
PROCESSENTRY32 pe32 = {sizeof(pe32)};
int num = 0;
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if(hSnap)
{
if(Process32First(hSnap, &pe32))
{
do {
if(!StrCmpW(Name, pe32.szExeFile))
{
if(Pids)
{
Pids[num++] = pe32.th32ProcessID;
}
}
} while(Process32Next(hSnap, &pe32));
}
CloseHandle(hSnap);
}
return num;
}
//************************************************************
// : IsTargetPid
// ˵: ǷĿPID
// : GuiShou
// ʱ : 2019/7/13
// : Pid Pids num
// ֵ: BOOL
//***********************************************************
BOOL IsTargetPid(DWORD Pid, DWORD* Pids, int num)
{
for(int i=0; i<num; i++)
{
if(Pid == Pids[i])
{
return TRUE;
}
}
return FALSE;
}
//************************************************************
// : PatchWeChat
// ˵:
// : GuiShou
// ʱ : 2019/7/13
// : void
// ֵ: int
//***********************************************************
int PatchWeChat()
{
DWORD dwSize = 0;
POBJECT_NAME_INFORMATION pNameInfo;
POBJECT_NAME_INFORMATION pNameType;
PVOID pbuffer = NULL;
NTSTATUS Status;
DWORD nIndex = 0;
DWORD dwFlags = 0;
char szType[128] = {0};
char szName[512] = {0};
ElevatePrivileges();
DWORD Pids[100] = {0};
DWORD Num = GetProcIds(L"WeChat.exe", Pids);
if(Num == 0)
{
return 0;
}
if(!ZwQuerySystemInformation)
{
goto Exit0;
}
pbuffer = VirtualAlloc(NULL, 0x1000, MEM_COMMIT, PAGE_READWRITE);
if(!pbuffer)
{
goto Exit0;
}
Status = ZwQuerySystemInformation(SystemHandleInformation, pbuffer, 0x1000, &dwSize);
if(!NT_SUCCESS(Status))
{
if (STATUS_INFO_LENGTH_MISMATCH != Status)
{
goto Exit0;
}
else
{
// ҿԱ֤ȷʹѭԺ
if (NULL != pbuffer)
{
VirtualFree(pbuffer, 0, MEM_RELEASE);
}
if (dwSize*2 > 0x4000000) // MAXSIZE
{
goto Exit0;
}
pbuffer = VirtualAlloc(NULL, dwSize*2, MEM_COMMIT, PAGE_READWRITE);
if(!pbuffer)
{
goto Exit0;
}
Status = ZwQuerySystemInformation(SystemHandleInformation, pbuffer, dwSize*2, NULL);
if(!NT_SUCCESS(Status))
{
goto Exit0;
}
}
}
PSYSTEM_HANDLE_INFORMATION1 pHandleInfo = (PSYSTEM_HANDLE_INFORMATION1)pbuffer;
int nCount = 0; //رվĴ
for(nIndex = 0; nIndex < pHandleInfo->NumberOfHandles; nIndex++)
{
if(IsTargetPid(pHandleInfo->Handles[nIndex].UniqueProcessId, Pids, Num))
{
//
HANDLE hHandle = DuplicateHandleEx(pHandleInfo->Handles[nIndex].UniqueProcessId,
(HANDLE)pHandleInfo->Handles[nIndex].HandleValue,
DUPLICATE_SAME_ACCESS
);
if(hHandle == NULL) continue;
Status = NtQueryObject(hHandle, ObjectNameInformation, szName, 512, &dwFlags);
if (!NT_SUCCESS(Status))
{
CloseHandle(hHandle);
continue;
}
Status = NtQueryObject(hHandle, ObjectTypeInformation, szType, 128, &dwFlags);
if (!NT_SUCCESS(Status))
{
CloseHandle(hHandle);
continue;
}
pNameInfo = (POBJECT_NAME_INFORMATION)szName;
pNameType = (POBJECT_NAME_INFORMATION)szType;
WCHAR TypName[1024] = {0};
WCHAR Name[1024] = {0};
wcsncpy_s(TypName, (WCHAR*)pNameType->Name.Buffer, pNameType->Name.Length/2);
wcsncpy_s(Name, (WCHAR*)pNameInfo->Name.Buffer, pNameInfo->Name.Length/2);
// ƥǷΪҪرյľ
if (0 == wcscmp(TypName, L"Mutant"))
{
if (wcsstr(Name, L"_WeChat_App_Instance_Identity_Mutex_Name"))
{
CloseHandle(hHandle);
hHandle = DuplicateHandleEx(pHandleInfo->Handles[nIndex].UniqueProcessId,
(HANDLE)pHandleInfo->Handles[nIndex].HandleValue,
DUPLICATE_CLOSE_SOURCE
);
if(hHandle)
{
OutputDebugStringA("+ Patch wechat success!\n");
CloseHandle(hHandle);
}
else
{
OutputDebugStringA("- Patch error");
}
nCount++;
if (nCount>=2)
{
goto Exit0;
}
}
}
CloseHandle(hHandle);
}
}
Exit0:
if (NULL != pbuffer)
{
VirtualFree(pbuffer, 0, MEM_RELEASE);
}
return 0;
}
//************************************************************
// : OpenWeChat
// ˵:
// : GuiShou
// ʱ : 2019/7/13
// : void
// ֵ: void
//***********************************************************
void OpenWeChat()
{
HKEY hKey = NULL;
if(ERROR_SUCCESS != RegOpenKey(HKEY_CURRENT_USER, L"Software\\Tencent\\WeChat", &hKey))
{
return;
}
DWORD Type = REG_SZ;
WCHAR Path[MAX_PATH] = {0};
DWORD cbData = MAX_PATH*sizeof(WCHAR);
if(ERROR_SUCCESS != RegQueryValueEx(hKey, L"InstallPath", 0, &Type, (LPBYTE)Path, &cbData))
{
goto __exit;
}
PathAppend(Path, L"WeChat.exe");
ShellExecute(NULL, L"Open", Path, NULL, NULL, SW_SHOW);
__exit:
if(hKey)
{
RegCloseKey(hKey);
}
}
================================================
FILE: WeChatRobot/CMultiOpen.h
================================================
#pragma once
#include <Windows.h>
/*ͷļ*/
typedef LONG NTSTATUS;
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
typedef enum _SYSTEM_INFORMATION_CLASS {
SystemBasicInformation, // 0 Y N
SystemProcessorInformation, // 1 Y N
SystemPerformanceInformation, // 2 Y N
SystemTimeOfDayInformation, // 3 Y N
SystemNotImplemented1, // 4 Y N
SystemProcessesAndThreadsInformation, // 5 Y N
SystemCallCounts, // 6 Y N
SystemConfigurationInformation, // 7 Y N
SystemProcessorTimes, // 8 Y N
SystemGlobalFlag, // 9 Y Y
SystemNotImplemented2, // 10 Y N
SystemModuleInformation, // 11 Y N
SystemLockInformation, // 12 Y N
SystemNotImplemented3, // 13 Y N
SystemNotImplemented4, // 14 Y N
SystemNotImplemented5, // 15 Y N
SystemHandleInformation, // 16 Y N
SystemObjectInformation, // 17 Y N
SystemPagefileInformation, // 18 Y N
SystemInstructionEmulationCounts, // 19 Y N
SystemInvalidInfoClass1, // 20
SystemCacheInformation, // 21 Y Y
SystemPoolTagInformation, // 22 Y N
SystemProcessorStatistics, // 23 Y N
SystemDpcInformation, // 24 Y Y
SystemNotImplemented6, // 25 Y N
SystemLoadImage, // 26 N Y
SystemUnloadImage, // 27 N Y
SystemTimeAdjustment, // 28 Y Y
SystemNotImplemented7, // 29 Y N
SystemNotImplemented8, // 30 Y N
SystemNotImplemented9, // 31 Y N
SystemCrashDumpInformation, // 32 Y N
SystemExceptionInformation, // 33 Y N
SystemCrashDumpStateInformation, // 34 Y Y/N
SystemKernelDebuggerInformation, // 35 Y N
SystemContextSwitchInformation, // 36 Y N
SystemRegistryQuotaInformation, // 37 Y Y
SystemLoadAndCallImage, // 38 N Y
SystemPrioritySeparation, // 39 N Y
SystemNotImplemented10, // 40 Y N
SystemNotImplemented11, // 41 Y N
SystemInvalidInfoClass2, // 42
Sy
gitextract_n0tizw0f/ ├── CLAUDE.md ├── README.md ├── README_DETAILS.md ├── WeChat 3.2.1.154安装包下载.txt ├── WeChatHelper/ │ ├── CAutoFunction.cpp │ ├── CAutoFunction.h │ ├── CPublic.cpp │ ├── CPublic.h │ ├── ChatRecord.cpp │ ├── ChatRecord.h │ ├── ChatRoomOperate.cpp │ ├── ChatRoomOperate.h │ ├── FriendList.cpp │ ├── FriendList.h │ ├── Function.cpp │ ├── Function.h │ ├── InitWeChat.cpp │ ├── InitWeChat.h │ ├── Login.cpp │ ├── Login.h │ ├── MainWindow.cpp │ ├── MainWindow.h │ ├── SelfInformation.cpp │ ├── SelfInformation.h │ ├── WeChatHelper.cpp │ ├── WeChatHelper.vcxproj │ ├── WeChatHelper.vcxproj.filters │ ├── WeChatHelper.vcxproj.user │ ├── WndMsgLoop.cpp │ ├── WndMsgLoop.h │ ├── data.h │ ├── dllmain.cpp │ ├── message.h │ ├── offset.h │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h ├── WeChatRobot/ │ ├── CAboutAuthor.cpp │ ├── CAboutAuthor.h │ ├── CAddChatRoomMember.cpp │ ├── CAddChatRoomMember.h │ ├── CAddUser.cpp │ ├── CAddUser.h │ ├── CChatRecords.cpp │ ├── CChatRecords.h │ ├── CChatRoomMember.cpp │ ├── CChatRoomMember.h │ ├── CCreateChatRoom.cpp │ ├── CCreateChatRoom.h │ ├── CDecryptImage.cpp │ ├── CDecryptImage.h │ ├── CFollowAccount.cpp │ ├── CFollowAccount.h │ ├── CFriendInfo.cpp │ ├── CFriendInfo.h │ ├── CFriendList.cpp │ ├── CFriendList.h │ ├── CFunctions.cpp │ ├── CFunctions.h │ ├── CInformation.cpp │ ├── CInformation.h │ ├── CInjectTools.cpp │ ├── CInjectTools.h │ ├── CInviteGroupMember.cpp │ ├── CInviteGroupMember.h │ ├── CMain.cpp │ ├── CMain.h │ ├── CModifyVersion.cpp │ ├── CModifyVersion.h │ ├── CMultiOpen.cpp │ ├── CMultiOpen.h │ ├── CMyTableCtrl.cpp │ ├── CMyTableCtrl.h │ ├── COpenUrl.cpp │ ├── COpenUrl.h │ ├── CPay.cpp │ ├── CPay.h │ ├── CRoomAnnouncement.cpp │ ├── CRoomAnnouncement.h │ ├── CSendChatRoomAt.cpp │ ├── CSendChatRoomAt.h │ ├── CSendMsg.cpp │ ├── CSendMsg.h │ ├── CSendXmlAricle.cpp │ ├── CSendXmlAricle.h │ ├── CSendXmlCard.cpp │ ├── CSendXmlCard.h │ ├── CSetRemark.cpp │ ├── CSetRemark.h │ ├── CSetRoomName.cpp │ ├── CSetRoomName.h │ ├── WeChatRobot.aps │ ├── WeChatRobot.cpp │ ├── WeChatRobot.h │ ├── WeChatRobot.rc │ ├── WeChatRobot.vcxproj │ ├── WeChatRobot.vcxproj.filters │ ├── WeChatRobot.vcxproj.user │ ├── WeChatRobotDlg.cpp │ ├── WeChatRobotDlg.h │ ├── data.h │ ├── message.h │ ├── res/ │ │ └── WeChatRobot.rc2 │ ├── resource.h │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h └── WeChatRobot.sln
SYMBOL INDEX (158 symbols across 55 files)
FILE: WeChatHelper/CAutoFunction.cpp
function AgreeUserRequest (line 33) | void AgreeUserRequest(wchar_t* v1, wchar_t* v2)
function AutoAgreeUserRequest (line 92) | void AutoAgreeUserRequest(wstring msg)
function CllectMoney (line 117) | void CllectMoney(wchar_t* transferid, wchar_t* wxid)
function AutoCllectMoney (line 154) | void AutoCllectMoney(wstring msg,wchar_t* wxid)
function AddCardUser (line 180) | void AddCardUser(wchar_t* v1, wchar_t* msg)
function AutoAddCardUser (line 233) | void AutoAddCardUser(wstring msg)
function HookExtractExpression (line 254) | void HookExtractExpression()
function ExtractExpression (line 269) | void __declspec(naked) ExtractExpression()
function OutputExpression (line 293) | void __stdcall OutputExpression(DWORD dwExpressionAddr)
function CreateFileWithCurrentTime (line 344) | void CreateFileWithCurrentTime(char* filedir, char* filepostfix, DWORD f...
function CreateDir (line 381) | void CreateDir(const char *dir)
function wstring (line 413) | wstring GetXmlContent(wstring fullxmlcontent, wstring str1, wstring str2)
FILE: WeChatHelper/CPublic.cpp
function HookAnyAddress (line 13) | void HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress)
function DWORD (line 44) | DWORD GetWeChatWinBase()
function wchar_t (line 59) | wchar_t * UTF8ToUnicode(const char* str)
function wstring (line 73) | wstring UTF8ToUnicode2(const char* str)
function DebugCode (line 89) | void DebugCode(LPVOID pAddress)
FILE: WeChatHelper/ChatRecord.cpp
function HookChatRecord (line 41) | void HookChatRecord()
function RecieveWxMesage (line 56) | __declspec(naked) void RecieveWxMesage()
function DealWithMsg (line 82) | void DealWithMsg(LPVOID Context)
function SendWxMessage (line 409) | void __stdcall SendWxMessage(DWORD r_eax)
function GetMsgByAddress (line 467) | std::wstring GetMsgByAddress(DWORD memAddress)
FILE: WeChatHelper/ChatRoomOperate.cpp
function SetWxRoomAnnouncement (line 13) | void SetWxRoomAnnouncement(wchar_t* chatroomwxid, wchar_t* Announcement)
function QuitChatRoom (line 65) | void QuitChatRoom(wchar_t* chatroomwxid)
function AddGroupMember (line 91) | void AddGroupMember(wchar_t* chatroomwxid, wchar_t* wxid)
function ShowChatRoomUser (line 151) | void ShowChatRoomUser(wchar_t* chatroomwxid)
function GetUserInfoByWxid (line 240) | void GetUserInfoByWxid(wchar_t* userwxid)
function SetRoomName (line 325) | void SetRoomName(wchar_t* roomwxid, wchar_t* roomname)
function SendRoomAtMsg (line 352) | void SendRoomAtMsg(wchar_t* chatroomid, wchar_t* memberwxid, wchar_t* me...
function DelRoomMember (line 415) | void DelRoomMember(wchar_t* roomid, wchar_t* memberwxid)
FILE: WeChatHelper/FriendList.cpp
function HookGetFriendList (line 36) | void HookGetFriendList()
function GetUserListInfo (line 51) | __declspec(naked) void GetUserListInfo()
function ReSendUser (line 76) | void ReSendUser(UserListInfo* user)
function SendUserListInfo (line 110) | void __stdcall SendUserListInfo(DWORD r_esi)
function SendTextMessage (line 183) | void SendTextMessage(wchar_t* wxid, wchar_t* msg)
function SendFileMessage (line 223) | void SendFileMessage(wchar_t* wxid, wchar_t* filepath)
function SendImageMessage (line 292) | void SendImageMessage(wchar_t* wxid, wchar_t* filepath)
function DeleteUser (line 354) | void DeleteUser(wchar_t* wxid)
function SendXmlCard (line 381) | void SendXmlCard(wchar_t* RecverWxid, wchar_t* SendWxid, wchar_t* NickName)
FILE: WeChatHelper/Function.cpp
function AddWxUser (line 20) | void AddWxUser(wchar_t* wxid, wchar_t* msg)
function OpenUrl (line 82) | void OpenUrl(wchar_t* Url)
function AntiRevoke (line 112) | void AntiRevoke()
FILE: WeChatHelper/InitWeChat.cpp
function BOOL (line 16) | BOOL IsWxVersionValid()
function CheckIsLogin (line 72) | void CheckIsLogin()
FILE: WeChatHelper/Login.cpp
function HookQrCode (line 17) | void HookQrCode()
function ShowPic (line 31) | void __declspec(naked) ShowPic()
function SaveImg (line 55) | void __stdcall SaveImg(DWORD qrcode)
function GotoQrCode (line 96) | void GotoQrCode()
FILE: WeChatHelper/MainWindow.cpp
function LogoutWeChat (line 5) | void LogoutWeChat()
FILE: WeChatHelper/SelfInformation.cpp
function GetInformation (line 141) | void GetInformation()
FILE: WeChatHelper/WndMsgLoop.cpp
function InitWindow (line 26) | void InitWindow(HMODULE hModule)
function RegisterWindow (line 91) | void RegisterWindow(HMODULE hModule)
function LRESULT (line 142) | LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM ...
FILE: WeChatHelper/data.h
type GeneralStruct (line 5) | struct GeneralStruct
type MessageStruct (line 26) | struct MessageStruct
type XmlCardMessage (line 33) | struct XmlCardMessage
type AtMsg (line 40) | struct AtMsg
type SendXmlArticleStruct (line 48) | struct SendXmlArticleStruct
type PersonalInformation (line 61) | struct PersonalInformation
type SetRemarkStruct (line 86) | struct SetRemarkStruct
type ChatMessageData (line 108) | struct ChatMessageData
type v1Info (line 121) | struct v1Info
type v2Info (line 132) | struct v2Info
type CllectMoneyStruct (line 145) | struct CllectMoneyStruct
type DwonImgStruct (line 159) | struct DwonImgStruct
type UserInfo (line 183) | struct UserInfo
type UserListInfo (line 192) | struct UserListInfo
type UserInfoDetail (line 201) | struct UserInfoDetail
type RoomIdStruct (line 213) | struct RoomIdStruct
FILE: WeChatHelper/dllmain.cpp
function BOOL (line 7) | BOOL APIENTRY DllMain( HMODULE hModule,
FILE: WeChatRobot/CAboutAuthor.cpp
function BOOL (line 48) | BOOL CAboutAuthor::OnInitDialog()
FILE: WeChatRobot/CAboutAuthor.h
function class (line 6) | class CAboutAuthor : public CDialogEx
FILE: WeChatRobot/CAddChatRoomMember.h
function class (line 6) | class CAddChatRoomMember : public CDialogEx
FILE: WeChatRobot/CAddUser.h
function class (line 6) | class CAddUser : public CDialogEx
FILE: WeChatRobot/CChatRecords.cpp
function string_To_UTF8 (line 39) | std::string string_To_UTF8(const std::string & str)
function Wchar_tToString (line 75) | std::string Wchar_tToString(wchar_t *wchar)
function wchar_t (line 97) | wchar_t * StringToWchar_t(const std::string & str)
function Log (line 117) | void Log(const std::string & type, const std::string & wxid, const std::...
function BOOL (line 185) | BOOL CChatRecords::OnInitDialog()
function afx_msg (line 210) | afx_msg LRESULT CChatRecords::OnShowmessage(WPARAM wParam, LPARAM lParam)
FILE: WeChatRobot/CChatRecords.h
function class (line 6) | class CChatRecords : public CDialogEx
FILE: WeChatRobot/CChatRoomMember.cpp
function BOOL (line 52) | BOOL CChatRoomMember::OnInitDialog()
function BOOL (line 80) | BOOL CChatRoomMember::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataSt...
FILE: WeChatRobot/CChatRoomMember.h
function class (line 6) | class CChatRoomMember : public CDialogEx
FILE: WeChatRobot/CCreateChatRoom.h
function class (line 6) | class CCreateChatRoom : public CDialogEx
FILE: WeChatRobot/CDecryptImage.cpp
function BOOL (line 48) | BOOL CDecryptImage::OnInitDialog()
FILE: WeChatRobot/CDecryptImage.h
function class (line 6) | class CDecryptImage : public CDialogEx
FILE: WeChatRobot/CFollowAccount.h
function class (line 6) | class CFollowAccount : public CDialogEx
FILE: WeChatRobot/CFriendInfo.cpp
function BOOL (line 54) | BOOL CFriendInfo::OnInitDialog()
function BOOL (line 72) | BOOL CFriendInfo::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
FILE: WeChatRobot/CFriendInfo.h
function class (line 6) | class CFriendInfo : public CDialogEx
FILE: WeChatRobot/CFriendList.cpp
function BOOL (line 91) | BOOL CFriendList::OnInitDialog()
function afx_msg (line 119) | afx_msg LRESULT CFriendList::OnShowfriendlist(WPARAM wParam, LPARAM lParam)
function afx_msg (line 585) | afx_msg LRESULT CFriendList::OnSavefriendlist(WPARAM wParam, LPARAM lParam)
FILE: WeChatRobot/CFriendList.h
function class (line 6) | class CFriendList : public CDialogEx
FILE: WeChatRobot/CFunctions.h
function class (line 6) | class CFunctions : public CDialogEx
FILE: WeChatRobot/CInformation.cpp
function BOOL (line 59) | BOOL CInformation::OnInitDialog()
function BOOL (line 76) | BOOL CInformation::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
FILE: WeChatRobot/CInformation.h
function class (line 6) | class CInformation : public CDialogEx
FILE: WeChatRobot/CInjectTools.cpp
function CString (line 14) | CString GetAppRegeditPath(CString strAppName)
function CString (line 67) | CString GetAppRegeditPath2(CString strAppName)
function DWORD (line 120) | DWORD ProcessNameFindPID(const char* ProcessName)
function BOOL (line 147) | BOOL InjectDll(HANDLE& wxPid)
function BOOL (line 256) | BOOL CheckIsInject(DWORD dwProcessid)
FILE: WeChatRobot/CInviteGroupMember.h
function class (line 6) | class CInviteGroupMember : public CDialogEx
FILE: WeChatRobot/CMain.cpp
function BOOL (line 48) | BOOL CMain::OnInitDialog()
function BOOL (line 125) | BOOL CMain::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
FILE: WeChatRobot/CMain.h
function class (line 6) | class CMain : public CDialogEx
FILE: WeChatRobot/CModifyVersion.h
function class (line 6) | class CModifyVersion : public CDialogEx
FILE: WeChatRobot/CMultiOpen.cpp
function BOOL (line 37) | BOOL ElevatePrivileges()
function HANDLE (line 63) | HANDLE DuplicateHandleEx(DWORD pid, HANDLE h, DWORD flags)
function GetProcIds (line 91) | int GetProcIds(LPWSTR Name, DWORD* Pids)
function BOOL (line 126) | BOOL IsTargetPid(DWORD Pid, DWORD* Pids, int num)
function PatchWeChat (line 147) | int PatchWeChat()
function OpenWeChat (line 309) | void OpenWeChat()
FILE: WeChatRobot/CMultiOpen.h
type LONG (line 6) | typedef LONG NTSTATUS;
type SYSTEM_INFORMATION_CLASS (line 10) | typedef enum _SYSTEM_INFORMATION_CLASS {
type CLIENT_ID (line 67) | typedef struct _CLIENT_ID
type UNICODE_STRING (line 73) | typedef struct
type OBJECT_ATTRIBUTES (line 80) | typedef struct _OBJECT_ATTRIBUTES
type IO_COUNTERSEX (line 90) | typedef struct _IO_COUNTERSEX {
type THREAD_STATE (line 99) | typedef enum {
type VM_COUNTERS (line 110) | typedef struct _VM_COUNTERS {
type VM_COUNTERS (line 123) | typedef VM_COUNTERS *PVM_COUNTERS;
type SYSTEM_THREADS (line 125) | typedef struct _SYSTEM_THREADS {
type SYSTEM_PROCESSES (line 139) | typedef struct _SYSTEM_PROCESSES { // Information Class 5
type SYSTEM_HANDLE_INFORMATION (line 157) | typedef struct _SYSTEM_HANDLE_INFORMATION
type SYSTEM_HANDLE_TABLE_ENTRY_INFO (line 167) | typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO {
type SYSTEM_HANDLE_INFORMATION1 (line 177) | typedef struct _SYSTEM_HANDLE_INFORMATION1 {
type OBJECT_INFORMATION_CLASS (line 182) | typedef enum _OBJECT_INFORMATION_CLASS {
type OBJECT_NAME_INFORMATION (line 190) | typedef struct _OBJECT_NAME_INFORMATION {
FILE: WeChatRobot/CMyTableCtrl.h
function class (line 6) | class CMyTableCtrl : public CTabCtrl
FILE: WeChatRobot/COpenUrl.h
function class (line 6) | class COpenUrl : public CDialogEx
FILE: WeChatRobot/CPay.h
function class (line 6) | class CPay : public CDialogEx
FILE: WeChatRobot/CRoomAnnouncement.h
function class (line 6) | class CRoomAnnouncement : public CDialogEx
FILE: WeChatRobot/CSendChatRoomAt.h
function class (line 6) | class CSendChatRoomAt : public CDialogEx
FILE: WeChatRobot/CSendMsg.cpp
function BOOL (line 55) | BOOL CSendMsg::OnInitDialog()
FILE: WeChatRobot/CSendMsg.h
function class (line 6) | class CSendMsg : public CDialogEx
FILE: WeChatRobot/CSendXmlAricle.h
function class (line 6) | class CSendXmlAricle : public CDialogEx
FILE: WeChatRobot/CSendXmlCard.h
function class (line 6) | class CSendXmlCard : public CDialogEx
FILE: WeChatRobot/CSetRemark.h
function class (line 6) | class CSetRemark : public CDialogEx
FILE: WeChatRobot/CSetRoomName.h
function class (line 6) | class CSetRoomName : public CDialogEx
FILE: WeChatRobot/WeChatRobot.cpp
function BOOL (line 40) | BOOL CWeChatRobotApp::InitInstance()
FILE: WeChatRobot/WeChatRobot.h
function class (line 19) | class CWeChatRobotApp : public CWinApp
FILE: WeChatRobot/WeChatRobotDlg.cpp
class CAboutDlg (line 21) | class CAboutDlg : public CDialogEx
function BOOL (line 79) | BOOL CWeChatRobotDlg::OnInitDialog()
function HCURSOR (line 170) | HCURSOR CWeChatRobotDlg::OnQueryDragIcon()
function BOOL (line 185) | BOOL CWeChatRobotDlg::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataSt...
FILE: WeChatRobot/WeChatRobotDlg.h
function class (line 9) | class CWeChatRobotDlg : public CDialogEx
FILE: WeChatRobot/data.h
function MessageStruct (line 4) | struct MessageStruct
type ChatMessageData (line 24) | struct ChatMessageData
type XmlCardMessage (line 37) | struct XmlCardMessage
type AtMsg (line 44) | struct AtMsg
type SendXmlArticleStruct (line 52) | struct SendXmlArticleStruct
type PersonalInformation (line 64) | struct PersonalInformation
type UserInfo (line 89) | struct UserInfo
type ChatRoomMemberInfo (line 98) | struct ChatRoomMemberInfo
type UserInfoDetail (line 106) | struct UserInfoDetail
Condensed preview — 108 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (300K chars).
[
{
"path": "CLAUDE.md",
"chars": 8434,
"preview": "# CLAUDE.md\r\n\r\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\r\n\r"
},
{
"path": "README.md",
"chars": 756,
"preview": "# WeChatRobot\r\n\r\n> ⚠️ **本项目已停止维护,仅供学习参考**\r\n\r\n📖 **完整项目文档请查看:[README_DETAILS.md](README_DETAILS.md)**\r\n\r\n---\r\n\r\n## 个人动态\r\n\r"
},
{
"path": "README_DETAILS.md",
"chars": 1734,
"preview": "# 项目详细信息\r\n\r\n## 实现功能\r\n\r\n\r\n\r\n## 项目介绍\r\n\r\n编译环境为VS2017 只支持微信2.6.8.52版本。附上2.6.8.52微信版本"
},
{
"path": "WeChat 3.2.1.154安装包下载.txt",
"chars": 81,
"preview": "链接:https://pan.baidu.com/s/1Eqmwo3vt-RRh4rVxCM5v8g \r\n提取码:1x09 \r\n--来自百度网盘超级会员V6的分享"
},
{
"path": "WeChatHelper/CAutoFunction.cpp",
"chars": 10668,
"preview": "#include \"stdafx.h\"\r\n#include \"CAutoFunction.h\"\r\n#include \"Function.h\"\r\n#include <atlconv.h>\r\n#include <direct.h> //_mkd"
},
{
"path": "WeChatHelper/CAutoFunction.h",
"chars": 712,
"preview": "#pragma once\r\n#include <atlstr.h>\r\n\r\nvoid AgreeUserRequest(wchar_t* v1, wchar_t* v2);\t//ͬ\r\nvoid AutoAgreeUserRequest(wst"
},
{
"path": "WeChatHelper/CPublic.cpp",
"chars": 2290,
"preview": "#include \"stdafx.h\"\r\n#include \"CPublic.h\"\r\n\r\n\r\n//************************************************************\r\n// : Hook"
},
{
"path": "WeChatHelper/CPublic.h",
"chars": 298,
"preview": "#pragma once\r\n#include <string>\r\nusing namespace std;\r\n\r\n\r\nvoid HookAnyAddress(DWORD dwHookAddr, LPVOID dwJmpAddress);\t\t"
},
{
"path": "WeChatHelper/ChatRecord.cpp",
"chars": 10982,
"preview": "\r\n#include \"stdafx.h\"\r\n#include <string>\r\n#include <Shlwapi.h>\r\n#pragma comment(lib,\"Shlwapi.lib\")\r\n#include \"ChatRecord"
},
{
"path": "WeChatHelper/ChatRecord.h",
"chars": 207,
"preview": "#pragma once\r\n#include <string>\r\n\r\nvoid HookChatRecord();\t\t//HOOK¼\r\nvoid RecieveWxMesage();\t\t//Ϣ\r\nvoid __stdcall SendWx"
},
{
"path": "WeChatHelper/ChatRoomOperate.cpp",
"chars": 10654,
"preview": "#include \"stdafx.h\"\r\n#include \"ChatRoomOperate.h\"\r\n#include <atlconv.h>\r\n\r\n//*******************************************"
},
{
"path": "WeChatHelper/ChatRoomOperate.h",
"chars": 558,
"preview": "#pragma once\r\n\r\nvoid SetWxRoomAnnouncement(wchar_t* chatroomwxid,wchar_t* Announcement);\t//Ⱥ\r\nvoid QuitChatRoom(wchar_t*"
},
{
"path": "WeChatHelper/FriendList.cpp",
"chars": 11934,
"preview": "#include \"stdafx.h\"\r\n#include \"FriendList.h\"\r\n#include \"shellapi.h\"\r\n#include <sstream>\r\n#include <iomanip>\r\n#include <s"
},
{
"path": "WeChatHelper/FriendList.h",
"chars": 597,
"preview": "#pragma once\r\n\r\nvoid HookGetFriendList();\t\t//HOOKȡбcall\r\nvoid GetUserListInfo();\t\t //ȡб\r\nvoid __stdcall SendUserListI"
},
{
"path": "WeChatHelper/Function.cpp",
"chars": 2686,
"preview": "#include \"stdafx.h\"\r\n#include \"Function.h\"\r\n#include <stdlib.h >\r\n#include <vector>\r\n#include \"FriendList.h\"\r\n\r\nvector<w"
},
{
"path": "WeChatHelper/Function.h",
"chars": 168,
"preview": "#pragma once\r\n#include <string>\r\nusing namespace std;\r\n\r\nvoid AddWxUser(wchar_t* wxid, wchar_t* msg);\t//Ӻ\r\nvoid AntiRevo"
},
{
"path": "WeChatHelper/InitWeChat.cpp",
"chars": 2395,
"preview": "#include \"stdafx.h\"\r\n#include <strstream>\r\n#include <iostream>\r\n#pragma comment(lib,\"Version.lib\")\r\n\r\n\r\n\r\n//************"
},
{
"path": "WeChatHelper/InitWeChat.h",
"chars": 99,
"preview": "#pragma once\r\n#include \"stdafx.h\"\r\n\r\nBOOL IsWxVersionValid();\t//鵱ǰŰ汾\r\nvoid CheckIsLogin();\t//Ƿ½\r\n"
},
{
"path": "WeChatHelper/Login.cpp",
"chars": 2453,
"preview": "#include \"stdafx.h\"\r\n#include \"Login.h\"\r\n\r\n\r\nDWORD dwRetAddr = (DWORD)GetModuleHandle(L\"WeChatWin.dll\") + WxQrCodeOffset"
},
{
"path": "WeChatHelper/Login.h",
"chars": 160,
"preview": "#pragma once\r\n#include \"stdafx.h\"\r\n\r\n\r\nvoid HookQrCode();\t//HOOKά\r\nvoid ShowPic();\t\t//ʾά\r\nvoid __stdcall SaveImg(DWORD q"
},
{
"path": "WeChatHelper/MainWindow.cpp",
"chars": 341,
"preview": "#include \"stdafx.h\"\r\n#include \"MainWindow.h\"\r\n\r\n\r\nvoid LogoutWeChat()\r\n{\r\n\tDWORD dwBaseAddress = (DWORD)GetModuleHandle("
},
{
"path": "WeChatHelper/MainWindow.h",
"chars": 57,
"preview": "#pragma once\r\n#include \"stdafx.h\"\r\n\r\nvoid LogoutWeChat();"
},
{
"path": "WeChatHelper/SelfInformation.cpp",
"chars": 7994,
"preview": "#include \"stdafx.h\"\r\n#include \"SelfInformation.h\"\r\n#include \"Function.h\"\r\n#include \"CPublic.h\"\r\n\r\n\r\n//******************"
},
{
"path": "WeChatHelper/SelfInformation.h",
"chars": 38,
"preview": "#pragma once\r\n\r\nvoid GetInformation();"
},
{
"path": "WeChatHelper/WeChatHelper.cpp",
"chars": 73,
"preview": "// WeChatHelper.cpp : 定义 DLL 应用程序的导出函数。\r\n//\r\n\r\n#include \"stdafx.h\"\r\n\r\n\r\n"
},
{
"path": "WeChatHelper/WeChatHelper.vcxproj",
"chars": 9622,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
},
{
"path": "WeChatHelper/WeChatHelper.vcxproj.filters",
"chars": 5744,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
},
{
"path": "WeChatHelper/WeChatHelper.vcxproj.user",
"chars": 438,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbu"
},
{
"path": "WeChatHelper/WndMsgLoop.cpp",
"chars": 5571,
"preview": "#include \"stdafx.h\"\r\n#include \"WndMsgLoop.h\"\r\n#include \"InitWeChat.h\"\r\n#include \"Login.h\"\r\n#include \"MainWindow.h\"\r\n#inc"
},
{
"path": "WeChatHelper/WndMsgLoop.h",
"chars": 208,
"preview": "#pragma once\r\n#include \"stdafx.h\"\r\n\r\n\r\nvoid InitWindow(HMODULE hModule);\t//ʼ\r\nvoid RegisterWindow(HMODULE hModule);\t\t//ע"
},
{
"path": "WeChatHelper/data.h",
"chars": 4082,
"preview": "#pragma once\r\n\r\n\r\n//ͨýṹ\r\nstruct GeneralStruct\r\n{\r\n\twchar_t* pstr;\r\n\tint iLen;\r\n\tint iMaxLen;\r\n\tint full1;\r\n\tint full2;\r"
},
{
"path": "WeChatHelper/dllmain.cpp",
"chars": 609,
"preview": "// dllmain.cpp : 定义 DLL 应用程序的入口点。\r\n#include \"stdafx.h\"\r\n#include \"WndMsgLoop.h\"\r\n\r\n\r\n\r\nBOOL APIENTRY DllMain( HMODULE h"
},
{
"path": "WeChatHelper/message.h",
"chars": 1342,
"preview": "#pragma once\r\n\r\n\r\n#define WM_Login 0\r\n#define WM_ShowQrPicture 1\r\n#define WM_Logout 2\r\n#define WM_GetFriendList 3\r\n#defi"
},
{
"path": "WeChatHelper/offset.h",
"chars": 4195,
"preview": "#pragma once\r\n#define WxFriendList 0x5244A8\t\t\t\t\t//好友列表 1\r\n#define WxFriendListCall 0x64550\t\t\t\t//好友列表 1\r\n#define WxReciv"
},
{
"path": "WeChatHelper/stdafx.cpp",
"chars": 43,
"preview": "#include \"stdafx.h\"\r\n#include \"message.h\"\r\n"
},
{
"path": "WeChatHelper/stdafx.h",
"chars": 404,
"preview": "// stdafx.h: 标准系统包含文件的包含文件,\r\n// 或是经常使用但不常更改的\r\n// 项目特定的包含文件\r\n//\r\n\r\n#pragma once\r\n\r\n#include \"targetver.h\"\r\n\r\n#define WIN"
},
{
"path": "WeChatHelper/targetver.h",
"chars": 184,
"preview": "#pragma once\r\n\r\n// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。\r\n\r\n// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并\r\n// 将 _WIN32"
},
{
"path": "WeChatRobot/CAboutAuthor.cpp",
"chars": 1234,
"preview": "// CAboutAuthor.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CAboutAuthor.h\"\r\n#include \"af"
},
{
"path": "WeChatRobot/CAboutAuthor.h",
"chars": 538,
"preview": "#pragma once\r\n\r\n\r\n// CAboutAuthor 对话框\r\n\r\nclass CAboutAuthor : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CAboutAuthor)\r\n\r\npu"
},
{
"path": "WeChatRobot/CAddChatRoomMember.cpp",
"chars": 1520,
"preview": "// CAddChatRoomMember.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CAddChatRoomMember.h\"\r\n"
},
{
"path": "WeChatRobot/CAddChatRoomMember.h",
"chars": 568,
"preview": "#pragma once\r\n\r\n\r\n// CAddChatRoomMember 对话框\r\n\r\nclass CAddChatRoomMember : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CAddCha"
},
{
"path": "WeChatRobot/CAddUser.cpp",
"chars": 1429,
"preview": "// CAddUser.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CAddUser.h\"\r\n#include \"afxdialoge"
},
{
"path": "WeChatRobot/CAddUser.h",
"chars": 459,
"preview": "#pragma once\r\n\r\n\r\n// CAddUser 对话框\r\n\r\nclass CAddUser : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CAddUser)\r\n\r\npublic:\r\n\tCAdd"
},
{
"path": "WeChatRobot/CChatRecords.cpp",
"chars": 6423,
"preview": "// CChatRecords.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CChatRecords.h\"\r\n#include \"af"
},
{
"path": "WeChatRobot/CChatRecords.h",
"chars": 539,
"preview": "#pragma once\r\n\r\n\r\n// CChatRecords 对话框\r\n\r\nclass CChatRecords : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CChatRecords)\r\n\r\npu"
},
{
"path": "WeChatRobot/CChatRoomMember.cpp",
"chars": 6352,
"preview": "// CChatRoomMember.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CChatRoomMember.h\"\r\n#inclu"
},
{
"path": "WeChatRobot/CChatRoomMember.h",
"chars": 846,
"preview": "#pragma once\r\n\r\n\r\n// CChatRoomMember 对话框\r\n\r\nclass CChatRoomMember : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CChatRoomMemb"
},
{
"path": "WeChatRobot/CCreateChatRoom.cpp",
"chars": 1064,
"preview": "// CCreateChatRoom.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CCreateChatRoom.h\"\r\n#inclu"
},
{
"path": "WeChatRobot/CCreateChatRoom.h",
"chars": 506,
"preview": "#pragma once\r\n\r\n\r\n// CCreateChatRoom 对话框\r\n\r\nclass CCreateChatRoom : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CCreateChatRo"
},
{
"path": "WeChatRobot/CDecryptImage.cpp",
"chars": 3529,
"preview": "// CDecryptImage.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CDecryptImage.h\"\r\n#include \""
},
{
"path": "WeChatRobot/CDecryptImage.h",
"chars": 599,
"preview": "#pragma once\r\n\r\n\r\n// CDecryptImage 对话框\r\n\r\nclass CDecryptImage : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CDecryptImage)\r\n\r"
},
{
"path": "WeChatRobot/CFollowAccount.cpp",
"chars": 1014,
"preview": "// CFollowAccount.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CFollowAccount.h\"\r\n#include"
},
{
"path": "WeChatRobot/CFollowAccount.h",
"chars": 477,
"preview": "#pragma once\r\n\r\n\r\n// CFollowAccount 对话框\r\n\r\nclass CFollowAccount : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CFollowAccount)"
},
{
"path": "WeChatRobot/CFriendInfo.cpp",
"chars": 1549,
"preview": "// CFriendInfo.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CFriendInfo.h\"\r\n#include \"afxd"
},
{
"path": "WeChatRobot/CFriendInfo.h",
"chars": 712,
"preview": "#pragma once\r\n\r\n\r\n// CFriendInfo 对话框\r\n\r\nclass CFriendInfo : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CFriendInfo)\r\n\r\npubli"
},
{
"path": "WeChatRobot/CFriendList.cpp",
"chars": 15744,
"preview": "// CFriendList.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CFriendList.h\"\r\n#include \"afxd"
},
{
"path": "WeChatRobot/CFriendList.h",
"chars": 1475,
"preview": "#pragma once\r\n\r\n\r\n// CFriendList 对话框\r\n\r\nclass CFriendList : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CFriendList)\r\n\r\npubli"
},
{
"path": "WeChatRobot/CFunctions.cpp",
"chars": 6407,
"preview": "// CFunctions.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include <direct.h>\r\n#include <stdio.h>\r\n#include \"WeChatRobot.h\"\r\n"
},
{
"path": "WeChatRobot/CFunctions.h",
"chars": 883,
"preview": "#pragma once\r\n\r\n\r\n// CFunctions 对话框\r\n\r\nclass CFunctions : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CFunctions)\r\n\r\npublic:\r"
},
{
"path": "WeChatRobot/CInformation.cpp",
"chars": 2226,
"preview": "#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CInformation.h\"\r\n#include \"afxdialogex.h\"\r\n\r\n\r\n\r\n\r\n// CInforma"
},
{
"path": "WeChatRobot/CInformation.h",
"chars": 727,
"preview": "#pragma once\r\n\r\n\r\n// CInformation 对话框\r\n\r\nclass CInformation : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CInformation)\r\n\r\npu"
},
{
"path": "WeChatRobot/CInjectTools.cpp",
"chars": 6434,
"preview": "#include \"stdafx.h\"\r\n#include \"CInjectTools.h\"\r\n#include <direct.h>\r\n#include <stdlib.h>\r\n#include <TlHelp32.h>\r\n#includ"
},
{
"path": "WeChatRobot/CInjectTools.h",
"chars": 163,
"preview": "#pragma once\r\n\r\nDWORD ProcessNameFindPID(const char* ProcessName);\t//ͨȡID\r\nBOOL InjectDll(HANDLE& wxPid); //עdll\r\nBOOL C"
},
{
"path": "WeChatRobot/CInviteGroupMember.cpp",
"chars": 1055,
"preview": "// CInviteGroupMember.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CInviteGroupMember.h\"\r\n"
},
{
"path": "WeChatRobot/CInviteGroupMember.h",
"chars": 558,
"preview": "#pragma once\r\n\r\n\r\n// CInviteGroupMember 对话框\r\n\r\nclass CInviteGroupMember : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CInvite"
},
{
"path": "WeChatRobot/CMain.cpp",
"chars": 4531,
"preview": "// CMain.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CMain.h\"\r\n#include \"afxdialogex.h\"\r\n"
},
{
"path": "WeChatRobot/CMain.h",
"chars": 670,
"preview": "#pragma once\r\n#include \"CMyTableCtrl.h\"\r\n\r\n// CMain 对话框\r\n\r\nclass CMain : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CMain)\r\n"
},
{
"path": "WeChatRobot/CModifyVersion.cpp",
"chars": 782,
"preview": "// CModifyVersion.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CModifyVersion.h\"\r\n#include"
},
{
"path": "WeChatRobot/CModifyVersion.h",
"chars": 475,
"preview": "#pragma once\r\n\r\n\r\n// CModifyVersion 对话框\r\n\r\nclass CModifyVersion : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CModifyVersion)"
},
{
"path": "WeChatRobot/CMultiOpen.cpp",
"chars": 7375,
"preview": "#include \"stdafx.h\"\r\n#include <TlHelp32.h>\r\n#include <Shlwapi.h>\r\n#pragma comment(lib, \"shlwapi\")\r\n#include \"CMultiOpen."
},
{
"path": "WeChatRobot/CMultiOpen.h",
"chars": 6982,
"preview": "#pragma once\r\n\r\n#include <Windows.h>\r\n\r\n/*ͷļ*/\r\ntypedef LONG NTSTATUS;\r\n#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0"
},
{
"path": "WeChatRobot/CMyTableCtrl.cpp",
"chars": 693,
"preview": "// CMyTableCtrl.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CMyTableCtrl.h\"\r\n\r\n\r\n// CMyTa"
},
{
"path": "WeChatRobot/CMyTableCtrl.h",
"chars": 308,
"preview": "#pragma once\r\n\r\n\r\n// CMyTableCtrl\r\n\r\nclass CMyTableCtrl : public CTabCtrl\r\n{\r\n\tDECLARE_DYNAMIC(CMyTableCtrl)\r\n\r\npublic:\r"
},
{
"path": "WeChatRobot/COpenUrl.cpp",
"chars": 1360,
"preview": "// COpenUrl.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"COpenUrl.h\"\r\n#include \"afxdialoge"
},
{
"path": "WeChatRobot/COpenUrl.h",
"chars": 434,
"preview": "#pragma once\r\n\r\n\r\n// COpenUrl 对话框\r\n\r\nclass COpenUrl : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(COpenUrl)\r\n\r\npublic:\r\n\tCOpe"
},
{
"path": "WeChatRobot/CPay.cpp",
"chars": 446,
"preview": "// CPay.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CPay.h\"\r\n#include \"afxdialogex.h\"\r\n\r\n"
},
{
"path": "WeChatRobot/CPay.h",
"chars": 349,
"preview": "#pragma once\r\n\r\n\r\n// CPay 对话框\r\n\r\nclass CPay : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CPay)\r\n\r\npublic:\r\n\tCPay(CWnd* pPare"
},
{
"path": "WeChatRobot/CRoomAnnouncement.cpp",
"chars": 1638,
"preview": "// CRoomAnnouncement.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CRoomAnnouncement.h\"\r\n#i"
},
{
"path": "WeChatRobot/CRoomAnnouncement.h",
"chars": 572,
"preview": "#pragma once\r\n\r\n\r\n// CRoomAnnouncement 对话框\r\n\r\nclass CRoomAnnouncement : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CRoomAnno"
},
{
"path": "WeChatRobot/CSendChatRoomAt.cpp",
"chars": 1767,
"preview": "// CSendChatRoomAt.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CSendChatRoomAt.h\"\r\n#inclu"
},
{
"path": "WeChatRobot/CSendChatRoomAt.h",
"chars": 669,
"preview": "#pragma once\r\n\r\n\r\n// CSendChatRoomAt 对话框\r\n\r\nclass CSendChatRoomAt : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CSendChatRoom"
},
{
"path": "WeChatRobot/CSendMsg.cpp",
"chars": 3466,
"preview": "// CSendMsg.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CSendMsg.h\"\r\n#include \"afxdialoge"
},
{
"path": "WeChatRobot/CSendMsg.h",
"chars": 624,
"preview": "#pragma once\r\n\r\n\r\n// CSendMsg 对话框\r\n\r\nclass CSendMsg : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CSendMsg)\r\n\r\npublic:\r\n\tCSen"
},
{
"path": "WeChatRobot/CSendXmlAricle.cpp",
"chars": 1339,
"preview": "// CSendXmlAricle.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CSendXmlAricle.h\"\r\n#include"
},
{
"path": "WeChatRobot/CSendXmlAricle.h",
"chars": 592,
"preview": "#pragma once\r\n\r\n\r\n// CSendXmlAricle 对话框\r\n\r\nclass CSendXmlAricle : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CSendXmlAricle)"
},
{
"path": "WeChatRobot/CSendXmlCard.cpp",
"chars": 1689,
"preview": "// CSendXmlCard.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CSendXmlCard.h\"\r\n#include \"af"
},
{
"path": "WeChatRobot/CSendXmlCard.h",
"chars": 546,
"preview": "#pragma once\r\n\r\n\r\n// CSendXmlCard 对话框\r\n\r\nclass CSendXmlCard : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CSendXmlCard)\r\n\r\npu"
},
{
"path": "WeChatRobot/CSetRemark.cpp",
"chars": 731,
"preview": "// CSetRemark.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CSetRemark.h\"\r\n#include \"afxdia"
},
{
"path": "WeChatRobot/CSetRemark.h",
"chars": 510,
"preview": "#pragma once\r\n\r\n\r\n// CSetRemark 对话框\r\n\r\nclass CSetRemark : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CSetRemark)\r\n\r\npublic:\r"
},
{
"path": "WeChatRobot/CSetRoomName.cpp",
"chars": 1498,
"preview": "// CSetRoomName.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"CSetRoomName.h\"\r\n#include \"af"
},
{
"path": "WeChatRobot/CSetRoomName.h",
"chars": 535,
"preview": "#pragma once\r\n\r\n\r\n// CSetRoomName 对话框\r\n\r\nclass CSetRoomName : public CDialogEx\r\n{\r\n\tDECLARE_DYNAMIC(CSetRoomName)\r\n\r\npu"
},
{
"path": "WeChatRobot/WeChatRobot.cpp",
"chars": 2131,
"preview": "\r\n// WeChatRobot.cpp: 定义应用程序的类行为。\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"WeChatRobotDlg.h\"\r\n\r\n"
},
{
"path": "WeChatRobot/WeChatRobot.h",
"chars": 432,
"preview": "\r\n// WeChatRobot.h: PROJECT_NAME 应用程序的主头文件\r\n//\r\n\r\n#pragma once\r\n\r\n\r\n#ifndef __AFXWIN_H__\r\n\t#error \"在包含此文件之前包含“stdafx.h”"
},
{
"path": "WeChatRobot/WeChatRobot.vcxproj",
"chars": 13198,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.micros"
},
{
"path": "WeChatRobot/WeChatRobot.vcxproj.filters",
"chars": 11903,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
},
{
"path": "WeChatRobot/WeChatRobot.vcxproj.user",
"chars": 232,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbu"
},
{
"path": "WeChatRobot/WeChatRobotDlg.cpp",
"chars": 5823,
"preview": "\r\n// WeChatRobotDlg.cpp: 实现文件\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include \"WeChatRobot.h\"\r\n#include \"WeChatRobotDlg.h\"\r\n#inclu"
},
{
"path": "WeChatRobot/WeChatRobotDlg.h",
"chars": 771,
"preview": "\r\n// WeChatRobotDlg.h: 头文件\r\n//\r\n\r\n#pragma once\r\n\r\n\r\n// CWeChatRobotDlg 对话框\r\nclass CWeChatRobotDlg : public CDialogEx\r\n{"
},
{
"path": "WeChatRobot/data.h",
"chars": 2365,
"preview": "#pragma once\r\n\r\n//ͨϢṹ\r\nstruct MessageStruct\r\n{\r\n\twchar_t msgdata1[MAX_PATH];\r\n\twchar_t msgdata2[MAX_PATH];\r\n\r\n\tMessageSt"
},
{
"path": "WeChatRobot/message.h",
"chars": 1447,
"preview": "#pragma once\r\n\r\n//ͻ˺ͷͨѶϢ\r\n#define WM_Login 0\r\n#define WM_ShowQrPicture 1\r\n#define WM_Logout 2\r\n#define WM_GetFriendList "
},
{
"path": "WeChatRobot/resource.h",
"chars": 7164,
"preview": "//{{NO_DEPENDENCIES}}\r\n// Microsoft Visual C++ 生成的包含文件。\r\n// 供 WeChatRobot.rc 使用\r\n//\r\n#define IDM_ABOUTBOX "
},
{
"path": "WeChatRobot/stdafx.cpp",
"chars": 118,
"preview": "\r\n// stdafx.cpp : 只包括标准包含文件的源文件\r\n// WeChatRobot.pch 将作为预编译标头\r\n// stdafx.obj 将包含预编译类型信息\r\n\r\n#include \"stdafx.h\"\r\n\r\n\r\n\r\n"
},
{
"path": "WeChatRobot/stdafx.h",
"chars": 1819,
"preview": "\r\n// stdafx.h : 标准系统包含文件的包含文件,\r\n// 或是经常使用但不常更改的\r\n// 特定于项目的包含文件\r\n\r\n#pragma once\r\n\r\n#ifndef VC_EXTRALEAN\r\n#define VC_EXTR"
},
{
"path": "WeChatRobot/targetver.h",
"chars": 185,
"preview": "#pragma once\r\n\r\n// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。\r\n\r\n// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将\r\n// 将 _WIN3"
},
{
"path": "WeChatRobot.sln",
"chars": 2211,
"preview": "\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 15\r\nVisualStudioVersion = 15.0.28307.572"
}
]
// ... and 3 more files (download for full content)
About this extraction
This page contains the full source code of the TonyChen56/WeChatRobot GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 108 files (258.0 KB), approximately 86.3k tokens, and a symbol index with 158 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.