Quantcast
Channel: 睿论坛 - 最新话题
Viewing all articles
Browse latest Browse all 5731

基于地址的C函数hook 可以在非越狱环境下实现吗?

$
0
0

@lorndragon wrote:

以下代码取自 http://www.alonemonkey.com/2018/02/03/unity-reverse-ios/
请问一下各位大大, 在非越狱的环境下, 这种基于地址的C函数hook, 可以实现吗? 如何实现?

#import <substrate.h>
#import <dlfcn.h>
#import <mach-o/dyld.h>

int (*old_clover_point_stock)(void);

int new_clover_point_stock(void)
{
    return 9999;
}

%ctor
{
    @autoreleasepool
    {
        unsigned long clover_point_stock = _dyld_get_image_vmaddr_slide(0) + 0x100093A2C;
        MSHookFunction((void *)clover_point_stock, (void *)&new_clover_point_stock, (void **)&old_clover_point_stock);
    }
}

Posts: 7

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 5731

Trending Articles