开发者

Get __TEXT and __DATA Dyld address mapping from within an executable

开发者 https://www.devze.com 2023-03-25 04:21 出处:网络
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 execu

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

精彩评论

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

关注公众号