映射到内存的文件名库OSX [英] filename of memory mapped libraries osx

查看:290
本文介绍了映射到内存的文件名库OSX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获得当前应用程序的所有内存映射库的文件名。目前我通过vm_region经历的所有映射库。不幸的是它不提供有关当前区域的文件名的信息。有没有办法让在C此信息,而不对的VMMap做的popen?

I need to get the filenames of all memory mapped libraries of the current application. Currently I'm going through all mapped libraries via vm_region. Sadly it doesn't provide information about the filename of the current region. Is there a way to get this information in c without doing popen on vmmap ?

推荐答案


  • 对于经常 MMAP -ed文件,你可以使用 proc_regionfilename()

    • 请注意,您必须提供一个MAX_PATH大小的缓冲区来了。

    • 在苹果的libc中实现 - libproc.c ,底层的系统调用是 proc_info

    • For regular mmap-ed files you can use proc_regionfilename()
查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆