.mach File Extension
.mach file is, how to inspect Mach-O binaries safely, what Poly supports, and why most Mach-O files use other names. File extension details for .mach
Storage Only| File type | Mach-O binary |
|---|---|
| MIME type | |
| Encoding | Binary Mach-O object or fat container |
| Operating systems | macOS, Linux, Windows |
| Opens with | Apple otool, LLVM llvm-objdump, Ghidra |
| Poly support | Yes. Poly stores, syncs, shares, versions, and downloads .mach files. |
| Indexed by Poly | Name only. Poly indexes the filename and ordinary file properties. |
| Preview in Poly | No. Download the file and inspect it with a trusted static-analysis tool. |
| Poly agent | No. The Poly agent cannot read the binary's contents. |
What kind of file is a .mach?
A .mach file is conventionally a Mach-O binary, the native executable and object format used on Apple platforms. It may contain an executable, relocatable object, dynamic library, loadable bundle, debug data, or another loader-defined file type.1
The suffix is uncommon. Most Mach-O executables have no extension, while object files often use .o and dynamic libraries use .dylib. A .mach name therefore provides a clue, not proof of the contents. Check the first four bytes:
| Signature | Likely content |
|---|---|
CE FA ED FE | Little-endian 32-bit Mach-O |
CF FA ED FE | Little-endian 64-bit Mach-O |
FE ED FA CE or FE ED FA CF | Byte-swapped Mach-O |
CA FE BA BE | Fat or universal binary, or possibly a Java class file |
Apple's headers define these magic values.23 Because CA FE BA BE is ambiguous, a tool must also validate the fields that follow it.
.mach file as executable content. Renaming it does not make it safe or convert it to another binary format.How do I open a .mach on my computer?
Do not double-click an unknown .mach file. Inspect it without running it:
- On macOS, use
file,otool -hv,otool -l, orcodesign --verify --verbosein Terminal. - On macOS, Linux, or Windows, use LLVM's
llvm-objdump --macho --private-headersor a cross-platform reverse-engineering tool such as Ghidra. LLVM documents Mach-O-specific inspection options for headers, load commands, symbols, and disassembly.4
A binary runs only when its architecture, target Apple platform, minimum OS version, libraries, and signing requirements are compatible. Windows and Linux do not natively run macOS Mach-O executables.
Poly support for .mach
Poly stores, syncs, shares, versions, and downloads .mach files. They remain searchable by filename and ordinary file properties.
Poly does not preview or execute the binary, extract architectures or symbols, index embedded code, or send its contents to the Poly agent. If you want searchable analysis beside the original, save trusted otool or llvm-objdump output as a separate text file.
History of .mach
Mach-O grew from Carnegie Mellon University's Mach work and was refined for NeXT's operating system. NeXTSTEP used Mach object files in place of the older a.out format, and Apple later adopted Mach-O as the native executable format for Mac OS X and its descendants.5
The de facto MIME type application/x-mach-binary is not registered by IANA.6 Generic systems may instead label the data application/octet-stream. The .mach suffix is similarly a convenience rather than the standard naming convention for most Apple executables.
Working with .mach and alternatives
There is no general conversion from .mach to a Windows PE or Linux ELF executable. Rebuild from source for the target operating system and CPU instead. Use lipo or llvm-lipo to inspect or extract architecture slices, and otool, nm, or llvm-objdump to produce a text report.
Keep the signed original when provenance matters. Editing bytes, load commands, or architecture slices can invalidate its code signature. A disassembly can reveal machine instructions, but it cannot restore the original source names, comments, types, or build settings.
Footnotes
- Apple Open Source. mach-o/loader.h. ↩
- Apple Open Source. mach-o/loader.h constants. ↩
- Apple Open Source. mach-o/fat.h. ↩
- LLVM Project. llvm-objdump: LLVM's Object File Dumper. ↩
- NeXT Computer. Mach Object Files. See also Apple, Overview of the Mach-O Executable Format. ↩
- Internet Assigned Numbers Authority. Media Types Registry. The application registry has no
application/x-mach-binaryentry. ↩