Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors License

macho-memload

In-memory Mach-O loader for polyglot payloads.
Explore the docs »

macho-memload

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.

Usage

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.

Build

dub build --compiler=ldc2
dub run --config=test-betterc --compiler=ldc2

Changelog

See CHANGELOG.adoc.

License

MIT

About

In-memory Mach-O / dyld loader (D BetterC) for polyglot and APE payloads

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages