首页
社区
课程
招聘
[转帖] Electra Jailbreak 1.0.4下调试第三方应用
发表于: 2018-3-22 18:19 6088

[转帖] Electra Jailbreak 1.0.4下调试第三方应用

2018-3-22 18:19
6088

原文链接:https://kov4l3nko.github.io/blog/2018-03-18-my-experience-with-lldb-and-electra-jb/


My experience with LLDB on Electra Jailbreak 1.0.4

Mar 18, 2018

Debugging via USB

Attaching LLDB to already running process

Running an app under LLDB

I tried to google a short and clear instruction how to debug apps from AppStore on iOS devices jailbroken withElectra, with no success, so I wrote this guide. I tested it on iPhone 7 running iOS 11.1.2 with Electra jailbreak of version 1.0.4. I’m not sure it will work on any iOS device jailbroken with Electra.

Debugging via USB

For me, it works only if I do debugging via USB. Ifiproxyis not installed on your Mac, install it, e.g. withbrew:

$ brew install usbmuxd

Then run in your Mac console:

$ iproxy 6666 6666
$ iproxy 2222 22

Finally, attach you iPhone to USB. That’s it, we are ready to start.

Attaching LLDB to already running process

On your Mac console, connect the iPhone:

$ ssh -p 2222 root@localhost

In the iPhone’s console, run

# ps ax

Find pid of the process you want to attach. Then run

# /electra/jailbreakd_client <the pid> 1
# /Developer/usr/bin/debugserver localhost:6666 -a <the pid>

If you see something like

debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-360.0.26.14
 for arm64.
Attaching to process 1418...
Listening to port 6666 for a connection from localhost...

everything going well. Now, open another console on your Mac, and run

$ lldb

In LLDB console, run

(lldb) platform select remote-ios
(lldb) process connect connect://localhost:6666

That’s it! :)

Running an app under LLDB

On your Mac console, connect the iPhone:

$ ssh -p 2222 root@localhost

In the iPhone’s console, run

# debugserver localhost:6666 -x backboard /var/containers/Bundle/Application/<path to the app binary>

If you see something like

debugserver-@(#)PROGRAM:debugserver  PROJECT:debugserver-360.0.26.14
 for arm64.
Listening to port 6666 for a connection from localhost...

everything going well. Now, open another console on your Mac, and run

$ lldb

In LLDB console, run

(lldb) platform select remote-ios
(lldb) process connect connect://localhost:6666

Happy debugging!

Wanna say something?

Commenting is not available in this blog, but you canwrite me a letter or message. Please, note that English is not my native language. I'm sorry for mistakes/missprints, if any.

Prev:Debugging Android third-party Java apps with native methods
Copyright © Dima Kovalenko, 2012-2018

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

最后于 2018-3-22 18:20 被roysue编辑 ,原因:
收藏
免费 0
支持
分享
最新回复 (1)
雪    币: 7
活跃值: (16)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
哈哈  问题终于解决了,感谢gaysue分享
2018-3-23 10:23
0
游客
登录 | 注册 方可回帖
返回
//