-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathraptor_frida_android_findClass2.js
More file actions
44 lines (37 loc) · 1.22 KB
/
Copy pathraptor_frida_android_findClass2.js
File metadata and controls
44 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* raptor_frida_android_*.js - Frida snippets for Android
* Copyright (c) 2017 Marco Ivaldi <raptor@0xdeadbeef.info>
*
* Frida.re JS script snippets for Android instrumentation.
* See https://www.frida.re/ and https://codeshare.frida.re/
* for further information on this powerful tool.
*
* "We want to help others achieve interop through reverse
* engineering" -- @oleavr
*
* Many thanks to Maurizio Agazzini <inode@wayreth.eu.org>
* and Federico Dotta <federico.dotta@mediaservice.net>.
*
* Example usage:
* # frida -U -f com.xxx.yyy -l raptor_frida_android.js --no-pause
*/
// find loaded classes that match a pattern (async)
function findClass(pattern)
{
console.warn("\n*** finding all classes that match pattern: " + pattern + "\n");
Java.enumerateLoadedClasses({
onMatch: function(aClass) {
if (aClass.match(pattern))
console.log(aClass);
},
onComplete: function() {}
});
}
// usage examples
setTimeout(function() { // avoid java.lang.ClassNotFoundException
Java.perform(function() {
//findClass(); // print all loaded classes
//findClass("Root"); // print all classes that match a string
//findClass(/root/i); // print all classes that match a regex (e.g., case insensitive)
});
}, 0);