1
fly2never 2013 年 5 月 20 日
什么叫勾起来?
|
2
offspring 2013 年 5 月 20 日
表示看不懂...
|
4
thedevil5032 2013 年 5 月 20 日
|
5
alexrezit 2013 年 5 月 20 日
楼主是这个意思么?
if ([oo respondsToSelector:@selector(xx:)] { ... } |
6
anerevol 2013 年 5 月 21 日
楼主是想问为什么会crash? 你要是用的mobileSubstrate hook的话,如果该类没有这个方法也不会crash的, 只是不会调用而已。 觉得crash跟hook本身没关系的,是其他地方的问题吧
|
9
alexrezit 2013 年 5 月 21 日
|
10
kshatriya 2013 年 5 月 21 日
method swizzle是方法混合器, 通过SEL查IMP, 然后把IMP搅在一起
|
11
kshatriya 2013 年 5 月 21 日
void Swizzle(Class c, SEL orig, SEL new)
{ Method origMethod = class_getInstanceMethod(c, orig); Method newMethod = class_getInstanceMethod(c, new); if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); else method_exchangeImplementations(origMethod, newMethod); } |
12
kshatriya 2013 年 5 月 21 日
强烈要求v2ex可以有代码格式化+高亮语法
|
13
loading 2013 年 5 月 21 日
挂钩都是作恶的开始吧…
|
14
kshatriya 2013 年 5 月 21 日
crash普通情况下都是发送了空消息导致, 发之前做检查吧
hook一般都是先把orig函数的指针存一份, 然后覆盖, 在返回的时候返回给之前保存的orig函数指针, 只处理入参!别做多余的操作! 好混乱, 语死早啊 |
15
wezzard 2013 年 5 月 21 日
method swizzling 不能上架麼?
|