PC微信开启日志

PC微信开启日志

反编译WeChatWin.dll,发现有很多打印日志的地方。网上搜索了一下,确实可以通过patch二进制实现修改调试开关、日志等级、打印函数输出日志内容,但都需要有Visual Studio开发环境。我本地没安装这个庞大的IDE,于是尝试使用Frida实现日志打印功能。

image-20231030145032039

1
2
3
4
5
6
7
8
var baseAddr = Module.findBaseAddress('WeChatWin.dll');
var debug_log_addr = baseAddr.add(0xF57A20)

Interceptor.attach(debug_log_addr, {
onLeave: function (retval) {
console.log(retval.readCString());
}
});

image-20231030145135856

参考资料

https://github.com/ttttupup/wxhelper/blob/632d4222fa5a06e94e80f51e852423f7494d4123/src/manager.cc#L802

https://github.com/ljc545w/ComWeChatRobot

PC微信逆向:实现自动保存加密的聊天图片

PC微信逆向分析の强制输出微信调式信息

微信PC端技术研究(2)-保存聊天语音