仅供学习使用,64位微信的好友列表hook方法,非二叉树。
step1:
cheat engine搜索微信好友列表中的微信号,点击不同好友,再次扫描当前好友微信号,直到结果数量减少。
step2:
将扫描出来的地址复制进x64dbg中,右键加入硬件访问断点,在好友列表切换后断下。在黄色框中下拉可以看到好友信息完整压入堆栈,点击红色框,在蓝色的汇编代码处写入断点,这个就是要hook的位置,好友信息在寄存器rbp中。
添加图片注释,不超过 140 字(可选)
附frida代码,后续代码会上传github,另外我们目前在寻找合适的创业项目,有想法的朋友可以沟通交流,后面先拉个共创群,蔚Jysauto1314辛。
let hook_info = {
module_name: "WeChatWin.dll",
hook_offset: "0x2199925", //根据微信版本, 更改位置
register: "rbp",
wxid_offset: "0x340",
nickname_offset: "0x458",
avatar_offset: "0x4b8"
}
//hook function
function hook_friend_list(){
let hMod = Process.getModuleByName(hook_info.module_name).base;
let Frid = hMod.add(hook_info.hook_offset);
Interceptor.attach(Frid, {
onEnter:function(args){
try{
let base_pointer = this.context[hook_info.register];
let result = {
wxid: base_pointer.add(hook_info.wxid_offset).readPointer().readUtf16String(),
nickname: base_pointer.add(hook_info.nickname_offset).readPointer().readUtf16String(),
avatar: base_pointer.add(hook_info.avatar_offset).readPointer().readUtf16String(),
};
console.log(result.wxid,result.nickname);
send({ api: "recv_friend_list", data: result })
} catch(error){
console.error(error.stack)
}
}})
}
function entry(){
try{
hook_friend_list();
}catch(error){
console.error(error.stack);
}
}
entry()