summaryrefslogtreecommitdiff
path: root/include/libelfu
diff options
context:
space:
mode:
Diffstat (limited to 'include/libelfu')
-rw-r--r--include/libelfu/libelfu.h1
-rw-r--r--include/libelfu/model.h50
2 files changed, 51 insertions, 0 deletions
diff --git a/include/libelfu/libelfu.h b/include/libelfu/libelfu.h
index 1c40541..28a1e9a 100644
--- a/include/libelfu/libelfu.h
+++ b/include/libelfu/libelfu.h
@@ -6,6 +6,7 @@
#include <libelfu/analysis.h>
#include <libelfu/lookup.h>
+#include <libelfu/model.h>
#endif
diff --git a/include/libelfu/model.h b/include/libelfu/model.h
new file mode 100644
index 0000000..05f31ca
--- /dev/null
+++ b/include/libelfu/model.h
@@ -0,0 +1,50 @@
+#ifndef __LIBELFU_MODEL_H__
+#define __LIBELFU_MODEL_H__
+
+#include <sys/queue.h>
+
+#include <elf.h>
+#include <gelf.h>
+
+
+typedef struct ElfuData {
+ Elf_Data data;
+
+ CIRCLEQ_ENTRY(ElfuData) elem;
+} ElfuData;
+
+
+typedef struct ElfuScn {
+ GElf_Shdr shdr;
+
+ CIRCLEQ_HEAD(DataList, ElfuData) dataList;
+
+ CIRCLEQ_ENTRY(ElfuScn) elem;
+} ElfuScn;
+
+
+typedef struct ElfuPhdr {
+ GElf_Phdr phdr;
+
+ CIRCLEQ_ENTRY(ElfuPhdr) elem;
+} ElfuPhdr;
+
+
+typedef struct {
+ int elfclass;
+ GElf_Ehdr ehdr;
+
+ CIRCLEQ_HEAD(ScnList, ElfuScn) scnList;
+ CIRCLEQ_HEAD(PhdrList, ElfuPhdr) phdrList;
+
+ ElfuPhdr *entryBase;
+ GElf_Addr *entryOffs;
+} ElfuElf;
+
+
+
+ElfuPhdr* elfu_modelFromPhdr(GElf_Phdr *phdr);
+ElfuScn* elfu_modelFromSection(Elf_Scn *scn);
+ElfuElf* elfu_modelFromElf(Elf *e);
+
+#endif