Analyzing mach o binaries on macos

From meltedinhex/analyst-ai-pack · View interactive version

Analyzing mach o binaries on macos is an AI agent skill from the GitHub repository meltedinhex/analyst-ai-pack. Statically analyzes macOS Mach-O malware: parsing the header and load commands, handling fat/universal binaries, reading linked dylibs and entitlements, and checking code signatures to infer capability and trust. Activates for requests to analyze a Mach-O binary, inspect macOS malware, or parse load

How to use this skill

Skill file

Analyzing Mach-O Binaries on macOS

When to Use

Do not use Windows PE tooling on Mach-O — the formats differ entirely; use Mach-O-aware

parsers.

Prerequisites

Safety & Handling

Workflow

Step 1: Detect fat vs. thin and architecture

Check the magic: 0xCAFEBABE (fat/universal) vs. 0xFEEDFACE/0xFEEDFACF (Mach-O 32/64). For

fat binaries, enumerate and analyze each slice.

python scripts/analyst.py header sample.macho

Step 2: Parse load commands

Read load commands for linked dylibs (LC_LOAD_DYLIB), entry point (LC_MAIN), and signing

(LC_CODE_SIGNATURE). The dylib list hints at capability (networking, crypto).

Step 3: Inspect entitlements and signing

On macOS, use codesign/otool to read entitlements and verify the signature. Ad-hoc or absent

signatures and suspicious entitlements are risk indicators.

Step 4: Infer capability and route

Map linked frameworks/symbols to behaviors and route to disassembly/RE for deeper analysis.

Validation

Pitfalls

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.