[完结] HELP!!! M1 lldb Frida attach 失败

M1 重签名之后都安装完了 能跑起来;
但是使用LL DB和frida. attach 失败,搜了一下都没搜到解决问题;
日志:
[xia0LLDB] * Version: 3.0
[xia0LLDB] + Loading all scripts from /Users/wobushou/Downloads/xia0LLDB/src
[xia0LLDB] * Finished
(lldb) process attach --pid 59186
error: attach failed: attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries when the attached failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)

使用LLDB 和Frida. 调试原生的Mac APP 是OK的。,只有调试重签名后的手机APP attach不上去。

M1 关闭SIP之后 l l d b提示error: attach failed: lost connection
frida更狠 直接Failed to attach: unexpected early end-of-stream

我也遇到了关闭sip没办法调试的状态。而且如果不重签名甚至都打不开iOSAPP。然而有些APP重签就有问题,所以是没得搞了。

今天继续尝试了一下 发现Resign小的APP 是可以LLDB上去的。
以及正常的原生应用也是可以上去的。

对比发现 可能是没有
get-task-allow

然后我重新打包 使用develop模式
然后查看Resign的APP

codesign -d --entitlements :- app name

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>application-identifier</key>
	<string>CR5K4*****.f4ck.develop</string>
	<key>aps-environment</key>
	<string>development</string>
	<key>com.apple.developer.associated-domains</key>
	<string>*</string>
	<key>com.apple.developer.team-identifier</key>
	<string>CR5K4****4</string>
	<key>get-task-allow</key>
	<true/>
	<key>keychain-access-groups</key>
	<array>
		<string>CR5K4****4.*</string>
		<string>com.apple.token</string>
	</array>
</dict>
</plist>

已经开启了get-task-allow LLDB 还是提示error: attach failed: lost connection

然后查看日志 :
Saved crash report for debugserver[19409] version 2 to debugserver_2021-03-09-001644.crash

External Modification Warnings:
Process used task_for_pid().

macOS. Big Sur 11.2.2 版本
lldb-1200.0.44.2
Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)

你重签名用的是付费账号还是7天试用呀?我用试用的重签名后安装app都报稍后再试

持续关注,有解决方法后,跪求共享

付费账号。

我试了几款APP 除了我手上几款比较特殊 好像都不能attach. 其他的是可以attach的 比如微信,好像是和反调试有关,但是这个APP在手机上attach是没有反调试的。所以还在找具体原因。

你去 苹果官方网站去找一个函数用于获取是否是 m1 的笔记本 过了这个函数再试一下

结帖,之前因为手机上用LLDB和Frida都ok 所以并没有考虑反调试这个东西;
然后我在反汇编的时候搜了一下p t ra ce 发现是有反调试的。然后修改汇编指令,重打包、Resign;就能调试了。

1 个赞

然后在M1上触发的反调试 并不是提示Segmentation fault:11
而是 lost connection

是这样的吗?