Playground project to learn more about the Mach-O file format.
swift run macho-reader <path-to-binary>
You should see a similar output:
Mach-O implementation details can be in Xcode's folder. In my case this is the path:
/Applications/Xcode-System.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
These are some useful relative paths:
/usr/include/mach-o/loader.h
/usr/include/mach/vm_prot.h