iddoeldor / frida-snippets

Hand-crafted Frida examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IOS Frida - Observe Class Arguments

rosman83 opened this issue · comments

I am using the observe class method for Frida and am successfully able to hook into the function. However the logging is a bit cryptic.

For this example, assumine the class is MainClass and the method in it that I'm observing is ChildMethod

My end goal is to call ChildMethod manually but to do that I need to replicate and pass in the arguments through Frida, which I am trying to get by observing them in the following. I'm used to variables and passing them into functions - whereas this code is slightly cryptic. How do I achieve this end goal - and which of these is the actual args in the function?

0x105082d74 winnerscircle20!0x3ded74 (0x1003ded74)
0x105082ee8 winnerscircle20!0x3deee8 (0x1003deee8)
0x1051f5638 winnerscircle20!0x551638 (0x100551638)
0x1057c62a0 FBLPromises!0x62a0 (0x62a0)
0x183a0d298 libdispatch.dylib!_dispatch_call_block_and_release
0x183a0e280 libdispatch.dylib!_dispatch_client_callout
0x1839bd0ac libdispatch.dylib!_dispatch_main_queue_callback_4CF$VARIANT$mp
0x183d555e0 CoreFoundation!__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
0x183d4fa88 CoreFoundation!__CFRunLoopRun
0x183d4eba0 CoreFoundation!CFRunLoopRunSpecific
0x19aab7598 GraphicsServices!GSEventRunModal
0x1866402f4 UIKitCore!-[UIApplication _run]
0x186645874 UIKitCore!UIApplicationMain
0x104ca80ec winnerscircle20!0x40ec (0x1000040ec)
0x183a2d568 libdyld.dylib!start

I found the method takes in two pointers - and those two pointers are "0x28155a230" , "0x102ae7012" if this helps. Did this through using .argumentTypes directly on frida terminal and the return type is also a pointer

Currently I want to call the class like so var instance = ObjC.classes.MainClass.alloc().init(); and then use its method using something like this and passing the pointers as args:
instance.ChildMethod(pointer1, pointer2);