Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
machscope — 一体化macOS二进制分析:Mach-O解析、ARM64反汇编、代码签名和调试。 | Kitploit
工具/GitHubGitHub/sadopc/machscope
静态分析iOS安全代码分析逆向工程调试器恶意软件分析CTF移动安全二进制分析学习与教育固件分析
GitHubsadopc/machscope
10046个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

machscope

一体化macOS二进制分析:Mach-O解析、ARM64反汇编、代码签名和调试。

查看仓库

MachScope

一个原生的 macOS 二进制分析工具,提供 Mach-O 解析、ARM64 反汇编和进程调试功能。完全使用 Swift 构建,零外部依赖。

Swift 6.0 Platform License

功能特性

功能描述
Mach-O 解析头部、段、节、符号、动态库、字符串
代码签名Entitlements、CDHash、签名信息、Team ID
ARM64 反汇编完整指令解码器,带 PAC 注释
进程调试附加、断点、内存、寄存器
Swift 库可嵌入到您自己的项目中
JSON 输出适合脚本处理的输出格式

为什么选择 MachScope?

  • 纯 Swift — 无依赖,易于构建和嵌入
  • 原生 ARM64 — 专为 Apple Silicon 打造,理解 PAC 指令
  • 一体化 — 解析 + 反汇编 + 调试,一个工具搞定
  • 库 + 命令行 — 独立使用或集成到您的 Swift 项目
  • 充分测试 — 319+ 个测试,全面的错误处理

快速开始

root@kitploit:~
# 构建
swift build

# 解析一个二进制文件
swift run machscope parse /bin/ls

# 解析一个 macOS 应用
swift run machscope parse /Applications/Calculator.app/Contents/MacOS/Calculator

# 查看 Entitlements
swift run machscope parse /Applications/Safari.app/Contents/MacOS/Safari --entitlements

# JSON 输出
swift run machscope parse /bin/ls --json

安装

Homebrew

root@kitploit:~
brew install sadopc/tap/machscope

从源码构建

root@kitploit:~
git clone https://github.com/sadopc/machscope.git
cd MachScope
swift build -c release

全局安装(可选)

root@kitploit:~
sudo cp .build/release/machscope /usr/local/bin/

使用方法

parse 命令

分析 Mach-O 二进制结构:

root@kitploit:~
# 基本分析
machscope parse /bin/ls

# 完整分析
machscope parse /bin/ls --all

# 特定节
machscope parse /path/to/binary --symbols
machscope parse /path/to/binary --dylibs
machscope parse /path/to/binary --strings
machscope parse /path/to/binary --signatures
machscope parse /path/to/binary --entitlements

# 用于脚本的 JSON 输出
machscope parse /bin/ls --json --all > analysis.json

disasm 命令

反汇编 ARM64 代码:

root@kitploit:~
# 列出函数
machscope disasm /bin/ls --list-functions

# 从指定地址反汇编
machscope disasm /bin/ls --address 0x100003f40 --length 50

# 显示指令字节
machscope disasm /bin/ls --show-bytes

check-permissions 命令

查看哪些功能可用:

root@kitploit:~
machscope check-permissions

输出:

root@kitploit:~
Feature               Status      Notes
------------------------------------------------------------
Static Analysis       ✓ Ready     No special permissions needed
Disassembly           ✓ Ready     No special permissions needed
Debugger              ✗ Denied    Missing debugger entitlement

debug 命令

附加到正在运行的进程(需要签名):

root@kitploit:~
# 首先,使用调试器 entitlement 进行签名
codesign --force --sign - --entitlements Resources/MachScope.entitlements .build/debug/machscope

# 在系统设置 > 隐私与安全性中启用开发者工具

# 附加到进程
machscope debug <pid>

作为 Swift 库使用

将 MachScope 添加到您的 Package.swift:

root@kitploit:~
dependencies: [
    .package(url: "https://github.com/sadopc/machscope.git", from: "1.0.0")
]

然后在代码中使用:

root@kitploit:~
import MachOKit
import Disassembler

// 解析一个二进制文件
let binary = try MachOBinary(path: "/bin/ls")
print("CPU: \(binary.header.cpuType)")
print("Segments: \(binary.segments.count)")

// 检查 Entitlements
if let signature = try binary.parseCodeSignature(),
   let entitlements = signature.entitlements {
    for key in entitlements.keys {
        print("\(key): \(entitlements[key] ?? "nil")")
    }
}

// 反汇编
let disasm = ARM64Disassembler(binary: binary)
let result = try disasm.disassembleFunction("_main", from: binary)
for instruction in result.instructions {
    print(disasm.format(instruction))
}

系统要求

  • macOS 14.0 (Sonoma) 或更高版本
  • Swift 6.0 或更高版本
  • ARM64 (Apple Silicon) — 支持解析 x86_64 文件,但工具本身运行在 ARM64 上

文档

  • 安装指南
  • 快速入门
  • 使用指南
  • 架构说明
  • API 参考
  • 故障排除
  • 贡献指南

项目结构

root@kitploit:~
MachScope/
├── Sources/
│   ├── MachOKit/        # 核心 Mach-O 解析库
│   ├── Disassembler/    # ARM64 指令解码器
│   ├── DebuggerCore/    # 进程调试
│   └── MachScope/       # 命令行应用
├── Tests/               # 测试套件(319+ 个测试)
├── Resources/           # 用于代码签名的 Entitlements
└── docs/                # 文档

适合谁?

  • iOS/macOS 开发者 — 检查二进制文件,在提交 App Store 前验证 Entitlements
  • 安全研究员 — 快速二进制分类和分析
  • 学生 — 通过可读的 Swift 代码学习 Mach-O 格式
  • 工具构建者 — 将 MachOKit 嵌入到您自己的 Swift 项目中
  • CTF 玩家 — 快速二进制分析

与其他工具的对比

MachScope 的主要优势:原生 Swift 库,可嵌入到您自己的工具中。

许可证

MIT 许可证 — 详见 LICENSE。

贡献

欢迎贡献!请先阅读 贡献指南。

root@kitploit:~
# 提交前运行测试
swift test

# 格式化代码
xcrun swift-format -i -r Sources/ Tests/

致谢

  • Apple 的 Mach-O 文档
  • ARM 架构参考手册
  • Swift 社区

Star 历史

Star History Chart


用 ❤️ 在 Swift 中构建

下载工具
工具语言库?ARM64 PAC调试器
MachScopeSwift✅ 是✅ 是✅ 是
otoolC❌ 否❌ 否❌ 否
objdumpC❌ 否❌ 否❌ 否
jtool2C❌ 否✅ 是❌ 否
Hopper—❌ 否✅ 是❌ 否