映射到内存的文件名库OSX [英] filename of memory mapped libraries osx
本文介绍了映射到内存的文件名库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()
- For regular
mmap
-ed files you can useproc_regionfilename()
- Note that you must provide a MAX_PATH-sized buffer to it.
- implemented in apple's libc - libproc.c, the underlying syscall is proc_info.
- HTTPS://$c$c.google。 COM / p / psutil /问题/细节?ID = 260 推测可以解析dyld_shared_cache _ *。映射文件,以获得此信息。
- http://stackoverflow.com/a/15714052/1026 的指向另一实现中, http://newosxbook.com/src.jl?tree=listings&file= 12-1-vmmap.c
- https://code.google.com/p/psutil/issues/detail?id=260 speculates you can parse dyld_shared_cache_*.map file to get this info.
- http://stackoverflow.com/a/15714052/1026 points to another implementation, http://newosxbook.com/src.jl?tree=listings&file=12-1-vmmap.c
这篇关于映射到内存的文件名库OSX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- For regular
查看全文