1
我正在與攔截iPhone越獄的程序。我用dylib攔截系統調用事件,但是我怎麼回調我的主程序並處理這個事件?「dylib」如何回調主程序?
我正在與攔截iPhone越獄的程序。我用dylib攔截系統調用事件,但是我怎麼回調我的主程序並處理這個事件?「dylib」如何回調主程序?
您可以使用CFNotificationCenter從您的dylib發送達爾文通知到應用程序。這是限制性的,沒有用戶數據可以傳遞,但你至少可以通知應用程序的事件。更多關於https://developer.apple.com/library/IOs/#documentation/CoreFoundation/Reference/CFNotificationCenterRef/Reference/reference.html
Example of registering and posting:
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(),NULL, &NotificationReceivedCallback,(CFStringRef)MyNotificationString, NULL, CFNotificationSuspensionBehaviorCoalesce);
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter() , CFSTR(MyNotificationString), NULL, NULL, YES);