elfio

Header-only C++ library for reading and generating ELF files

brewmacoslinux
Try with needOr install directly
Source

About

Header-only C++ library for reading and generating ELF files

Commands

elfio

Examples

Include ELFIO headers in a C++ project to parse ELF binaries$ g++ -I/usr/local/include myprogram.cpp -o myprogram
Read and analyze sections from an ELF binary using ELFIO library$ cat > analyze.cpp << 'EOF' #include <elfio/elfio.hpp> int main() { ELFIO::elfio reader; reader.load("/bin/ls"); return 0; } EOF g++ -I/usr/local/include analyze.cpp -o analyze && ./analyze
Generate a new ELF file with custom sections using ELFIO$ cat > create.cpp << 'EOF' #include <elfio/elfio.hpp> int main() { ELFIO::elfio writer; writer.create(ELFIO::ELFCLASS32, ELFIO::ELFDATA2LSB); writer.save("output.elf"); } EOF g++ -I/usr/local/include create.cpp -o create && ./create