I am messing around with Mach-O Headers and dyld and came across this function _dyld_get_image_header that returns a pointer to the mach header of a dynamic library
_dyld_get_image_header