$ frida-trace -i open -U -f com.mwr.example.sieve Instrumenting functions... open: Loaded handler at "/Users/fan/__handlers__/libc.so/open.js" Started tracing 1 function. Press Ctrl+C to stop. /* TID 0x1284 */ 206 ms open() /* TID 0x129a */ 221 ms open() /* TID 0x1284 */ ...
frida-trace -i open -U -f com.mwr.example.sieve Instrumenting functions... open: Loaded handler at "/Users/fan/__handlers__/libc.so/open.js" Started tracing 1 function. Press Ctrl+C to stop. /* TID 0x1383 */ 222 ms open(pathname=0xa7137e65, flags=0x80002) /* TID 0x1399 */ 255 ms open(pathname=0xa662cc2c, flags=0x2) /* TID 0x139a */ 267 ms open(pathname=0xa662cc2c, flags=0x2) /* TID 0x1383 */ 286 ms open(pathname=0xa662c6df, flags=0x2) ...
$ frida-trace -i open -U -f com.mwr.example.sieve Instrumenting functions... open: Loaded handler at "/Users/fan/__handlers__/libc.so/open.js" Started tracing 1 function. Press Ctrl+C to stop. /* TID 0x1434 */ 272 ms open(pathname=/dev/binder, flags=0x80002) /* TID 0x1449 */ 286 ms open(pathname=/dev/ashmem, flags=0x2) /* TID 0x144a */ 296 ms open(pathname=/dev/ashmem, flags=0x2) /* TID 0x1434 */ 300 ms open(pathname=/sys/qemu_trace/process_name, flags=0x2) 428 ms open(pathname=/dev/alarm, flags=0x0) 431 ms open(pathname=/sys/qemu_trace/process_name, flags=0x2) ...
Frida命令行接口frida-cli
启动sieve应用,并将生成的进程的任务留给Frida:
1 2 3 4 5 6 7 8 9 10 11 12
$ frida -U --no-pause -f com.mwr.example.sieve ____ / _ | Frida 10.0.1 - A world-class dynamic instrumentation framework | (_| | > _ | Commands: /_/ |_| help -> Displays the help system . . . . object? -> Display information about 'object' . . . . exit/quit -> Exit . . . . . . . . More info at http://www.frida.re/docs/home/ Spawned `com.mwr.example.sieve`. Resuming main thread! [USB::Android Emulator 5554::['com.mwr.example.sieve']]->
frida-trace -i open -U -f com.mwr.example.sieve Instrumenting functions... open: Loaded handler at "/Users/fan/__handlers__/libc.so/open.js" Started tracing 1 function. Press Ctrl+C to stop. /* TID 0x18cd */ 208 ms open(pathname=0xa7137e65, flags=0x80002) /* TID 0x18e1 */ 232 ms open(pathname=0xa662cc2c, flags=0x2) /* TID 0x18e2 */ 250 ms open(pathname=0xa662cc2c, flags=0x2) ...
使用r2frida显示内存地址的内容并读取路径名:
1 2 3 4 5 6 7 8 9 10
$ r2 frida://emulator-5554/com.mwr.example.sieve -- Run .dmm* to load the flags of the symbols of all modules loaded in the debugger [0x00000000]> s 0xa7137e65 [0xa7137e65]> px - offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF 0xa7137e65 2f64 6576 2f62 696e 6465 7200 4269 6e64 /dev/binder.Bind 0xa7137e75 6572 2069 6f63 746c 2074 6f20 6f62 7461 er ioctl to obta 0xa7137e85 696e 2076 6572 7369 6f6e 2066 6169 6c65 in version faile 0xa7137e95 643a 2025 7300 4269 6e64 6572 2064 7269 d: %s.Binder dri ...