Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
314 views
in Technique[技术] by (71.8m points)

Problems with spawning and debugging a binary on jailbroken ios 13.3 device

I created an helloworld app with Xcode and run it. The binary is installed in /var/containers/Bundle/Application/123455-D134F-1234-3414-123123451/helloworld.app/helloworld

With debugserver, installed with Cydia, I can attach to processes and debug them, but only after having started them manually from the main screen.

When I try to spawn the program and debug it with lldb, the following happens: lldb attaches successfully, I then issue a "continue", the program crashes with SIGABRT.

Similarly, I get an error by trying to spawn it with frida-trace: Process crashed: SIGABRT. ... Error Formulating Crash Report: Symbolication has been requested by preference. On the contrary, Frida-trace works normally if I attach to the PID.

Here below the outputs:

root# debugserver localhost:1111 /var/containers/Bundle/Application/123455-D134F-1234-3414-123123451/helloworld.app/helloworld
debugserver-@(#)PROGRAM:LLDB  PROJECT:lldb-10.0.0
 for arm64.
Listening to port 1111 for a connection from localhost...
Got a connection, launched process /var/containers/Bundle/Application/123455-D134F-1234-3414-123123451/helloworld.app/helloworld (pid = 742).
$ lldb
(lldb) process connect connect://localhost:1111
Process 742 stopped
* thread #1, stop reason = signal SIGSTOP
...
Target 0: (helloworld) stopped.
(lldb) continue
Process 742 resuming
Process 742 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001a81c1ec4 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1a81c1ec4 <+8>:  b.lo   0x1a81c1ee0               ; <+36>
    0x1a81c1ec8 <+12>: stp    x29, x30, [sp, #-0x10]!
    0x1a81c1ecc <+16>: mov    x29, sp
    0x1a81c1ed0 <+20>: bl     0x1a81a0f64               ; cerror_nocancel
Target 0: (helloworld) stopped.
(lldb)

$ a=/var/containers/Bundle/Application/123455-D134F-1234-3414-123123451/helloworld.app/helloworld
$ frida-trace  -U -f $a  | tee /tmp/aa
Spawning `/var/containers/Bundle/Application/123455-D134F-1234-3414-123123451/helloworld.app/helloworld`...
Instrumenting...
Started tracing 0 functions. Press Ctrl+C to stop.
Process crashed: SIGABRT
...
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x00000001a81c1ec4 __pthread_kill + 8
...
Thread 11 name:  com.apple.uikit.eventfetch-thread
Thread 11:
0   libsystem_kernel.dylib          0x00000001a81a0634 mach_msg_trap + 8
1   CoreFoundation                  0x00000001a8348288 __CFRunLoopServiceMachPort + 216
2   CoreFoundation                  0x00000001a83433a8 __CFRunLoopRun + 1444
3   CoreFoundation                  0x00000001a8342adc CFRunLoopRunSpecific + 464
4   Foundation                      0x00000001a8682784 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228
5   Foundation                      0x00000001a8682664 -[NSRunLoop(NSRunLoop) runUntilDate:] + 88
6   UIKitCore                       0x00000001ac4e8e80 -[UIEventFetcher threadMain] + 152
7   Foundation                      0x00000001a87b309c __NSThread__start__ + 848
8   libsystem_pthread.dylib         0x00000001a80e5d8c _pthread_start + 156
9   libsystem_pthread.dylib         0x00000001a80e976c thread_start + 8
question from:https://stackoverflow.com/questions/65936926/problems-with-spawning-and-debugging-a-binary-on-jailbroken-ios-13-3-device

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...