hook一个lib中的函数问题

我现在想hook一个在libMobileGestalt.dylib中的函数,
使用MSHookFunction失败,请教大神要如何hook

你要Hook哪个函数?这个库是系统的基础库,不建议你Hook,你要做什么?应该有更合适的方法

针对这种系统的基本库要怎么样hook。我现在也只是尝试着去hook一下

我也想hook libMobileGestalt.dylib里面方法 狗神能不能说下

直接hook就好了吧?

enter link description here

情况有点特殊

CFPropertyListRef(*orig__MGCopyAnswer)(CFStringRef);
CFPropertyListRef new__MGCopyAnswer(CFStringRef property){
CFPropertyListRef value = nil;
if (!strcmp(CFStringGetCStringPtr(property, kCFStringEncodingMacRoman), “UniqueDeviceID”)) {
return @“did”;
}else{
value = orig__MGCopyAnswer(property);
}
return value;
}

https://github.com/Naville/WTFJH/blob/master/ThirdPartyTools/DeviceIDFake/Tweak.xm