美文网首页代码混淆
iOS 逆向 Tweak Hook 类成员变量

iOS 逆向 Tweak Hook 类成员变量

作者: 加盐白咖啡 | 来源:发表于2020-01-13 22:05 被阅读0次
#import <substrate.h> // necessary
#import <Foundation/Foundation.h>

@interface TheClassYouAreHooking : NSObject {
    NSString *_exampleVariable;
}
- (void)doSomething;
@end

NSString *_exampleVariableHooked;

%hook TheClassYouAreHooking
- (void)doSomething 
{
    // 'Hook' the variable
    exampleVariableHooked = MSHookIvar<NSString *>(self, "_exampleVariable");
 
    exampleVariableHooked = @"Hello World";

}
%end

MSHookIvar 还能hook BOOL floats 等 .

exampleVariableHooked = MSHookIvar<BOOL>(self, "_someBOOL");

来自:https://stackoverflow.com/questions/11918934/theos-trying-to-take-over-uiview-subjectline-from-ckcontententryview-in-chatki

相关文章

网友评论

    本文标题:iOS 逆向 Tweak Hook 类成员变量

    本文链接:https://www.haomeiwen.com/subject/uqonactx.html