re-format-macho

Parse Mach-O binaries including mach_header, load commands, segments, and dyld information.

64|9|Updated Aug 17, 2026
One-click install
npx skills add https://github.com/dslsdzc/rev-skills --skill re-format-macho-dslsdzc
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: re-format-macho
Source: https://github.com/dslsdzc/rev-skills/tree/main/.claude/skills/re-format-macho
Command: npx skills add https://github.com/dslsdzc/rev-skills --skill re-format-macho-dslsdzc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Analyzing macOS and iOS binaries requires understanding the Mach-O format, whose load commands combine the roles of section tables, import tables, entry points, and code signatures. This Skill provides a structured workflow for parsing Mach-O files with otool, llvm-objdump, jtool2, and manual byte-level inspection, so you can map segments, trace dylib dependencies, and verify code signatures without guessing at offsets. ## Core Features & Use Cases - Header and Load Command Parsing: Decode mach_header fields, walk LC_* commands by cmdsize, and validate ncmds against sizeofcmds to detect forged headers. - Segment, Entry, and dyld Analysis: Map __TEXT/__DATA/__LINKEDIT segments, compute entry VA from LC_MAIN, and decode rebase/bind/export tables including the export trie. - Dependency and Signature Inspection: List LC_LOAD_DYLIB entries to detect injected dylib persistence, and check codesign status for adhoc versus Apple-signed binaries. - Use Case: Given a suspicious macOS dylib, run otool -L to compare its load commands against the signed dependency list, extract the export trie with llvm-objdump, and confirm whether an unexpected LC_LOAD_DYLIB entry indicates malicious persistence. ## Quick Start Analyze the attached Mach-O binary by parsing its mach_header, load commands, segments, dylib dependencies, and code signature, then report the entry point and any anomalies.

Frequently Asked Questions about re-format-macho

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I parse Mach-O load commands with otool?▼

Run `otool -h` for the mach_header and `otool -l` to list all load commands. Walk commands sequentially by each cmdsize field, and cross-check ncmds against sizeofcmds to detect forged or truncated headers.

How to analyze Mach-O files on Linux without macOS?▼

Install the llvm package to get llvm-otool, llvm-objdump, and llvm-lipo, which parse Mach-O on Linux with output matching macOS. Use `llvm-objdump --macho --private-headers` for full header dumps; only disassembly of foreign architectures needs cross tools.

How do I detect dylib injection in a Mach-O binary?▼

Run `otool -L` to list LC_LOAD_DYLIB entries and compare against the dependency list recorded at signing time. An unexpected added LC_LOAD_DYLIB entry is a strong indicator of malicious dylib persistence.

Does Mach-O parsing work on universal (fat) binaries?▼

Yes, but first run `lipo -info` to list architecture slices, then extract one slice with `lipo -thin <arch> -output piece sample`. Fat headers are always big-endian on disk, and each slice offset is an absolute file offset.

Why does otool output garbled load commands partway through?▼

This usually means ncmds or sizeofcmds was forged, or one command has an abnormal cmdsize. Validate each command's cmdsize (minimum 16 bytes on 64-bit) and derive legality from the sizeofcmds total instead of trusting ncmds alone.

When should I not use Mach-O format parsing?▼

Use PE or ELF parsing skills for Windows and Linux binaries instead. If you only need function logic, go straight to decompilation; iOS jailbreak environment issues belong to mobile analysis rather than static format parsing.