本测试均在IOS8.3上
一、coreTelephony.framework
1:CTTelephonyCenterAddObserver:来电监听
函数原型是:void CTTelephonyCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
这是一个C函数 hook如下
![](https://img.haomeiwen.com/i7584848/99370ff0b294bc18.png)
![](https://img.haomeiwen.com/i7584848/4efbbbc284817e25.png)
hook成功 log如下
![](https://img.haomeiwen.com/i7584848/f57950557dcdb946.png)
2:CTCallCopyAddress :来电号码获取
NSString *CTCallCopyAddress(CFAllocatorRef, CTCall *call); 返回值为来电号码
这是一个C函数 hook如下
![](https://img.haomeiwen.com/i7584848/978f7d2603d537a1.png)
hook成功 log如下
![](https://img.haomeiwen.com/i7584848/a97a8138aedafafd.png)
3:CTCallDisconnect:来电挂断监听
函数原型:void CTCallDisconnect(CTCall *call);
这是一个C函数 hook如下
![](https://img.haomeiwen.com/i7584848/48ce1773f1b1186f.png)
hook成功 log如下
![](https://img.haomeiwen.com/i7584848/c57f38a75534d0ed.png)
二、MobileCoreServices.framework
allApplictaions 这是一个类函数 所属的类是LSApplicationWorkspace
函数原型是: - (id)allApplications;
hook过程如下
![](https://img.haomeiwen.com/i7584848/b2e1e1abd44d6f5b.png)
hook成功 log如下
![](https://img.haomeiwen.com/i7584848/ca496f49088e4bb4.png)
三、MobileInstallation.framework
MobileInstallationInstall
int MobileInstallationInstall(CFStringRef path, CFDictionaryRef parameters, MobileInstallationCallback callback, void *unknown);
添加正确的framework路径后 仍然报错
![](https://img.haomeiwen.com/i7584848/5442d43dc32ac767.png)
原来因为
IOS8之后MobileInstallationUninstallForLaunchServices、MobileInstallationInstallForLaunchServices 、IOS8中没有MobileInstallationLookup
IOS8之前 MobileInstallationUninstall、MobileInstallationInstall、MobileInstallationLookup
其中IOS8之后 可用MobileCoreServices.framework的allApplications 替代
IOS8之后的头文件为
![](https://img.haomeiwen.com/i7584848/94e209df84b4fe53.png)
1:MobileInstallationUninstallForLaunchServices
函数原型为:MobileInstallationUninstallForLaunchServices(CFStringRef bundleIdentifier, CFDictionaryRef parameters, MobileInstallationCallback callback, void *unknown)
作用为 程序卸载的监控 是个C函数
![](https://img.haomeiwen.com/i7584848/a54c4df244dcf8ea.png)
hook成功 log为
![](https://img.haomeiwen.com/i7584848/1e31b12defb2d08e.png)
2:MobileInstallationInstallForLaunchServices
函数原型为int MobileInstallationInstallForLaunchServices(CFStringRef bundlePath, CFDictionaryRef parameters, void *unknown1, void *unknown2)
作用为 程序安装的监控 是个C函数
![](https://img.haomeiwen.com/i7584848/74c1d440bb3ab54f.png)
此处hook 是越狱后系统不稳定的原因 log为
![](https://img.haomeiwen.com/i7584848/6483d72945b1db29.png)
![](https://img.haomeiwen.com/i7584848/012cd54a5a34d2bf.png)
四、SpringBoardServices.framework
SBSSpringBoardServerPort
int SBSSpringBoardServerPort();
头文件里的形式是:mach_port_t SBSSpringBoardServerPort(); 功能为:获取与springboard通信的端口 与下列函数配合使用
SBSCopyApplicationDisplayIdentifiers 函数原型:NSArray* SBSCopyApplicationDisplayIdentifiers(mach_port_t* port, BOOL runningApps,BOOL debuggablet); 功能为:获取当前所有正在活动的app 的bunde id
SBSCopyFrontmostApplicationDisplayIdentifier 函数原型为NSString * SBSCopyFrontmostApplicationDisplayIdentifier(); 作用为:获取当前前台的app 的bundle ID
SBSLaunchApplicationWithIdentifier 函数原型为:intSBSLaunchApplicationWithIdentifier(CFStringRef identifier, Boolean suspended) 作用为:静默启动一个指定bundle id的app
hook无效 原因在于 需要有一个app来实际的调用这些函数
app调用为
![](https://img.haomeiwen.com/i7584848/fac5635601b6e398.png)
![](https://img.haomeiwen.com/i7584848/71f0f6d6b33fffc2.png)
![](https://img.haomeiwen.com/i7584848/896c45a6a6d06bd1.png)
hook为
![](https://img.haomeiwen.com/i7584848/b169ad3b15605694.png)
![](https://img.haomeiwen.com/i7584848/7e8932dc3d692135.png)
hook结果为
![](https://img.haomeiwen.com/i7584848/ac878cc5097dfe95.png)
hook有效 但hook的数据无效 原因在于 在基于IOS9的编译器,IOS8的环境下 这种app的调用可能哪里不正确 与hook无关
五、Security.framework
不知道为何 这个库 class dump不出来
SSLRead,SSLWrite 路径为
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h
两函数的原型为
OSStatus SSLRead(SSLContextRef context,void* data,size_t dataLength,size_t* processed);
OSStatus SSLWrite(SSLContextRef context,const void * __nullable data,size_t dataLength,size_t* processed);
均为C函数 功能为https协议的数据写入和读出
hook过程为
![](https://img.haomeiwen.com/i7584848/b30c354e136d550c.png)
![](https://img.haomeiwen.com/i7584848/22c8ae31950722bb.png)
由于机型上暂未有https的数据写入写出 所以log上暂时未能看到数据 这个需要后续做相关测试
SecItemCopyMatching、SecItemAdd、SecItemUpdate、SecItemDelete、SecIdentityCopyCertificate、SecIdentityCopyPrivateKey等均需要做样本做测试
![](https://img.haomeiwen.com/i7584848/ea5730bed77dc468.png)
![](https://img.haomeiwen.com/i7584848/a56fe88fb677e82b.png)
六、MobileKeyBag.framework
这个class dump里也没有 但是 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/有 不过是tdb的格式
1:MKBUnlockDevice 函数原型是 int MKBUnlockDevice(NSData* passcode, int flags);
是个C 函数 作用是解锁的过程
hook如下
![](https://img.haomeiwen.com/i7584848/176856e7c0e10db3.png)
hook成功 结果如下 解锁密码得到是1234
![](https://img.haomeiwen.com/i7584848/b84dee867ac4b38c.png)
2:MKBGetDeviceLockState 函数原型是int MKBGetDeviceLockState();
hook失败 导致SpringBoard进入安全模式 原因目前不明
3:MKBDeviceUnlockedSinceBoot 函数原型是:int MKBDeviceUnlockedSinceBoot();
C函数 返回自从启动以来 解锁的次数
hook如下
![](https://img.haomeiwen.com/i7584848/117307d2a9a24424.png)
hook成功 如下
![](https://img.haomeiwen.com/i7584848/30e5cbd6bd4a6db1.png)
网友评论