
Ctf_import: a small library that runs basic functions from stripped binaries - scienceman
https://github.com/docileninja/ctf_import
======
_nalply
This mmaps (with PROT_EXEC) the file then returns an offset void pointer from
the mmap. You then cast the pointer to a function pointer.

~~~
mmastrac
I wonder if this would even be possible to do with non-relocatable code. You'd
probably have to use a child process that was smart about where it was
executing in memory, then manually load the various code and data segments.
Could be an interesting project.

~~~
andreiw
Yeah, I think something like dlopen/dlsym, but stand-alone, and supporting
ELF/PE32+/Mach-O binaries (both objects and binaries, shared objects, PIC and
non-PIE) on any OS/architecture could be very useful. Even foreign support
(i.e. load x86 obj on MIPS), as it could be used by emulation engines.

