Github address: github.com/suruixin/we…
rendering
Auto reply message
Customize the reply file image
Custom reply message
Send a message
Group-sent message
Cancel auto Reply
background
hi! Everybody is good, today to bring my little tool kam set in the second quarter, subject of WeChat assistant, about in June 2019, saw a very interesting project WeChat daily said, had the good of the raspberry pie, want to deploy a version, used to do the daily weather push (forgive my poor, also often be rain) later found in the process of using the web version Wechat does not support wechat login registered after 2017 (there may be more wechat login now). After a long search process, we finally found teacher Zhao Qingming’s course on wechat Hook (it has been removed now), and decided to develop a version of wechat assistant tool as a breakthrough point. At present, the project has been finished
However, due to my limited ability, the DLL I wrote was terrible. Just as a big shot opened his own project (Weike-bot), I was very happy to use Electron to make my wechat assistant tool
Here is a brief introduction to my project
Technology stack
vue-cli3
vuetify
sass
electron-builder
electron-update
node-ffi-napi
Copy the code
For node-ffi-nAPI you can refer to my Node-ffi from Getting Started to Giving up (Installation) to install it
Version for
Node: 12.16.0-x86 node-gyp: 7.0.0 FFi-nAPI: 2.4.5 wechat version: 2.9.0.123Copy the code
Wechat: 2.9.0.123 Extraction code: J4m0
Injector and hook file addresses
hook
injector
directory
├ SRC │ ├ Config.ts │ │ ├ Config.ts │ │ ├ Config.ts │ │ ├ Index │ │ ├ ─ ├ ipc, └ │ ├ ipc, └ │ ├ ipc, └ │ ├ ipc, └ │ ├ Exercises, ├ exercises │ ├ ├ API │ ├ apis │ ├ exercises ├ apis │ ├ exercises ├ apis │ ├ exercises ├ exercises │ │ ├ views │ ├ vuexInterface. Ts │ │ ├ views │ ├ vuexInterface Vuex used interface │ │ └ weChatParams. Ts / / WeChat hook used interface │ ├ mainProcess / / main process store address │ │ ├ BrowserWindow / / main process configuration file │ │ │ └ │ │ ├ ├ SRC/exercises ├ ├ SRC/exercises │ ├ ├ SRC/exercises │ ├ ├ SRC/exercises │ ├ ├ SRC/exercises │ ├ ├ SRC/exercises │ ├ ├ SRC/exercises │ ├ ├ SRC/exercises │ ├ ├ SRC/exercises │ ├.exercises │ ├.exercises │ ├.exercises │ ├.exercises │ ├.exercises │ ├.exercises │ ├.exercises │ ├.exercises │ │ ├ bass Exercises API │ │ ├ Turing. exercises │ ├ turing. exercises │ ├ turing. exercises │ ├ exercises │ ├ sass │ ├ sass │ ├ exercises │ ├ sass │ ├ exercises │ ├ sass │ ├ exercises │ ├ Common │ │ ├ bass │ ├ Components │ │ ├ Content.vue │ │ ├ exercises │ ├ exercises │ │ ├ footer. At the bottom of the vue / / │ │ │ │ │ ├ navigation. The vue / / the left sidebar │ │ │ │ │ └ title. The vue / / head │ │ │ │ └ index. The vue file / / general home page entry │ │ ├ mix.└ │ ├ mix.txt │ │ ├ mix.txt │ │ ├ mix.txt │ │ ├ tool │ │ ├ API │ ├ API │ ├ common │ ├ exercises │ ├ common │ ├ exercises │ ├ exercises └ │ ├ exercises, ├ routes, └ │ ├ exercises, └ │ ├ routes, └ │ ├ exercises, exercises, exercises, exercises, exercises, exercises, exercises │ │ ├ exercises │ ├ modules │ │ ├ main. │ │ ├ userList. │ │ ├ exercises │ │ ├ exercises. │ │ ├ exercises. │ │ ├ exercises │ └ │ ├ ache, │ ├ ache, │ ├ ache, │ ├ ache, │ ├ ache, │ ├ ache, │ ├ ache, │ ├ ache, │ ├ ache │ │ ├ SendMsg │ │ ├ SendMsgPage │ │ ├ userList │ │ │ List │ │ ├ sendSGPage │ │ ├ SendSGPage ├ listitom. vue │ │ ├ listWrapper. Vue │ │ ├ listitom. vue │ │ ├ listitom. vue │ │ ├ listWrapperset│ ├ │ ├ sendmsgpage. └ │ ├ Tool, └ exercisestype// │ ├ App. Vue │ ├ Background │ ├ main. Ts │ ├ registerServiceWorker │ ├ shims-node │ ├ exercises, ├ exercises package, ├.json │ ├ exercises package, │ ├ exercises package, │ ├ exercises package, │ ├ exercises package, │ ├ exercises Tsconfig. Json └ vue. Config. JsCopy the code
Introduction of electron
Electron is a GitHub cross-platform desktop application development tool that uses JavaScript, HTML, and CSS to build cross-platform desktop applications, itself based on C++
Website: www.electronjs.org/
Documents: www.electronjs.org/docs
The main process
Inject DLLS into the wechat process
import ffi from "ffi-napi";
import { DllInject } from "@/interface/mainInterface";
import { join } from "path";
export default class Inject {
private Handel: DllInject;
public constructor(dllPath: string) {
this.Handel = ffi.Library(dllPath, {
Inject: ['int'["string"."string"]]
})
}
public Inject(dllPath: string, exePath: string): number {
returnthis.Handel.Inject(dllPath, exePath); } public StatusCode(code: number): string { const StatusCode: { [p: number]: string; } = {0:"Success",
1: "Wechat process is not found. Please confirm whether wechat is open.",
2: "Failed to open process",
3: Failed to allocate memory space,
4: "Write to memory failed",
5: "Failed to find LoadLibraryA",
6: "Failed to start remote thread"
};
return StatusCode[code]
}
}
const InDllPath = join(global.__static, "/dll/demoInject.dll");
const BeInDllPath = join(global.__static, "/ DLL/version2.9.0.123-4.5.7.69. DLL");
const WeChatInject = new Inject(this.InDllPath);
WeChatInject.Inject(BeInDllPath, "WeChat.exe");
Copy the code
Rendering process
Later, I sorted out the API and provided the address, but the content was too much. I found it was not good after writing, so I deleted it
Thank you
Thank you cixingguangming55555 for your wechat bot
warning
The original intention of this project is to solve the need to passively reply to messages/send documents in daily life. It is strictly prohibited to be used for advertising/promotion
Wechat Assistant does not belong to the assistant tool recognized by Tencent, so the use of marketing, advertising and other behaviors will lead to the closure of the account, which is also the reason why I said it is strictly prohibited to use for advertising/promotion, I hope you can use it within the scope allowed by Tencent
Such as secondary development for girlfriend to query dry and wet garbage, daily weather report and so on, at the same time, welcome it friends to add friends to study the front-end c++ knowledge (I front-end one, can some simple c++)