textual
[RRG-proxmark3.git] / client / src / elf.h
blob50533224fc5ce165abb571c8ee2b6cbf7c139c71
1 //-----------------------------------------------------------------------------
2 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
3 // at your option, any later version. See the LICENSE.txt file for the text of
4 // the license.
5 //-----------------------------------------------------------------------------
6 // ELF header
7 //-----------------------------------------------------------------------------
9 #ifndef __ELF_H__
10 #define __ELF_H__
12 #include "common.h"
14 typedef struct {
15 uint32_t p_type;
16 uint32_t p_offset;
17 uint32_t p_vaddr;
18 uint32_t p_paddr;
19 uint32_t p_filesz;
20 uint32_t p_memsz;
21 uint32_t p_flags;
22 uint32_t p_align;
23 } PACKED Elf32_Phdr;
25 #define EI_NIDENT 16
27 typedef struct {
28 unsigned char e_ident[EI_NIDENT];
29 uint16_t e_type;
30 uint16_t e_machine;
31 uint32_t e_version;
32 uint32_t e_entry;
33 uint32_t e_phoff;
34 uint32_t e_shoff;
35 uint32_t e_flags;
36 uint16_t e_ehsize;
37 uint16_t e_phentsize;
38 uint16_t e_phnum;
39 uint16_t e_shentsize;
40 uint16_t e_shnum;
41 uint16_t e_shtrndx;
42 } PACKED Elf32_Ehdr;
44 #define PT_NULL 0
45 #define PT_LOAD 1
46 #define PT_DYNAMIC 2
47 #define PT_INTERP 3
48 #define PT_NOTE 4
49 #define PT_SHLIB 5
50 #define PT_PHDR 6
52 #define ELFCLASS32 1
53 #define ELFCLASS64 2
55 #define ELFDATA2LSB 1
56 #define ELFDATA2MSB 2
58 #define EV_CURRENT 1
60 #define ET_NONE 0
61 #define ET_REL 1
62 #define ET_EXEC 2
63 #define ET_DYN 3
64 #define ET_CORE 4
66 #define EM_ARM 0x28
68 #define PF_R 4
69 #define PF_W 2
70 #define PF_X 1
72 #endif