Skip to content

Instantly share code, notes, and snippets.

@MantisSTS
Last active August 7, 2022 16:37
Show Gist options
  • Select an option

  • Save MantisSTS/6a6d6a72cab8f04500cdddd016d13699 to your computer and use it in GitHub Desktop.

Select an option

Save MantisSTS/6a6d6a72cab8f04500cdddd016d13699 to your computer and use it in GitHub Desktop.

Revisions

  1. MantisSTS revised this gist Sep 8, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion frida-template.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    f (ObjC.available) {
    if (ObjC.available) {

    try {

  2. MantisSTS created this gist Sep 8, 2021.
    28 changes: 28 additions & 0 deletions frida-template.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    f (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!");
    }