Library for parsing MachO files to obtain information.
In addition to file reading, parsing of images in memory by _dyld_get_image_header is also supported.
<!-- # Badges -->
![Github issues]()
![Github forks]()
![Github stars]()
![Github top language]()
For reading from memory, use the MachOImage structure.
It can be initialized by using the Mach-O Header pointer obtained by _dyld_get_image_header.
Alternatively, it can be initialized using the name.
For reading from file, use the MachOFile structure.
Reading from a file can be as follows.
There is a case of a Fat file and a single MachO file, so a conditional branching process is required.
Both MachOImage and MachOFile can use essentially the same properties and methods.
The a methods are defined in the following file as the MachORepresentable protocol.
MachORepresentable
Loading of dyld_shared_cache is also supported.
The a methods are defined in the following file as the DyldCacheRepresentable protocol.
DyldCacheRepresentable
#### Dyld Cache (File)
It is also possible to extract machO information contained in dyld_shared_cache.
The machO extracted is of type MachOFile.
As with reading from a single MachO file, analyses are possible.
#### Full Dyld Cache (File)
In addition to DyldCache, FullDyldCache can be used to handle multiple dyld cache files (main cache and subcaches) as a single unified cache.
The FullDyldCache type provides properties like mainCache, subCaches, allCaches, and urls to access each component cache file.
#### Dyld Cache (on memory)
On the Apple platform, the dyld cache is deployed in memory.
It is also possible to extract machO information contained in dyld_shared_cache.
The machO extracted is of type MachOImage.
As with reading from a single MachO image, analyses are possible.
MachOKit keeps description close to C header constants (for example LC_MAIN).
If you need user-facing labels, import MachOKitReadable and use readableDescription.
There are a of uses, but most show a basic example that prints output to the Test directory.
#### Load from memory
The following file contains sample code.
MachOPrintTests
#### Load from file
The following file contains sample code.
MachOFilePrintTests
#### Dyld Cache (file)
The following file contains sample code.
DyldCachePrintTests
#### Dyld Cache (on memory)
The following file contains sample code.
DyldCacheLoadedPrintTests
Utilities for extracting higher-le metadata from Mach-O binaries.
MachOKit is released under the MIT License. See LICENSE
开发语言:Swift
Star 数:278
该项目属于CTF思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕🔬 A Swift library for parsing mach-o files to obtain various information.展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | MachOKit - 🔬 A Swift library for parsing mach-o files to obta |
| 所属分类 | CTF思路 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 23:44:34 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 370 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |