iphone:strace,dtruss,dtrace还是等同?

时间:2012-02-02 08:05:11

标签: iphone jailbreak strace dtrace ltrace

有人知道iPhone上有stracedtrussdtrace这样的内容吗?

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

3 个答案:

答案 0 :(得分:1)

DTrace(因此也是dtruss)显然已经被移植到iOS上了,但是Apple并没有在他们自己的实验室之外发布它。我可以深入研究的最佳参考是DTrace的一位作者的引用:https://twitter.com/ahl/status/311866307115098112

答案 1 :(得分:1)

Frida框架可能很有用,它提供了使用Python API的动态代码检测。它允许您将JavaScript片段注入iOS(以及Windows,Mac,Linux)上的本机应用程序。

有一个关于使用Frida on iOS的好教程。

还有Saurik的Cycript,它允许开发人员使用Objective-C ++和JavaScript语法的混合在iOS或Mac OS X上探索和修改正在运行的应用程序通过交互式控制台'。

当然,他的Cydia Substrate允许用户改变/注入iOS应用的行为。

答案 2 :(得分:0)

在真实的iOS越狱设备上,我使用了frida-trace

frida-trace -m "+[NSUUID UUID]" -U "Debug CrackMe"    // trace UUID
frida-trace -m "*[ComVendorDebugger* *]" -U -f com.robot.demo.app   // wildcard trace on Classes
frida-trace -i "getaddrinfo" -i "SSLSetSessionOption" -U -f com.robot.demo.app      // trace SSL setup options on iOS
frida-trace -m "-[NSURLRequest initWithURL:]" -U -f funky-chicken.hello-swift-4-2      // trace URLs

此工具还可以在jailed设备上使用。请参阅frida-gadget

在iOS模拟器上,我可以dtrace呼叫:

sudo dtrace -qn 'syscall::ptrace:entry { printf("%s(%d, %d, %d, %d) from %s\n", probefunc, arg0, arg1, arg2, arg3, execname); }'
Password: // you need sudo


ptrace(31, 0, 0, 0) from debugger_challen