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
/* ... */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <target/image.h>
struct advanced_elf_image
{
struct fileio *fileio;
Elf32_Ehdr header;
Elf32_Shdr *sections;
int num_sections;
char *strtab;
int strtab_size;
Elf32_Sym *symbols;
int num_symbols;
...};
int advanced_elf_image_open(struct advanced_elf_image *image, const char *URL);
void advanced_elf_image_close(struct advanced_elf_image *image);
uint32_t advanced_elf_image_find_symbol(struct advanced_elf_image *image, const char *symbol_name);
int advanced_elf_image_read_section(struct advanced_elf_image *image, int section, void *buf, size_t buf_size, size_t *done);