2 Star 2 Fork 39

MrSean/WeChatOpenDevTools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
WeChatAppEx.exe.js 1.95 KB
一键复制 编辑 原始数据 按行查看 历史
//HOOK微信小程序
let version = (process.argv[2] + "").toLowerCase();
let bit = (process.argv[3] + "").toLowerCase();
var frida = require("frida");
const cmdline = require('cmdline-windows');
const fs = require('fs');
const path = require('path');
let addressSource = "";
let addressSourceHeadFilePath = path.join(__dirname, `/Core/AddressSource.head`);
let addressSourceEndFilePath = path.join(__dirname, `/Core/AddressSource.end`);
let addressFilePath = path.join(__dirname, `/Core/WeChatAppEx.exe/address_${version}_${bit}.json`);
let hookFilePath = path.join(__dirname, `/Core/WeChatAppEx.exe/hook.js`);
function onMessage(message, data) {
if (message.type === 'send') {
console.log(message.payload);
} else if (message.type === 'error') {
console.error(message.stack);
}
}
try {
fs.accessSync(addressFilePath);
addressSource += fs.readFileSync(addressSourceHeadFilePath);
addressSource += fs.readFileSync(addressFilePath);
addressSource += fs.readFileSync(addressSourceEndFilePath);
addressSource += fs.readFileSync(hookFilePath);
} catch (error) {
console.log(`暂不支持 ${version}_${bit} 的版本!`)
return;
}
console.log("HOOK文件组装成功!")
;;(async ()=>{
var device = await frida.getLocalDevice();
var processes = await device.enumerateProcesses();
var pid = -1;
processes.forEach(async (p_)=>{
if(p_.name == "WeChatAppEx.exe"){
let commandLine = cmdline.getCmdline(p_.pid);
if(commandLine.indexOf("--type=") == -1){
pid = p_.pid;
}
}
})
if(pid==-1){
console.log("WeChatAppEx.exe 主进程未找到!")
return;
}
session = await frida.attach(pid);
script = await session.createScript(addressSource);
script.message.connect(onMessage);
await script.load();
})().catch((error)=>{
console.error(error.stack);
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
NodeJS
1
https://gitee.com/MrSean666/WeChatOpenDevTools.git
git@gitee.com:MrSean666/WeChatOpenDevTools.git
MrSean666
WeChatOpenDevTools
WeChatOpenDevTools
main

搜索帮助