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);
    }
}
Image name /Users/piao/Library/Developer/Xcode/DerivedData/rc4-fwjlriqsnqejbrewprmjvnlvavvg/Build/Products/Debug/test at address 0x100000000 and ASLR slide 0x0.
Image name /Applications/Xcode.app/Contents/Developer/usr/lib/libBacktraceRecording.dylib at address 0x100004000 and ASLR slide 0x100004000.
Image name /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation at address 0x7fff8ed0f000 and ASLR slide 0xad76000.
Image name /usr/lib/libobjc.A.dylib at address 0x7fff8b33c000 and ASLR slide 0xad76000.
Image name /usr/lib/libc++.1.dylib at address 0x7fff95d7b000 and ASLR slide 0xad76000.


你可能感兴趣的文章

评论区

发表评论

必填

选填

选填

必填

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