72 lines
2.3 KiB
C++
72 lines
2.3 KiB
C++
#ifndef ELFDATA_H
|
|
#define ELFDATA_H
|
|
|
|
#include <QList>
|
|
#include <QStandardItem>
|
|
#include "data.h"
|
|
|
|
enum Architecture{
|
|
ARCH_ELF32,
|
|
ARCH_ELF64
|
|
};
|
|
|
|
class ElfData {
|
|
public:
|
|
ElfData();
|
|
~ElfData();
|
|
void setArchitecture(int); // Passing enum Architecture
|
|
void setIdentification(struct elfIdent *);
|
|
void setHeader(struct elfHdr *);
|
|
void setProgramHeader(struct elfProgram *);
|
|
void setSectionHeader(struct elfSection *);
|
|
void setSymbol(struct elfSymbol *);
|
|
void setDynSymbols(struct elfSymbol *);
|
|
void setHash(struct elfHash *);
|
|
void setTextSymbol(struct elfSymbol *);
|
|
void setSizeofElf_Ehdr(size_t);
|
|
void setSizeofElf_Phdr(size_t);
|
|
void setSizeofElf_Shdr(size_t);
|
|
|
|
int getArchitecture();
|
|
struct elfIdent *getIdentification();
|
|
struct elfHdr *getHeader();
|
|
QList<struct elfProgram *> *getProgramHeaders();
|
|
QList<struct elfSection *> *getSectionHeaders();
|
|
QList<struct elfSymbol *> *getSymbols();
|
|
QList<struct elfSymbol *> *getDynSymbols();
|
|
QList<struct elfHash *> *getHashes();
|
|
QList<struct elfSymbol *> *getTextSymbols();
|
|
size_t getSizeofElf_Ehdr();
|
|
size_t getSizeofElf_Phdr();
|
|
size_t getSizeofElf_Shdr();
|
|
|
|
QString mapProgramType(int);
|
|
QString mapSectionType(int);
|
|
QString mapArchitecture(int);
|
|
QString mapEndianess(int);
|
|
QString mapABI(int);
|
|
QString mapTypeElf(int);
|
|
QString mapMachineType(int);
|
|
QString mapSymbolType(int);
|
|
|
|
void addToHash(QByteArray, struct elfObjectDisas *);
|
|
QHash<QByteArray, QList<struct elfObjectDisas *> *> getDisasCode();
|
|
|
|
private:
|
|
int m_architecture;
|
|
size_t m_sizeofElf_Ehdr;
|
|
size_t m_sizeofElf_Phdr;
|
|
size_t m_sizeofElf_Shdr;
|
|
struct elfIdent *m_sElfId;
|
|
struct elfHdr *m_sElfHdr;
|
|
QList<struct elfProgram *> *m_listProgs;
|
|
QList<struct elfSection *> *m_listSections;
|
|
QList<struct elfSymbol *> *m_listSymbols;
|
|
QList<struct elfSymbol *> *m_listDynSymbols;
|
|
QList<struct elfSymbol *> *m_listTextSymbols;
|
|
QList<struct elfHash *> *m_listHashes;
|
|
QHash<QByteArray, QList<struct elfObjectDisas *> *> m_hash;
|
|
};
|
|
|
|
#endif // ELFDATA_H
|