getsectbyname
- 所属头文件:
getsect.h
- 定义
- 32-bit Mach-O
- 64-bit Mach-O
Hook代码
#import "mach-o/getsect.h"
#import <dlfcn.h>
#import <mach-o/dyld.h>
#import "objc/runtime.h"
const struct section_64* getsectbyname(const char *segname, const char *sectname);
%hookf(const struct section_64*, getsectbyname, const char *segname, const char *sectname){
const struct section_64* retSection = %orig;
iosLogInfo("segname=%{public}s,sectname=%{public}s -> retSection=%p", segname, sectname, retSection);
return retSection;
}