-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hooking static methods #1
Comments
Ah nevermind, I wrote a simple test application that just had the following:
I changed my hooking code to latch onto this method call and it seems to be working. I think the wrapper class Logger I found in the application I'm playing with is just never used by the application. The hook method won't get called if the real method never gets called, doh! Outstanding question though, when is it necessary to set the |
On 01/27/2014 09:28 AM, TheBigS wrote:
is is used in dalvik_prepare(). if you want to call the original method
Collin R. Mulliner collin@mulliner.org KeyID 0x5D89EEED |
I'm trying to hook a static method that wraps Android.Log in this application I'm playing with. I couldn't find any examples that show how to hook a static method. I took a guess at the callback function signature so I think that is where my issue might be, but I'm not sure. Little help?
I do the hook setup and the method signature is:
So I specify 2 as the number of parameters (since there is no
this
object for static invocations).I've also tried setting
infoHook.sm = 1
after thedalvik_hook_setup
call but that didn't help either.I then make my callback function look like this:
The text was updated successfully, but these errors were encountered: