Binary Tailor

Install

Build from a hive checkout next to macho-memload:

dub build --compiler=ldc2 --root $CODE_ROOT/github.com/dev-centr/binary-tailor

One download, then tailor

  1. CI produces native slices (skill polyglot-ci) and binary-tailor pack -o app.bin windows-x64=…​ linux-x64=…​ macos-arm64=…​

  2. The Download page links one app.bin.

  3. On the user’s machine (or at the CDN):

binary-tailor inspect app.bin
binary-tailor tailor app.bin -o app --target linux-x64

Windows:

binary-tailor tailor app.bin -o app.exe --target windows-x64

--target defaults to the host. macOS x64 is refused (Apple Silicon only in this matrix).

APE files

If the input is Cosmopolitan APE (MZqFpD=' …):

binary-tailor assimilate hello.com --target linux-x64 -o hello

That rewrites the start of the file from the embedded printf ELF octals (or Mach-O dd window), same idea as Cosmo assimilate.

Mach-O in memory

binary-tailor memload payload.dylib

Maps via macho-memload. Does not exec the image.