@@ -3,32 +3,19 @@ Fork hook needed in case process spawn child process
3
3
which causes frida to terminate. Return -1 only when you feel need of it.
4
4
*/
5
5
6
+ /*
6
7
const fork_ptr = Module.getExportByName(null, "fork");
7
8
const fork = new NativeFunction(fork_ptr, 'int', []);
8
9
Interceptor.replace(fork_ptr, new NativeCallback(function() {
9
10
console.warn("Fork Found and Replaced");
10
- // return fork()
11
- return - 1 ;
11
+ return fork()
12
+ // return -1;
12
13
}, "int", []));
14
+ */
13
15
14
- function ProcessName ( ) {
15
- let openPtr = Module . getExportByName ( 'libc.so' , 'open' ) ;
16
- let open = new NativeFunction ( openPtr , 'int' , [ 'pointer' , 'int' ] ) ;
17
- let readPtr = Module . getExportByName ( 'libc.so' , 'read' ) ;
18
- let read = new NativeFunction ( readPtr , 'int' , [ 'int' , 'pointer' , 'int' ] ) ;
19
- let closePtr = Module . getExportByName ( 'libc.so' , 'close' ) ;
20
- let close = new NativeFunction ( closePtr , 'int' , [ 'int' ] ) ;
21
- let path = Memory . allocUtf8String ( '/proc/self/cmdline' ) ;
22
- let fd = open ( path , 0 ) ;
23
- if ( fd != - 1 ) {
24
- let buffer = Memory . alloc ( 0x1000 ) ;
25
- let result = read ( fd , buffer , 0x1000 ) ;
26
- close ( fd ) ;
27
- result = ptr ( buffer ) . readCString ( ) ;
28
- return result ;
29
- }
30
- return - 1 ;
31
- }
16
+ // Enter your package name here as getting process name on higher android version is tricky
17
+
18
+ let Pro = "com.app.name"
32
19
33
20
function ProcessDex ( Buf , C , Path ) {
34
21
let ApkUnpacker = new Uint8Array ( Buf ) ;
@@ -62,7 +49,6 @@ function WriteDex(Count,Buffer,Path,Flag) {
62
49
}
63
50
64
51
function Dump_Dex ( ) {
65
- let Pro = ProcessName ( ) ;
66
52
let libart = Process . findModuleByName ( "libart.so" ) ;
67
53
let addr_DefineClass = null ;
68
54
let symbols = libart . enumerateSymbols ( ) ;
0 commit comments