从可执行文件中获取 __TEXT 和 __DATA Dyld 地址映射
为了找到我的 mach-o 可执行文件的 __TEXT 和 __DATA 的 dyld 地址映射,我设置了环境变量 DYLD_PRINT_SEGMENTS=1。这会记录在内存中映射可执行文件的控制台上。
但是,我需要从可执行文件内部找到 __TEXT 和 __DATA 的地址映射。有没有一些API可以优雅地获取这些信息?
To find the dyld address mapping of __TEXT and __DATA for my mach-o executable I set the environment variable DYLD_PRINT_SEGMENTS=1. This logs on the console where in memory the executable is mapped.
However, I need to find the address mapping of __TEXT and __DATA internally from within my executable. Is there some API for elegantly obtaining this information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过
getsectbyname()
函数
标头。You can obtain this information with the
getsectbyname()
function from the<mach-o/getsect.h>
header.