反调试,直接debug -a 连接错误是:Segmentation fault: 11。 如果用debugserver -x auto启动则错误码:Process 2478 exited with status = 45 (0x0000002d)
然后:
1.我把ptrace打断点,寄存器改值,依然是45错误。
2.用monkeyApp启动,日志显示为下图。但是仍然不允许调试。
然后:
我在lldb启动时候打断点, 一直ni下去,最后崩溃日志为:
- thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000182b975c8 libobjc.A.dylibload_images + 80 libobjc.A.dylib
load_images:
→ 0x182b975c8 <+80>: add x0, x0, #0xf48 ; =0xf48
0x182b975cc <+84>: ldp x29, x30, [sp, #0x10]
0x182b975d0 <+88>: ldp x20, x19, [sp], #0x20
0x182b975d4 <+92>: b 0x182b9fba4 ; recursive_mutex_tt::unlock()
Target 0: (WeChat) stopped.
(lldb)
Process 2478 stopped - thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000182b975cc libobjc.A.dylibload_images + 84 libobjc.A.dylib
load_images:
→ 0x182b975cc <+84>: ldp x29, x30, [sp, #0x10]
0x182b975d0 <+88>: ldp x20, x19, [sp], #0x20
0x182b975d4 <+92>: b 0x182b9fba4 ; recursive_mutex_tt::unlock()
0x182b975d8 <+96>: ldp x29, x30, [sp, #0x10]
Target 0: (WeChat) stopped.
(lldb)
Process 2478 stopped - thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000182b975d0 libobjc.A.dylibload_images + 88 libobjc.A.dylib
load_images:
→ 0x182b975d0 <+88>: ldp x20, x19, [sp], #0x20
0x182b975d4 <+92>: b 0x182b9fba4 ; recursive_mutex_tt::unlock()
0x182b975d8 <+96>: ldp x29, x30, [sp, #0x10]
0x182b975dc <+100>: ldp x20, x19, [sp], #0x20
Target 0: (WeChat) stopped.
(lldb)
Process 2478 stopped - thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000182b975d4 libobjc.A.dylibload_images + 92 libobjc.A.dylib
load_images:
→ 0x182b975d4 <+92>: b 0x182b9fba4 ; recursive_mutex_tt::unlock()
0x182b975d8 <+96>: ldp x29, x30, [sp, #0x10]
0x182b975dc <+100>: ldp x20, x19, [sp], #0x20
0x182b975e0 <+104>: ret
Target 0: (WeChat) stopped.
(lldb)
Process 2478 stopped - thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000104ae8f18 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 348 dyld
ImageLoader::recursiveInitialization:
→ 0x104ae8f18 <+348>: ldr x8, [x19]
0x104ae8f1c <+352>: ldr x8, [x8, #0x2c8]
0x104ae8f20 <+356>: mov x0, x19
0x104ae8f24 <+360>: mov x1, x21
Target 0: (WeChat) stopped.
(lldb)
Process 2478 stopped - thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000104ae8f1c dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 352 dyld
ImageLoader::recursiveInitialization:
→ 0x104ae8f1c <+352>: ldr x8, [x8, #0x2c8]
0x104ae8f20 <+356>: mov x0, x19
0x104ae8f24 <+360>: mov x1, x21
0x104ae8f28 <+364>: blr x8
Target 0: (WeChat) stopped.
(lldb) register read
General Purpose Registers:
x0 = 0x000000000000001e
x1 = 0x0000000104b14c5b dyldinitialPoolContent + 37515 x2 = 0x00000000bdc23169 x3 = 0x000000000000001e x4 = 0x0000000000000057 x5 = 0x0000000000000039 x6 = 0x0000000000000000 x7 = 0x00000000000003a0 x8 = 0x0000000104b08d80 dyld
vtable for ImageLoaderMachOCompressed + 16
x9 = 0x0000000000000025
x10 = 0x0000000000000250
x11 = 0x0000000000000000
x12 = 0x0000120000001303
x13 = 0x0000000000000000
x14 = 0x0000130000001300
x15 = 0x0000000000000000
x16 = 0x0000000000001300
x17 = 0x0000000000000080
x18 = 0x0000000000000000
x19 = 0x0000000104b14b08 dyldinitialPoolContent + 37176 x20 = 0x000000016fda8bc0 x21 = 0x0000000104b09838 dyld::gLinkContext x22 = 0x00000094e99b2228 x23 = 0x0000000000000403 x24 = 0x000000000000000c x25 = 0x0000000104b30290 dyld
initialPoolContent + 149696
x26 = 0x0000000035180c28
x27 = 0x0000000104ae8dbc dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) x28 = 0x0000000104b09000 dyld
vtable for ImageLoaderMachOCompressed + 656
fp = 0x000000016fda6250
lr = 0x0000000104ae8f18 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 348 sp = 0x000000016fda61f0 pc = 0x0000000104ae8f1c dyld
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 352
cpsr = 0x80000000
(lldb) ni
Process 2478 stopped
- thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000104ae8f20 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 356 dyld
ImageLoader::recursiveInitialization:
→ 0x104ae8f20 <+356>: mov x0, x19
0x104ae8f24 <+360>: mov x1, x21
0x104ae8f28 <+364>: blr x8
0x104ae8f2c <+368>: mov x23, x0
Target 0: (WeChat) stopped.
(lldb) register read
General Purpose Registers:
x0 = 0x000000000000001e
x1 = 0x0000000104b14c5b dyldinitialPoolContent + 37515 x2 = 0x00000000bdc23169 x3 = 0x000000000000001e x4 = 0x0000000000000057 x5 = 0x0000000000000039 x6 = 0x0000000000000000 x7 = 0x00000000000003a0 x8 = 0x0000000104aedb60 dyld
ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&)
x9 = 0x0000000000000025
x10 = 0x0000000000000250
x11 = 0x0000000000000000
x12 = 0x0000120000001303
x13 = 0x0000000000000000
x14 = 0x0000130000001300
x15 = 0x0000000000000000
x16 = 0x0000000000001300
x17 = 0x0000000000000080
x18 = 0x0000000000000000
x19 = 0x0000000104b14b08 dyldinitialPoolContent + 37176 x20 = 0x000000016fda8bc0 x21 = 0x0000000104b09838 dyld::gLinkContext x22 = 0x00000094e99b2228 x23 = 0x0000000000000403 x24 = 0x000000000000000c x25 = 0x0000000104b30290 dyld
initialPoolContent + 149696
x26 = 0x0000000035180c28
x27 = 0x0000000104ae8dbc dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) x28 = 0x0000000104b09000 dyld
vtable for ImageLoaderMachOCompressed + 656
fp = 0x000000016fda6250
lr = 0x0000000104ae8f18 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 348 sp = 0x000000016fda61f0 pc = 0x0000000104ae8f20 dyld
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 356
cpsr = 0x80000000
(lldb) ni
Process 2478 stopped
- thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000104ae8f24 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 360 dyld
ImageLoader::recursiveInitialization:
→ 0x104ae8f24 <+360>: mov x1, x21
0x104ae8f28 <+364>: blr x8
0x104ae8f2c <+368>: mov x23, x0
0x104ae8f30 <+372>: mov w8, #0x32
Target 0: (WeChat) stopped.
(lldb) ni
Process 2478 stopped - thread #1, queue = ‘com.apple.main-thread’, stop reason = instruction step over
frame #0: 0x0000000104ae8f28 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 364 dyld
ImageLoader::recursiveInitialization:
→ 0x104ae8f28 <+364>: blr x8
0x104ae8f2c <+368>: mov x23, x0
0x104ae8f30 <+372>: mov w8, #0x32
0x104ae8f34 <+376>: strb w8, [x19, #0x44]
Target 0: (WeChat) stopped.
(lldb) register read
General Purpose Registers:
x0 = 0x0000000104b14b08 dyldinitialPoolContent + 37176 x1 = 0x0000000104b09838 dyld::gLinkContext x2 = 0x00000000bdc23169 x3 = 0x000000000000001e x4 = 0x0000000000000057 x5 = 0x0000000000000039 x6 = 0x0000000000000000 x7 = 0x00000000000003a0 x8 = 0x0000000104aedb60 dyld
ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&)
x9 = 0x0000000000000025
x10 = 0x0000000000000250
x11 = 0x0000000000000000
x12 = 0x0000120000001303
x13 = 0x0000000000000000
x14 = 0x0000130000001300
x15 = 0x0000000000000000
x16 = 0x0000000000001300
x17 = 0x0000000000000080
x18 = 0x0000000000000000
x19 = 0x0000000104b14b08 dyldinitialPoolContent + 37176 x20 = 0x000000016fda8bc0 x21 = 0x0000000104b09838 dyld::gLinkContext x22 = 0x00000094e99b2228 x23 = 0x0000000000000403 x24 = 0x000000000000000c x25 = 0x0000000104b30290 dyld
initialPoolContent + 149696
x26 = 0x0000000035180c28
x27 = 0x0000000104ae8dbc dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) x28 = 0x0000000104b09000 dyld
vtable for ImageLoaderMachOCompressed + 656
fp = 0x000000016fda6250
lr = 0x0000000104ae8f18 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 348 sp = 0x000000016fda61f0 pc = 0x0000000104ae8f28 dyld
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 364
cpsr = 0x80000000
(lldb) ni
Process 2478 exited with status = 45 (0x0000002d)
环境: iphone6p 10.1 越狱