D BetterC library that maps a Mach-O image from a byte buffer (APE zip payload, fat slice, or file) without writing a .dylib to disk.
macOS has no fexecve. Running an embedded Mach-O either drops a file or implements a loader. This is the loader.
Experimental. Classic LC_DYLD_INFO rebase/bind is implemented. Chained fixups, library interposing, and Apple code-signing gates are not.
import macho_memload;
memload_image img;
auto err = memload_map(bytes.ptr, bytes.length, &img);
if (err != MEMLOAD_OK)
return err;
// img.entry is the Mach-O entry; img.base is the slide-adjusted mapping
memload_unmap(&img);C callers link the library and use the same memload_* names.