-
Notifications
You must be signed in to change notification settings - Fork 203
/
hook_classLoader.js
43 lines (38 loc) · 1.42 KB
/
hook_classLoader.js
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
function hook() {
Java.perform(function () {
// var Six = Java.use('com.dta.test.frida.activity.SixthActivity')
var target = Java.registerClass({
name: 'com.dta.test.frida.activity.RegisterClass',
// implements: [Six],
// superClass: Java.use('java.lang.Object'),
methods: {
$init: function () {
console.log('Constructor called');
},
next: {
returnType: 'java.lang.Boolean',
// returnType: 'java.lang.Boolean',
// argumentTypes: [],
argumentTypes: [],
implementation: function () {
console.log('call next')
return Java.use('java.lang.Boolean').$new('true');
// return Java.use('java.lang.Object').$new('true');
// return true;
},
},
}
})
var Six = Java.use('com.dta.test.frida.activity.SixthActivity')
var pathLoader = Six.class.getClassLoader()
var dexLoader = target.class.getClassLoader()
console.log('activtity loader->',pathLoader)
var parent = pathLoader.parent.value
pathLoader.parent.value = dexLoader
dexLoader.parent.value = parent
})
}
function main() {
hook()
}
setImmediate(main)