#import <mach-o/dyld.h>  // 引用头文件

%hook QMDJExpirationServices

// Hooking a class method
+(int)checkExpirationRemainDays{
    NSLog(@"*************************");
    return 65535;
}

// 程序
__attribute__((constructor)) void dylibMain()
{
        NSLog(@"11111111111111111111111111");
        int imageSelf = (int)dlopen(0, 2);
        NSLog(@"imageSelf == %x", imageSelf);
        int module_base = (int)_dyld_get_image_header(0);
        // module_base -= 0x4000;  // 这里-4000刚好等于 offset,用GDB调试可以得知~~~
        NSLog(@"module_base == %x", module_base);
        NSLog(@"2222222222222222222222222");
}
%end

你可能感兴趣的文章

评论区

发表评论

必填

选填

选填

必填

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