How to find text segment range in iOS
问题 How can I find the text segment (AKA code segment) range in iOS? Meaning, what is the start address and the end address of the text segment? I found this interesting post but it works for me on Android but not on iOS. 回答1: After some digging and expert help (thanks Moshe Kravchik) I got to the desired solution - getting the text segment range by parsing the mach header and retrieving the load commands, segments and sections. #include <mach-o/dyld.h> #include <stdio.h> #include <stdlib.h>