A C library for reading and writing Improved Executable Format (IEF) files.
The project uses Meson and Ninja build systems.
meson setup build
meson compile -C buildTo install the library:
meson install -C buildTo build without tests:
meson setup build -Dtests=falseRun the internal test suite to verify library functionality:
meson test -C buildMinimal example of creating a 64-bit executable for x86_64:
#include <ief/ief.h>
#include <ief/writer.h>
#include <stdint.h>
int main(void) {
/* Initialize builder for 64-bit LE executable */
IEF_Builder *b = ief_builder_new(IEF_CLASS_64, IEF_ENDIAN_LE,
IEF_TYPE_EXEC, IEF_ARCH_X86_64);
ief_builder_set_entry(b, 0x401000);
ief_builder_set_image_base(b, 0x400000);
/* Code: xor rax, rax; ret */
uint8_t code[] = { 0x48, 0x31, 0xC0, 0xC3 };
ief_builder_add_section(b, ".text", IEF_SHT_CODE,
IEF_SHF_READ | IEF_SHF_EXEC | IEF_SHF_ALLOC,
code, sizeof(code), 0x401000, sizeof(code), 16);
/* Write to disk */
ief_builder_write(b, "example.ief");
ief_builder_free(b);
return 0;
}Comprehensive documentation of all structures, constants, and API functions is available in docs/api.md.
libief is distributed under the terms of the LGPL-3.0-or-later license.