Skip to content

CF FA ED FEexecutables · dylibs · universal · .app

Mach-O Parser

Headers, load commands, segments, imports, strings, code signature, entitlements and arm64 / x86 disassembly of macOS binaries — with the signature re-verified, capabilities found in the code and plain-language indicators. Static parsing in your browser with WebAssembly: the file is never uploaded and never run.

FIG. 0awaiting specimen

Drop Mach-O files, an .app or a folder here

Executables, dylibs, bundles and universal binaries — one file or a whole batch. An .app bundle is a folder: drop it as-is. ZIPs from ditto work too. Files are recognised by their Mach-O magic, so extension-less binaries are found. Nothing is executed.

The sample is five harmless files from a fictional macOS infostealer: a dropper with its payload inside, a universal updater with risky entitlements, its helper dylib, an older unsigned build, and an app modified after signing. Each only prints a greeting.

100% client-side and static: parsed by WebAssembly in your browser, never uploaded.

How to get the files

Take the suspicious binaries off the Mac without running them, keeping their folders so each one stays attributed, then drop the files, the folder or a ZIP here. Copying never executes anything; double-clicking does.

  1. Copy the binaries — never open them
  2. Drop the files, a folder, an .app or a ZIP here
  3. Analysed in your browser, never uploaded

Already have the file? Drag it straight onto this page: it is read, never executed.

To sweep a live Mac, paste this into Terminal. It copies every Mach-O file changed in the last 14 days under the user, library and temporary folders, keeping their paths and extended attributes (where a file was downloaded from is evidence). Adjust the roots and the number of days to your case.

zsh · admin password
DST="$HOME/triage/macho"
sudo find /Users /Library /private/tmp /private/var/tmp /Applications \
  -xdev -type f -mtime -14 -size -200M \( -perm -u+x -o -name '*.dylib' \) 2>/dev/null |
while IFS= read -r f; do
  file -b "$f" | grep -q 'Mach-O' || continue
  mkdir -p "$DST$(dirname "$f")" && cp -p "$f" "$DST$f"
done

Result: ~/triage/macho/Users/…, ~/triage/macho/Library/… Drop that folder here (drag it, or use Choose a folder).

Analysing on another machine? Pack it into one ZIP; ditto keeps the extended attributes beside the files.

zsh
ditto -c -k --keepParent "$HOME/triage/macho" "$HOME/triage/macho.zip"

Gotchas

  • XProtect or an EDR may delete known samples while you copy them: work from a read-only image, or exclude the destination folder.
  • .pkg installers and .dmg images are containers: expand with pkgutil --expand-full or mount read-only, then drop what is inside.
  • Apps from the App Store are FairPlay-encrypted: their code cannot be read statically.
  • ZIPs protected with a password other than infected / malware / virus can't be opened in the browser: extract them first.
  • Files over 512 MB are skipped: the browser reads each file whole into memory.

What is a Mach-O file?

Mach-O (Mach object) is the file format of programs on macOS, iOS and Apple's other systems: executables, dynamic libraries (.dylib), plug-in bundles, kernel extensions and the code inside every .app. It starts with a header — magic number 0xFEEDFACF for 64-bit — followed by load commands, a table of contents that tells the loader where the segments are, which libraries to link, where execution starts and where the code signature sits. A universal (fat) binary, magic 0xCAFEBABE, packs one Mach-O per CPU architecture into a single file.

Static analysis reads that structure without running anything: what the file links and imports, who signed it and whether the signature still holds, what it is entitled to do, and what its strings give away. It is the first, safe step of macOS malware triage.

What this tool reads

  • Universal binaries and every slice; the mach_header and its flags; every load command, walked by cmd and cmdsize.
  • Segments and sections with their protections and entropy; the entry point (LC_MAIN or LC_UNIXTHREAD) and where it lands; UUID, platform, minimum OS, SDK and the toolchain that built it (clang, swiftc, ld).
  • Linked libraries with their versions, weak and re-exported dylibs, @rpath search paths and dyld environment; imports grouped by library (chained fixups or two-level namespace), exports from the export trie, the symbol table and the symhash.
  • The code signature, re-verified offline: every code page re-hashed against its CodeDirectory, the signed blobs against their special slots, and the CMS signature (message digest, CDHashes and RSA signature) — with signer, authority chain, Team ID, secure timestamp, cdhashes, hardened runtime and the designated requirement decompiled.
  • Entitlements (XML and DER) with the risky ones flagged, the embedded Info.plist, Objective-C classes; Swift, Go, Rust, Electron, PyInstaller and Platypus detection; UPX packing and FairPlay encryption.
  • Strings (ASCII/UTF-8 and UTF-16) with macOS categories — launchd persistence, keychain and browser-credential theft, wallets, Gatekeeper and TCC tampering, shell commands, URLs — and MD5 / SHA-1 / SHA-256 / TLSH.
  • Mach-O files hidden inside a Mach-O (a dropper's next stage) are extracted and analysed as child files.
  • YARA with the macho, hash, math and string modules; MITRE ATT&CK for macOS with evidence, exportable as a Navigator layer; IOCs (URLs, IPs, paths, Team IDs, cdhashes, hashes) as CSV, MISP or STIX 2.1; a hex view tied to the structure.
  • Disassembly of arm64 / arm64e, x86_64 and i386 slices, with calls through stubs and the GOT named after their import, Objective-C sends after their selector, and string, CFString and class references resolved; code analysis walks every function against macOS capability rules (ptrace PT_DENY_ATTACH, sysctl P_TRACED, raw syscalls, shell and AppleScript execution, keychain, screen and keyboard capture, XOR loops, crypto constants…) and recovers strings built on the stack.

Why it matters in an investigation

  • A signature says who vouched for a file. An ad-hoc, linker-only or modified signature, or a certificate Apple did not issue, means nobody did.
  • Entitlements such as get-task-allow or disable-library-validation, and weak @rpath libraries, are how code gets injected into another process.
  • Imports and strings reveal capabilities: LaunchAgents for persistence, keychain and browser databases for credential theft, osascript password prompts, curl | sh downloaders.
  • Team IDs and cdhashes are what block lists (Santa, MDM, XProtect) key on; symhash and TLSH group variants of the same tool.

Limitations

  • Static only: packed (UPX) or encrypted (FairPlay) code is reported, not unpacked or decrypted.
  • Certificate chains are not validated against Apple's trust store, and revocation and notarization are not checked: the tool checks integrity, not trust.
  • Resources sealed by a bundle's signature (CodeResources) and the bundle's own Info.plist are not checked when only the binary is dropped.
  • The code analysis decodes, it does not emulate: strings decrypted at run time stay hidden, and very large binaries are analysed up to an instruction budget (the listing itself covers everything).
  • Heuristics point, they don't prove: well-known apps trip some of them too.

Collecting samples safely

  • Pivot from persistence — LaunchAgents, LaunchDaemons and login items (sfltool dumpbtm on macOS 13+) — to the exact binaries they start.
  • Copy binaries without running them: cp -p and ditto keep the quarantine attribute, which records where a file came from; zip a whole .app with ditto -c -k --keepParent.
  • Work from a read-only disk image when XProtect or an EDR might delete the samples while you copy them.

FAQ

Is the file uploaded or executed?

No. The file is read by WebAssembly inside your browser tab and never leaves your machine; nothing in it is executed, mapped or emulated. A hash only leaves the browser if you click one of the VirusTotal, MalwareBazaar, Hybrid Analysis or Triage links.

Can it tell me if a Mach-O is malware?

Not on its own. It shows what the file is, who signed it, whether it was tampered with, what it looks able to do and what it contains, with a plain-language explanation and a level for each indicator. That is the evidence a verdict is built on, together with where the file was found and what it did.

Does it verify code signatures like macOS does?

It re-checks integrity the same way codesign --verify does: every code page against the CodeDirectory, the signed entitlements and requirements against their slots, and the CMS signature against the CodeDirectory. It does not decide trust: the chain is not validated against Apple's roots, and revocation and notarization are not checked online.

What is a universal (fat) binary?

One file holding several Mach-O slices, one per CPU type — typically x86_64 and arm64. The tool analyses every slice and the detail view switches between them: each slice is signed on its own and can differ, which is itself worth checking.

What are symhash and cdhash?

symhash is the MD5 of a Mach-O's imported symbol names, sorted: variants of the same tool usually share it, and VirusTotal shows it. The cdhash is the hash of the code signature's CodeDirectory — the identity macOS, Santa and MDM block lists use for a signed binary.

Can I run YARA rules on the files?

Yes. Paste rules or load .yar files: they run in your browser with the boreal engine, on every loaded file including extracted children, with the macho, hash, math and string modules. Matches open in the hex view, and a rule can be drafted from a file's indicators or from bytes selected in the hex view.

Can it disassemble the code?

Yes, for arm64 / arm64e, x86_64 and i386 slices: the Code tab lists the instructions from the entry point, any export, symbol or Objective-C method, or an address, with imports, selectors and strings resolved, and Code analysis matches every function against capability rules mapped to ATT&CK. Both decode only: nothing is executed or emulated.

How is this different from otool, codesign or MachOView?

It reads the same structures as otool -l, otool -tV and codesign -dvvv and checks the signature the way codesign --verify does, but needs no Mac: it runs in any browser, takes a whole batch or an .app at once, explains what it finds in plain language, and exports IOCs, YARA drafts and ATT&CK layers.