简体   繁体   English

Theos:如何使用块参数挂钩方法? (CDUnknownBlockType)

[英]Theos: How to hook a method with a block argument? (CDUnknownBlockType)

%hook HTTPClient
- (CDUnknownBlockType)completionForSuccess:(CDUnknownBlockType)arg1 {
}
%end

I am wondering what to place in place of CDUnknownBlockType here (generated from class-dump). 我想知道在这里放置什么代替CDUnknownBlockType (从类转储生成)。 I do not know the arguments to the block so I cannot put the exact signature. 我不知道块的参数所以我不能把确切的签名。 Is it possible to instead use MSHookMessage with a generic pointer as the argument? 是否可以使用带有通用指针的MSHookMessage作为参数? A generic void * pointer did not work for me here as the message does not match. 一般的void *指针在我这里不起作用,因为消息不匹配。

Is there a way to get the block's signature? 有没有办法获得该块的签名?

You can replace the CDUnknownBlockType with id . 您可以使用id替换CDUnknownBlockType It's as simple as that. 就这么简单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM