如何hook readonly 的 property

MSHookMessageEx 一样啊。。都是ObjectiveC的方法。

http://www.cydiasubstrate.com/api/c/MSHookMessageEx/

这里的例子就是个getter吧

NSString *(*oldDescription)(id self, SEL _cmd);

// implicit self and _cmd are explicit with IMP ABI
NSString *newDescription(id self, SEL _cmd) {
    NSString *description = (*oldDescription)(self, _cmd);
    description = [description stringByAppendingString:@"!"];
    return description;
}

MSHookMessageEx(
    [NSObject class], @selector(description),
    &newDescription, &oldDescription
);