Skip to content

Instantly share code, notes, and snippets.

@MantisSTS
Last active August 7, 2022 16:37
Show Gist options
  • Save MantisSTS/6a6d6a72cab8f04500cdddd016d13699 to your computer and use it in GitHub Desktop.
Save MantisSTS/6a6d6a72cab8f04500cdddd016d13699 to your computer and use it in GitHub Desktop.
if (ObjC.available) {
try {
// Classname to be hooked
var className = "";
// Full function name to be hooked including - or +
var funcName = "";
var hook = eval('ObjC.classes.' + className + '["' + funcName + '"]');
Interceptor.attach(hook.implementation, {
onEnter: function(args) {
console.log("[+] Class Name: " + className);
console.log("[+] Method Name: " + funcName);
},
onLeave: function(retVal) {
console.log('Return Value: ' + ObjC.Object(retVal));
}
});
} catch(err) {
console.log("[!] Exception: " + err.message);
}
} else {
console.log("ObjC Runtime is not available!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment