遍历自身加载的dylib--获取载入地址和ASLR地址等

2020-09-17  本文已影响0人  Acton393
void test()
{
    printf("www.dllhook.com\nDyld image count is: %d.\n", _dyld_image_count());
    for (int i = 0; i < _dyld_image_count(); i++) {
        char *image_name = (char *)_dyld_get_image_name(i);
        const struct mach_header *mh = _dyld_get_image_header(i);
        intptr_t vmaddr_slide = _dyld_get_image_vmaddr_slide(i);
        
        printf("Image name %s at address 0x%llx and ASLR slide 0x%lx.\n",
               image_name, (mach_vm_address_t)mh, vmaddr_slide);
    }
}

转自: https://www.dllhook.com/post/58.html

上一篇下一篇

猜你喜欢

热点阅读