macOS中QQ防消息撤回

本文介绍了一种阻止MacOS下QQ消息撤回的方法,通过Hook特定函数实现。提供了一个dylib文件的示例代码,可用于拦截消息撤回功能。


macOS下的QQ还是增加了消息撤回功能,稍微研究了一下,只需要Hook一个函数即可。

可以考虑写一个dylib然后附上去,代码如下。然后至于说是用DYLD_INSERT_LIBRARIES这个环境变量,还是说直接改load_commands就看个人喜好了,这里不展开写。

#import <Foundation/Foundation.h>
#import <objc/runtime.h>

void handleRecallNotifyIsOnline(id, SEL, void *, BOOL) {}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"

static void __attribute__((constructor)) initialize(void) {
    method_setImplementation(class_getInstanceMethod(NSClassFromString(@"QQMessageRevokeEngine"), @selector(handleRecallNotify:isOnline:)), (IMP)&handleRecallNotifyIsOnline);
}

#pragma clang diagnostic pop
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值