-
Notifications
You must be signed in to change notification settings - Fork 2
/
elfsym.h
40 lines (32 loc) · 1.08 KB
/
elfsym.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
/*
* itrace
*
* ELF symbols specific routines header
*
*/
#ifndef ITRACE_ELFSYM_H
#define ITRACE_ELFSYM_H
#include <elf.h>
#include <link.h>
#define MAX_SYM_NAME 50
typedef struct {
char name[MAX_SYM_NAME]; /* Symbol name */
uintptr_t rel_addr; /* Relocation addr */
} elfsym_sym;
typedef struct {
int class; /* File's class (1=32 bit or 2=64b) */
int pie; /* Indicates if the program is a PIE */
uintptr_t baddr; /* Executable base addres */
uintptr_t phaddr; /* Program header address */
uintptr_t symtab; /* Dynamic symbol table */
uintptr_t strtab; /* Dynamic string table */
size_t phnum; /* Number of program headers */
size_t phentsize; /* Program header entry size */
size_t nsyms; /* Number of symbols */
elfsym_sym *syms; /* Symbols */
} elfsym_info;
int elfsym_startup(uintptr_t);
void elfsym_shutdown();
const elfsym_sym* elfsym_resolv();
extern elfsym_info e_info;
#endif /* ITRACE_ELFSYM_H */