Header-only C++ library for reading and generating ELF files
Header-only C++ library for reading and generating ELF files
elfio$ g++ -I/usr/local/include myprogram.cpp -o myprogram$ 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$ 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