Frida: How to hook two function with same name and args but different retval?

Created on 29 May 2018  路  3Comments  路  Source: frida/frida

when decompile one apk file, I found there are two java functions with same name and args, but they have different retval, for example:

`
public void temp(String a){
Log.d("void","void");
}

public int temp(String a){
Log.d("int","int");
return 0;
}
`

when hook the "temp" function, frida tell me that choose from ".overload('java.lang.String')" and ".overload('java.lang.String')", to implement overload, but these two function looks like no difference, so, how to hook when meeting this situation?

This occurred to me many times when using frida to hook android.

Most helpful comment

Iterate the method's overloads property, and hook each of them.

All 3 comments

Maybe you can try to execute it to determine the address of each function, then remember it somewhere.

Iterate the method's overloads property, and hook each of them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cgbcsh picture cgbcsh  路  4Comments

asad0x01 picture asad0x01  路  4Comments

PerilousTheGreat picture PerilousTheGreat  路  3Comments

AkhileshChaikam picture AkhileshChaikam  路  3Comments

ehsanpc9999 picture ehsanpc9999  路  4Comments