re-format-macho

re-format-macho is a skill for Claude Code from dslsdzc/rev-skills. It costs 38 tokens per session (2,904 once invoked), scanned A, original, Apache-2.0.

A guide to the Mach-O file format used by macOS and iOS programs, libraries and frameworks. It covers load commands, segments, dynamic-library dependencies, code signatures and multiple-architecture files.

In plain words
What is it for?
Analysing executable files and libraries, checking architecture slices, inspecting dependencies and load commands, reviewing signatures, and investigating possible dynamic-library injection.
Why use it?
It gives developers the platform-specific structure and tools needed to inspect Apple binaries and spot unusual library loading or signing details.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Analysing executable files and libraries, checking architecture slices, inspecting dependencies and load commands, reviewing signatures, and investigating possible dynamic-library injection.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dslsdzc/rev-skills/re-format-macho
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dslsdzc/rev-skills --skill re-format-macho
Clone the repo
git clone --depth 1 https://github.com/dslsdzc/rev-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for re-format-macho

README.md
[![agentmods](https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-macho/github.svg)](https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-macho)
Your own site
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-macho"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-macho/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for re-format-macho

Your own site · 80×15
<a href="https://agentmods.dev/skills/dslsdzc/rev-skills/re-format-macho"><img src="https://agentmods.dev/badge/skills/dslsdzc/rev-skills/re-format-macho.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00038 $0.02904
Opus 5.5 $0.00015 $0.01162
Sonnet 5.5 $0.00008 $0.00581
Haiku 4.5 $0.00004 $0.00290

Measured 1mo ago against content hash c2c41fc577d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

re-format-macho scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/re-format-macho/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Mach-O 格式解析

何时使用 / 何时不用

  • 用:目标是 macOS/iOS 的 Mach-O 二进制(可执行文件/.dylib/.bundle/Framework),需要理解结构、load commands、入口、代码签名、动态库依赖链
  • 用:检查 dylib 注入(LC_LOAD_DYLIB 异常条目)、签名/公证状态、通用二进制多架构片
  • 不用:PE(走 [[re-format-pe]])、ELF(走 [[re-format-elf]])
  • 不用:只需函数逻辑(直接反编译技能);iOS 越狱环境问题属 [[re-mobile]] 域

工具准备

参考 [[re-analyze/platform-tips]] macOS 分支——attach/调试受 SIP 与 TCC 限制;静态解析不受影响。

otool(Apple 自带)

  • macOS: Xcode Command Line Tools: xcode-select --install
  • 验证: otool --version
  • Linux 替代: llvm-otool(apt install llvm / brew install llvm / pacman -S llvm),功能覆盖 otool 常用子命令

llvm-objdump(跨平台)

  • macOS: brew install llvm;Linux: apt install llvm / dnf install llvm / pacman -S llvm
  • 验证: llvm-objdump --version
  • 用法: llvm-objdump --macho --private-headers sample(Linux 上可直接解析 Mach-O,与 macOS 输出一致)

jtool2(深入 Mach-O 结构,macOS)

  • macOS: 从 GitHub(intezer/jtool2)clone 后 make,或下载 release 二进制
  • 验证: jtool2 -h sample 输出 load commands

codesign / lipo(macOS 自带)

  • 验证: codesign --version;lipo -info sample
  • Linux 替代: llvm-lipo -info sample(llvm 自带)

dyld_shared_cache_util(macOS)

  • 系统自带(/usr/bin/dyld_shared_cache_util);用途: 解析 dyld 共享缓存中的系统 dylib 时把单个库抽出来

操作步骤

  1. 初勘(先确认类型与架构):

    file sample                  # 可执行文件 / dylib / 通用二进制 / 字节序
    lipo -info sample            # 通用二进制列出各架构片;单架构提示 "non-fat file"
    xxd -l 16 sample             # 魔数: cffaedfe=64位小端, feedfacf=64位大端, cebafaed=32位小端, cafebabe=fat
    

    魔数(文件里看到的字节):cffa edfe(MH_MAGIC_64)、cefa edfe(MH_MAGIC 32 位)、cafe babe(FAT,后跟 4 字节架构数)。通用二进制先 lipo -thin <arch> -output piece sample 提取单片再解析。

  2. mach_header 与 load commands(核心):

    otool -h sample                 # magic/cputype/filetype/ncmds/flag 一行全出
    otool -l sample | head -80      # 全部 load commands
    

    64 位 mach_header 固定 32 字节(32 位为 28 字节):magic(4) + cputype(4) + cpusubtype(4) + filetype(4) + ncmds(4) + sizeofcmds(4) + flags(4) + reserved(4,仅 64 位)。load commands 是 Mach-O 的"节表+导入表+入口+签名"综合体——从头到尾按 cmdsize 顺序遍历,ncmds 计数、sizeofcmds 为总字节数,两者互相校验。filetype: 2=MH_EXECUTE 6=MH_DYLIB 8=MH_BUNDLE。常见 LC 值与字段表见 [[layout]]。

Read the full file on GitHub · 132 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed c2c41fc577d7
  2. 2mo ago Changed · +1 lines 00c7414e3b5a
  3. 3mo ago First seen · 131 lines · 38 tokens per session scan A 3ba61f8bb8ae

Subscribe to this mod's changes

re-format-macho is a skill published in the GitHub repository dslsdzc/rev-skills (275 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 38 tokens to every session and 2,904 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

re-format-macho compared with skills from other repositories

re-format-macho next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
re-format-machodslsdzc/rev-skillsSkill2751mo agoApache-2.0A38Claude Code
analyzing-golang-malware-with-ghidraYoungmaidainon/Agent-Level-UpSkill43mo agoMITA95Claude Code, Codex
analyzing-golang-malware-with-ghidramukul975/Anthropic-Cybersecurity-SkillsSkill37k3mo agoApache-2.0A95Claude Code
analyzing-golang-malware-with-ghidra26zl/cybersec-toolkitSkill114todayMITA95Claude Code
reverse-engineering-binaries-with-ghidrameltedinhex/analyst-ai-packSkill253d agoApache-2.0A80Claude Code, Codex
reverse-engineering-shellcodemeltedinhex/analyst-ai-packSkill253d agoApache-2.0A68Claude Code, Codex
reverse-engineering-arm-binariesmeltedinhex/analyst-ai-packSkill253d agoApache-2.0A69Claude Code, Codex