惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
V
Visual Studio Blog
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
Last Week in AI
Last Week in AI
C
Check Point Blog
D
Docker
M
MIT News - Artificial intelligence
P
Proofpoint News Feed
博客园 - 叶小钗
博客园 - 聂微东
The Cloudflare Blog
云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
MyScale Blog
MyScale Blog
WordPress大学
WordPress大学
Engineering at Meta
Engineering at Meta
腾讯CDC
S
SegmentFault 最新的问题
博客园 - 【当耐特】

看川博客

我被 AI "蒸馏" 了 - 看川博客 距离上线只差一个软件著作权证书 - 看川博客 开发简报(2):开发者需要先进的工具 - 看川博客 比越狱更棘手!iOS vPhone 虚拟机成黑灰产新温床 - 看川博客 开发简报(1):拥抱 AI、别无选择 - 看川博客 糟糕!我的 OpenClaw 中了病毒 - 看川博客 今天你用了多少词元? - 看川博客 闪忆 LiveMem:把回忆做成会动的壁纸 - 看川博客 Swift 从 ObservableObject 迁移到 @Observable 的再讨论 视频帧截图(Video2Frame)专业视频抽帧截图工具 - 看川博客 录音记事本 - 专业安全的录音工具 App - 看川博客 Swift 从 ObservableObject 迁移到 @Observable 从 Apple Distribution Managed 证书提取备案所需公钥和 SHA1 条码助手 iOS 2.0.0 升级指南 - 看川博客 SwiftUI Menu checkmark 文本对齐 - 看川博客 C++ RTTI 信息对二进制体积和安全性的影响 - 看川博客 SwiftUI 系统颜色表查询 - 看川博客 读马伯庸《长安的荔枝》 - 看川博客 SwiftUI List selection 的使用提示 - 看川博客 PHP json_encode UTF-8 中文编码问题 - 看川博客 我为什么重新运营微信公众号 - 看川博客 使用 TrollStore(巨魔) 在非越狱设备上安装任意 IPA - 看川博客 条码助手小程序更新 - 看川博客 涨粉神器?解密“抖音黑科技”云端商城 - 看川博客
iOS 18 中 libdyld.dylib/dyld 的一些变化
2024-10-09 · via 看川博客

libdyld.dylib 作为 应用程序 和 dyld 之间的桥接层,几乎每次大版本的系统更新都会有很多变化。在 iOS 18 系统中 __dyld4 section 所在的 segment 发生了变化。

在之前的文章中,讨论过 dyld 的变化:

iOS 13 中对 dyld 3 的改进和优化

在 iOS 18 系统中 dyld 也发生了一些变化。

LibdyldDyld4Section 的变化

LibdyldDyld4Section 是指向 dyld_all_image_infos 的结构体,在 dyld4 中声明如下:

struct LibdyldDyld4Section {
	void* apis;
	void* allImageInfos;  // set by dyld to point to the dyld_all_image_infos struct
};

这个结构体的地址是通过 libdyld.dylib 的 __dyld4 section 指示的。在 iOS 18 之前的系统,__dyld4 属于 _DATA_DIRTY segment,而在 iOS 18 中则属于 __TPRO_CONST segment。iOS 18.0.1 使用的 dyld-1231.3 中的相关代码如下:

LibdyldDyld4Section* libdyld4Section = (LibdyldDyld4Section*)libdyldML->findSectionContent("__TPRO_CONST", "__dyld4", sectSize);

Thread Performance Checker 和 libRPAC.dylib

Xcode 中开启 Thread Performance Checker 后调试 App,会被自动注入名称为:

/usr/lib/libRPAC.dylib

的动态库。没有执行更多测试,但可以确定的是这个特性是在 iOS 18 更早的版本引入的。在 iOS 18.0.1 中验证,Xcode 中开启 Thread Performance Checker,libRPAC.dylib 注入后,将 HOOK 很多系统原生 API,对应的符号会被替换为_interposed_replacement 开头的符号。比如:

_replacement_NSData_initWithContentsOfFile
_interposed_dispatch_semaphore_create

相关讨论:

Investigating a Dynamic Linking Crash with Xcode 16

这个特性也会影响到 dyld 相关符号的解析,如果代码中有硬编码的符号查找,需要做兼容适配。