Skip to content
New

DeepSeek V4.1 Flash free for 7 days: 10M tokens a day after a top-up of $10 or more. Until Nov 30.

How it works
meltedinhex/analyzing-mach-o-binaries-on-macosReverse engineering and fuzzing

analyzing-mach-o-binaries-on-macos

⁨Statically analyzes macOS Mach-O malware: parsing the header and load commands,⁩

v1.0.02 installs+2 in 7 days24 StarsApache-2.0synced 10 hours ago

Install

No NotHoly CLI yet? Install it first.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install meltedinhex/analyzing-mach-o-binaries-on-macos

Writes to ⁦~/.notholy/skills⁩ after checking the signature and the SHA-256.

SignatureSigned, ed25519
qST2gTQgSD…ehuDWWCA==The CLI checks the SHA-256 and the signature before it writes a file.
Package76b85f5e…f66efd8f
76b85f5e1621…a963f66efd8f4 files · ⁦3.2 KB⁩
ScanMedium2 findings
  • Executable script shipped with the skillscripts/analyst.py
  • Links to outside domains
See the full scan
Sourcegithub.com/meltedinhex/analyst-ai-pack/tree/main/skills/analyzing-mach-o-binaries-on-macos@da7600a

When to Use

  • You have a macOS sample (Mach-O) and need a static capability and trust read.
  • You must handle a fat/universal binary containing multiple architecture slices.
  • You need to inspect linked dylibs, entitlements, and code-signing status.

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

Prerequisites

  • A Mach-O parser (Python stdlib struct, or macholib/LIEF); the sample handled inertly.
  • For signing/entitlements on macOS, codesign/otool are authoritative.

Safety & Handling

  • Parse statically; never execute the sample, especially on a real macOS host.
  • Keep the sample password-protected at rest and reference it by hash.

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.

bash
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

  • Fat binaries are decomposed and each slice is analyzed, not just the first.
  • Load commands, dylibs, and signing status are enumerated correctly.
  • Capability inferences are corroborated by linked frameworks/symbols.

Pitfalls

  • Analyzing only one slice of a universal binary.
  • Trusting a present signature without verifying it (ad-hoc signatures verify but aren't trusted).
  • Applying PE assumptions (sections/imports) to Mach-O structures.

References

  • See references/api-reference.md for the Mach-O header parser.
  • Apple Mach-O loader.h and code signing docs (linked in frontmatter).

Files in this version

Permissions

PermissionDeclaredFound by the scan
Reads filesNoNo
Writes filesNoNo
Runs shell commandsYesYes
Uses the networkYesYes
Uses connectorsNoNo
Drives a browserNoNo

Scan findings

Reviewed on Nov 13, 2026

  1. MediumFile · Executable script shipped with the skillscripts/analyst.py
  2. InfoLink · Links to outside domains

A clean scan lowers the risk but does not prove a package is safe. Read what you install.

VersionPublishedCommitSHA-256SignaturePermission change
v1.0.0Nov 13, 2026da7600a76b85f5eSigned–

Ask anything your scope allows.

Create an account, add credits and ask the first question in the chat or the terminal.

  1. 1/3

    Create the account

    Individual or company. You can switch to a company later without losing balance or keys.

    IndividualCompany
  2. 2/3

    Add credits

    By card. Pay per token, no subscription.

    $5.00minimum deposit
  3. 3/3

    Ask

    In the chat, or install the CLI and run notholy login in your terminal.

    $ notholy login