Sofian-bll/SidecarPatcher

GitHub: Sofian-bll/SidecarPatcher

一个通过 ARM64 汇编补丁修改 SidecarCore 二进制文件以绕过 Sidecar 硬件兼容性检查的 Python 脚本。

Stars: 0 | Forks: 0

[![许可证 : MIT](https://img.shields.io/github/license/Sofian-bll/SidecarPatcher?style=flat)](https://github.com/Sofian-bll/SidecarPatcher/blob/main/LICENSE) [![版本](https://img.shields.io/github/v/release/Sofian-bll/SidecarPatcher?style=flat)](https://github.com/Sofian-bll/SidecarPatcher/releases) [![Stars](https://img.shields.io/github/stars/Sofian-bll/SidecarPatcher?style=flat)](https://github.com/Sofian-bll/SidecarPatcher/stargazers)

SidecarPatcher logo

SidecarPatcher

用于在不支持的 Mac 和 iPad 上重新启用 Sidecar 的实验性原型。

🇬🇧 English · 🇫🇷 Français

## 这是什么? SidecarPatcher 是一个 Python 脚本,用于修改 Apple 的 `SidecarCore` 二进制文件,以绕过 Sidecar 的硬件兼容性检查。它会通过二进制签名自动定位负责该检查的函数,并对其应用汇编 patch。 ## 研发历程 我并非科班出身的开发人员,Python 也是刚入门。这个项目源于与 AI 的一次对话:我想在自己的 Mac 和 iPad Air 2 上重新启用 Sidecar,于是决定深入探究一番。 我都是在实践中学习的——ARM64 汇编、提取 DYLD 缓存、使用 Hopper Disassembler 分析二进制文件、代码签名和 entitlements。我花了不少时间去理解 macOS 是如何锁定其框架的,以及修改它们意味着什么。 完整的研究日志(内有详细解释):[`docs/RECHERCHE.md`](docs/RECHERCHE.md)。 ## 技术栈 - [![Python](https://img.shields.io/badge/python-3670A0?style=flat&logo=python&logoColor=ffdd54)](https://www.python.org/) — 仅使用 stdlib(`argparse`、`pathlib`、`dataclasses`) - [Hopper Disassembler](https://www.hopperapp.com/) — 分析 ARM64 二进制文件 - [`dyld-shared-cache-extractor`](https://github.com/keith/dyld-shared-cache-extractor) — 提取框架缓存 ## 快速开始 ``` git clone https://github.com/Sofian-bll/SidecarPatcher.git cd SidecarPatcher python3 sidecar_patcher.py /chemin/vers/SidecarCore ``` 该脚本会扫描二进制文件,找到特征签名并写入已 patch 的文件(`SidecarCore.patched`)。 ## 用法 ``` # 基础 Patch (自动检测 signature) python3 sidecar_patcher.py SidecarCore # 手动 offset (十进制或 hexa) python3 sidecar_patcher.py SidecarCore --force-offset 0x3A2C # 自定义输出文件 python3 sidecar_patcher.py SidecarCore -o /tmp/SidecarCore.patched # 禁用自动保存 python3 sidecar_patcher.py SidecarCore --no-backup # 调整 NOP padding python3 sidecar_patcher.py SidecarCore --nop-count 5 ``` ## 当前状态 - [x] 从 DYLD 缓存中提取 `SidecarCore` 二进制文件 - [x] 通过 Hopper 识别兼容性检查函数 - [x] 自动化的二进制 patch(特征签名 + NOP 填充) - [ ] 在 macOS Sequoia 下对修改后的二进制文件进行签名 ## 文件 | 文件/目录 | 描述 | |-----------------|-------------| | `sidecar_patcher.py` | 主 patch 脚本 | | `docs/RECHERCHE.md` | 完整的研究日志 | | `docs/INSTALLATION.md` | 安装指南与前置条件 | | `docs/COMMANDES.md` | 常用命令速查表 | ## 替代方案 如需无需对二进制文件进行签名即可生效的方案: - [**FeatureUnlock**](https://github.com/acidanthera/FeatureUnlock) — Lilu kext,可在内核级别启用 Sidecar、NightShift、AirPlay(需要 OpenCore) - [**free-sidecar**](https://github.com/ben-z/free-sidecar) — 类似的二进制 patch 方法 ## 许可证 MIT © 2026 Sofian — 参见 [LICENSE](LICENSE)。

(返回顶部)

标签:Python, Sidecar, 二进制补丁, 无后门, 系统工具, 逆向分析, 逆向工具