Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone: strace, dtruss, dtrace or equivalent?

Does anyone know if there is something like strace, dtruss, or dtrace for iPhone?

tester-iPhone:/tmp root$ apt-cache search dtruss
tester-iPhone:/tmp root$ apt-cache search dtrace
tester-iPhone:/tmp root$ apt-cache search trace
tester-iPhone:/tmp root$ apt-get install strace
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package strace
tester-iPhone:/tmp root$ apt-get install dtrace
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package dtrace
tester-iPhone:/tmp root$ apt-get install ltrace
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ltrace
tester-iPhone:/tmp root$ apt-get install dtruss
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package dtruss
like image 529
osmund sadler Avatar asked Nov 04 '22 06:11

osmund sadler


2 Answers

DTrace (and therefore dtruss too) have apparently been ported to iOS a while ago, but Apple have not released it outside of their own labs. The best reference I can dig up is a quote from one of the authors of DTrace: https://twitter.com/ahl/status/311866307115098112

like image 146
Brendan Gregg Avatar answered Nov 09 '22 11:11

Brendan Gregg


The Frida framework may be useful, which provides for dynamic code instrumentation using a Python API. It lets you inject snippets of JavaScript into native apps on iOS (and Windows, Mac, Linux).

There's a good tutorial on using Frida on iOS.

There's also Saurik's Cycript which allows for 'developers to explore and modify running applications on either iOS or Mac OS X using a hybrid of Objective-C++ and JavaScript syntax through an interactive console'.

And of course there's his Cydia Substrate allows one to alter/inject the behaviour of iOS apps.

like image 36
Pierz Avatar answered Nov 09 '22 11:11

Pierz