/*
描述:Hook 类成员变量
作者: 飘云
实际:2014-08-19
*/

#import <substrate.h>


// 这里换成实际需要hook的类,自由发挥
@interface TheTestClass : NSObject{
    NSString *_testVariable;
}
- (void)doSomething;
@end


NSString *_testVariableHooked;

%hook TheTestClass

- (void)doSomething
{
    _testVariableHooked = MSHookIvar<NSString *>(self, "_testVariable");
    
    _testVariableHooked = @"http://bbs.chinapyg.com";
}

%end

// 参考资料:http://stackoverflow.com/questions/11918934/theos-trying-to-take-over-uiview-subjectline-from-ckcontententryview-in-chatki

你可能感兴趣的文章

评论区

发表评论

必填

选填

选填

必填

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。