-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelf_file.h
57 lines (43 loc) · 1.22 KB
/
elf_file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef __ELF_DATA_H__
#define __ELF_DATA_H__
#include "util.h"
#include "elf.h"
#include "stdlib.h"
#include "string.h"
#include "hashtable.h"
// Structure contenant la table des reimplémentations (avec addends)
typedef struct{
Elf32_Rela* rela_table;
size_t rela_table_size;
Elf32_Word rela_table_name;
Elf32_Off rela_table_offset;
}Elf32_RelaTable;
// Structure contenant la table des reimplémentations (sans addends)
typedef struct{
Elf32_Rel* rel_table;
size_t rel_table_size;
Elf32_Word rel_table_name;
Elf32_Off rel_table_offset;
}Elf32_RelTable;
// Structure contenant les données lues depuis un fichier ELF
typedef struct{
Elf32_Ehdr e_header;
Elf32_Shdr* shdr_table;
Elf32_Phdr* program_header_table;
uint8_t** sections_data;
uint16_t* progbits_sections;
size_t progbits_nbr;
char* str_table;
size_t str_table_size;
Elf32_Sym* symbol_table;
size_t symbol_table_size;
char* sm_str_table;
size_t sm_str_table_size;
Elf32_RelaTable* rela_tables;
size_t rela_tables_size;
Elf32_RelTable* rel_tables;
size_t rel_tables_size;
hash_t sections_table;
}Elf32_data;
char* get_name(Elf32_data* elf, size_t section_index);
#endif