#ifndef PROGRAM_H #define PROGRAM_H #include #include #include #include #include #include #include "memory.h" class ProgramLoader { public: ProgramLoader(const char *file); ProgramLoader(QString file); ~ProgramLoader(); void to_memory(Memory *mem); // Writes all loaded sections to memory std::uint32_t end(); // Return address after which there is no more code for sure private: int fd; Elf *elf; GElf_Ehdr hdr; // elf file header size_t n_secs; // number of sections in elf program header Elf32_Phdr *phdrs; // program section headers QVector map; // external index to phdrs index }; #endif // PROGRAM_H