////////
Search
🍎

GET Return Value in Method

if(ObjC.available){ // Class & method info var classname = "JailbreakDetection"; var method_name = "isJailbroken"; var hook = ObjC.classes[classname][method_name]; Interceptor.attach(hook.implementation,{ onLeave:function(retval){ console.log("\u001b[33m" + "\n[*] Started: Hook " + "\x1b[32m" + '[' + method_name + ']' + "\u001b[33m" + ' method' + " of a Class "+ "\x1b[32m" + '[' + classname + ']' + "\x1b[0m"); // 어떤 타입의 값을 반환해야 하는지 확인 console.log("[*] Type of return value: " + "\x1b[32m" + hook.returnType + "\x1b[0m"); // 리턴 값을 확인한다. console.log("[*] Return value: " + "\x1b[32m" + retval + "\x1b[0m"); // 반환 값을 변조한다. var new_retval = ptr("0x0"); retval.replace(new_retval); // 변조된 값을 확인한다. console.log("[*] NEW Return value: " + "\x1b[32m" + retval + "\x1b[0m"); console.log("\u001b[33m" + "[*] Hook Completed" + "\x1b[0m"); } }) }
JavaScript
복사