describe
PC WeChat robot implements the following functions:
- Get the address book
- Send text, pictures, files, xml articles, business cards, group Ai Te messages
- Query friend information based on wxid
- Get all group members wxid based on group ID
- Check the status of friends (whether a friend is deleted or blocked)
- Receive various messages, write callback functions for processing
- Encapsulate COM interface to facilitate calls using your favorite language
- Group Management
- Open WeChat more
use
- Taobao order
- Traceless Powder
- Collection of WeChat public account
- Chat history backup
- Other uses you can think of
Available versions
WeChat PC version 3.5.0.46
WeChat PC version 3.6.0.18
WeChat PC version 3.7.0.26
WeChat PC version 3.7.0.30
The main branch corresponds to WeChat version 3.7.0.30. For other versions, please check the corresponding branch.
Compilation environment
Visual Studio 2019 (Platform configuration: win32(x86))
principle
Through reverse PC WeChat, key CALL is located, dll inline assembly calls to register 32-bit COM components for external calls of 64-bit/32-bit processes
Table of Contents Description
./CWeChatRobot : Implementation code of COM component
./DWeChatRobot : Injected DLL implementation code, socket and COM version can be compiled according to platform configuration.
./old_projects : Contains C# call examples and E-language calls in version 3.7.0.26
./Python : python example and interface test file
./wxDriver : driver's implementation code
To download binary files, please go to: Release
Quick Start
Execute the following command with administrator privileges:
# 安装
CWeChatRobot.exe /regserver
# 卸载
CWeChatRobot.exe /unregserver
Call
Python:
Reference wxRobot.py
C#:
Refer to ComWechatRobotCsharp, thanks to @RingoStudio for his contribution
Easy Language:
Refer to ESDK, thanks to @lovezm for his contribution
More features
- Try adding functionality in issue
When you have time, you will develop in the above order. However, the plan is just a plan. If it is not implemented, please forgive me . You are welcome to submit a PR.
Update records
2022.04.01
- Use SAFEARRAY to return to the address book list, which correctly displays special symbols in friend nicknames
- Description of adding directory to README
- Update C# sample code and add traversal examples of friend list
2022.04.11
- Modify the interface to obtain personal information and send articles, compatible with the old version of wxid (untested, please mention ISSUE if you have any questions)
- Add an interface to receive messages, and you can write a callback to process messages (refer to Python sample file)
2022.04.12
- Add an interface to send group Aite messages
2022.04.12
- Add to get all group members wxid interface through group ID
2022.04.13
- Update the group Aite interface, which can be used to multiple users at the same time
2022.04.18
- Add to get the database handle interface (partial handles, you need to get the full handle)
- Add an SQL command execution interface
- Add an online database backup interface
2022.06.01
- Adapt to WeChat version 3.7.0.26 , some functions have not been tested. If you have any questions, please report an issue
2022.06.02
- Add a friend application interface (with the message receiving interface, you can automatically pass the friend)
- Add a get chat history database handle (friend application message type is 0x25)
- Optimized StartService interface, no longer close remote processes during repeated injection
2022.06.04
- Complete the COM interface of adding friends through wxid and v3 data (subsequently add the query V3 data interface through WeChat, mobile phone number, and QQ number)
- Optimize the logic of receiving messages and add message time; add a new Hook to send messages, return data to distinguish sending and receiving by a BOOL value
- Fixed a bug that may cause the COM interface to fail to load DWeChatRobot.dll to calculate offset under Release configuration
2022.06.07
- Add an interface to get the current WeChat version (read the registry) and start WeChat
- Optimize the database query interface, and now you can query BLOB types normally
2022.06.10
- Added follow-up to the official account, search for user information on the Internet, Hook voice, unencrypted pictures, and custom WeChat version number interface
- The interface between Hook voice and pictures is temporarily flawed, and the picture may not be downloaded automatically after receiving it; the file name of the voice message is temporarily timestamped, and the plan is to be replaced with the message id. Optimize when you have time.
2022.06.13
- Optimize the sending Aite message interface, add a new parameter to indicate whether to automatically fill the nickname of the Aite person
- Optimize the article message sending interface, add a new parameter to display message card thumbnails
- Add a new deleted friend interface
- Added a sending mini program interface
2022.06.18
- Fixed multiple bugs
- Organize the code structure to facilitate subsequent development of websocket-based interfaces
- Add 64-bit program to inject DLL to 32-bit program driver
2022.06.24
- Solve the problem that socket may be incomplete in Python scripts
- Solve the problem that if multiple messages from the same person are synchronized during heartbeat, only one will be returned
- Thanks to @shangdev for the idea. Now when you turn on hook pictures, the automatic download time period will be modified to the whole day.
2022.06.30
- Adapted to version 3.7.0.30
2022.07.19
- Added a new modification remark interface
- Added group management functions, including adding members, deleting members, setting announcements, modifying group names, setting personal nicknames within the group, and obtaining group member nicknames
2022.07.24
- Add multi-open management
2022.07.28
- Solve some known problems and optimize multi-open management
- Refactoring some implementations in COM
2022.08.13
- Now the message HOOK content contains the message ID
- Complete the http interface for sending messages, please refer to wxDriver.py. It will take some time for other interfaces to
- Added project configuration file, thanks to @amchii for the method provided
2022.08.21
- All functions, http interfaces are encapsulated, and can accept get and post requests.
- Provide an example of http interface calling, refer to wxDriver.py
2022.08.25
- The format of the receiving message is modified to json, and you can now also obtain the extended information, and you can obtain the file saving path from the extended information or be wxid by Aite
- Optimize the access to personal information and obtain friend information interface
2022.09.09
- Added the function of opening a built-in browser for WeChat
- Added the function of obtaining historical messages for official accounts (how much can be obtained without testing, please use it with caution to prevent the account from being blocked)
- Fixed a bug that caused pictures and voice to be saved to the WeChat installation directory instead of the specified directory
- Optimize the real-time message interface, and now you will bring your own wxid
- Optimize the image and voice saving paths to facilitate the distinction between messages from different accounts
2022.09.10
- Happy Mid-Autumn Festival
- Added a message forwarding function, please do not forward voice, red envelopes and other messages
- The
localId field has been added to the real-time message interface, which is used to forward the message interface; now you can also receive a revocation message reminder. - Optimize COM connection points, broadcast messages in the thread, and the client can block to wait for pictures, voice and other resources to land
2022.09.18
- Fixed a bug that cannot forward accurate messages when multiple MSG.dbs exist; now forwarding message function uses msgid as parameter
- Fixed a bug that caused WeChat to fail to get real-time messages when there was no selected session.
- Fixed a bug that caused memory access violations when some WeChat accounts acquired personal information.
- Optimize the real-time message interface and no longer returns the localId field; extrabuf now returns the original information instead of base64 encoded data; add a new field to distinguish whether the message sent by the mobile phone (the received message does not contain this field)
- Optimize the personal information interface and can now return to the personal folder path
- Optimize the group Aite interface, and prioritize the filling of the group nickname
- Added a QR code interface, and when calling this interface, it will switch to the QR code to log in
2022.09.22
- Added a8key function
- Fixed a bug that caused the access to the database handle interface to take effect only once.
2022.09.27
- Optimize the forwarding message interface, obtain the database handle interface, and add the original time stamp in real-time messages
2022.10.07
- Added sending original xml interface
- Added a new login interface
- Trying to fix crash issues caused by file sending failure and formatting timestamp
- A new field is added to get the location where the video message thumbnail is saved
2022.10.16
- Added payment interface
- Real-time message interface optimization, supports obtaining audio and video chat information, and supports obtaining prompt information when switching contacts on the mobile phone
- Fix some known issues
2022.11.2
- Support sending dynamic expressions
- Support automatic video download at night (real-time message monitoring needs to be enabled)
- Added the function of downloading message attachments through message id
Reward the author
Please give the author a star, thank you
Disclaimer
The code is for communication and learning only, please do not use it for illegal and commercial purposes! If any legal dispute arises, it has nothing to do with the author!