forked from MD-Levitan/fridas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhook_exports.js
37 lines (28 loc) · 1.19 KB
/
hook_exports.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
var lib_name = "libname.so";
var module = Process.findModuleByName(lib_name);
var exports = Module.enumerateExports(lib_name);
for (let index = 0; index < exports.length; index++) {
const element = exports[index];
console.log(JSON.stringify(element));
if (element.type == "function") {
try {
Interceptor.attach(new NativePointer(element.address),
{
onEnter: function (args) {
console.log("Inside " + element.name);
console.log('Context information:');
console.log('Context : ' + JSON.stringify(this.context));
console.log('Return : ' + this.returnAddress);
// console.log("----------------");
// console.log(args[0].readCString());
// console.log("----------------");
// console.log("----------------");
// console.log(args[1].readCString());
// console.log("----------------");
console.log();
},
});
} catch (err) {
}
}
}