Frida Scripts
Java.use
- A JavaScript wrapper for Java classes
Java.use
- A JavaScript wrapper for Java classesIt also allows us to instantiate instances of that class.
Example :-
Here using the String class of Java we assigned a string (instance of that class) using constructor
$new
and then normally use any Java functions to that variable (si).Normally we will not use $dispose but if we use make sure to not call that var that has been disposed otherwise it will create a very long error.
Java.enumerateLoadedClasses(callbacks)
and Java.enumerateLoadedClassesSync()
- To list all available Java classes
Java.enumerateLoadedClasses(callbacks)
and Java.enumerateLoadedClassesSync()
- To list all available Java classesJava.enumerateLoadedClasses(callbacks)
: returns callback for each loaded classesJava.enumerateLoadedClassesSync()
: returns a list of all loaded classes (in an array)
Changing implementation of a class
Can be used to change the original implementation and return what we want.
useful when working with native libraries.
simple example to change the implementation of charAt.
Java.perform(() ⇒ {//my custom code here})
Java.perform(() ⇒ {//my custom code here})
while writing a frida script make sure to wrap it in
Java.perform(() ⇒ {//my custom code here})
to make sure it runs inside java vm where all the classes have already been loaded and easily accessible.Example code to run a function/method from frida (frida target hextree example)
Intercepting Arguments and Return values
Interception Arguments and return values is not that much different from the actual logging thing.
Example Snippet:-
Last updated
Was this helpful?