I've instrumented an application using Frida.RE. I can hook the constructor of a C++ class of my interest, let's call this MyClass::MyClass().
I want to call the non-static MyClass::SomeMethod() on an object instance. To do this I need to have the address of the object instance so I can pass it to the method as the implicit 'this' argument.
Is there a way to monitor the addresses of the created instances of MyClass?
Or is there some other way to call the SomeMethod() method of an already instantiated object?
I tried to simply record the 0th argument passed to the constructor with Frida (args), but I couldn't access the
this pointer, only the first "real" argument (passed explicitly by the caller).
I can think of two things:
- Frida doesn't care about the implicit
- things are messed up because of the thiscall scheme used in Windows programs (I'm experimenting on 32-bit Windows). I couldn't figure out a way to get the value of ECX with Frida though...