开发者

Get __TEXT and __DATA Dyld address mapping from within an executable

To find the dyld address mapping of __TEXT and __DATA for my mach-o executable I set the environment va开发者_如何转开发riable 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?


You can obtain this information with the getsectbyname() function from the <mach-o/getsect.h> header.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜