4 ms·
Ctf_import: a small library that runs basic functions from stripped binaries
- _nalply 10y agoThis 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 10y agoI 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 10y agoYeah, 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.