Я пытаюсь подключить функцию postNotificationName с Frida. Я вызываю две функции:
- postNotificationName: (NSNotificationName) объект: (id) userInfo: (NSDictionary)
- postNotification: (NSNotification) объект
sO, Когда я трассирую функции с помощью frida-trace, я вижу, что в последнем случае есть вызовы postNotificationName. Я хочу знать, вызывает ли postNotification postNotification и почему?
Также,
var newObject = ObjC.classes.NSNotification;
var myObj = newObject.alloc().initWithName_object_userInfo_('notificationName','nil','userInfo');
var hook = ObjC.classes.NSNotificationCenter["- postNotification:"];
Interceptor.attach(hook.implementation, {
onEnter: function(args) {
console.log("\n[*] Detected call to: " + NsNotificationCenter + " -> " + postNotification);
console.log("\t[-] Argument Value: " + args[2]);
args[2] = ptr(myObj)
console.log("\t[-] New Argument Value: " + args[2])
}
работает, когда вводится с помощью Frida для перехвата функции postNotification. Однако,
var nsName = ObjC.classes.NSString;
var notificationName= nsName.stringWithString_("Blah");
var hook = ObjC.classes.NSNotificationCenter["- postNotificationName:"];
Interceptor.attach(hook.implementation, {
onEnter: function(args) {
console.log("\n[*] Detected call to: " + NSNotificationCenter + " -> " + postNotificationName);
console.log("\t[-] Argument Value: " + args[2]);
args[2] = ptr(notifname)
console.log("\t[-] New Argument Value for postNotificaitonName: " + args[2])
}
});
не работает для postNotificationName:Object:userInfo. Я предполагаю, что проблема в строке var hook = ObjC.classes.NSNotificationCenter[- postNotificationName:];. Кто-нибудь знает, что с ним не так и как заставить его работать, пожалуйста?
Спасибо