version 1.18, 2017/11/03 12:53:38 |
version 1.19, 2017/11/06 14:59:27 |
|
|
int iself(const char *, size_t); |
int iself(const char *, size_t); |
int elf_getshstab(const char *, size_t, const char **, size_t *); |
int elf_getshstab(const char *, size_t, const char **, size_t *); |
ssize_t elf_getsymtab(const char *, size_t filesize, const char *, |
ssize_t elf_getsymtab(const char *, size_t filesize, const char *, |
size_t, const Elf_Sym **, size_t *); |
size_t, const Elf_Sym **, size_t *, const char **, |
|
size_t *); |
ssize_t elf_getsection(char *, size_t, const char *, const char *, |
ssize_t elf_getsection(char *, size_t, const char *, const char *, |
size_t, const char **, size_t *); |
size_t, const char **, size_t *); |
|
|
|
|
if (elf_getshstab(p, filesize, &shstab, &shstabsz)) |
if (elf_getshstab(p, filesize, &shstab, &shstabsz)) |
return 1; |
return 1; |
|
|
/* Find symbol table location and number of symbols. */ |
/* Find symbol table and associated string table. */ |
if (elf_getsymtab(p, filesize, shstab, shstabsz, &symtab, &nsymb) == -1) |
if (elf_getsymtab(p, filesize, shstab, shstabsz, &symtab, &nsymb, |
|
&strtab, &strtabsz) == -1) |
warnx("symbol table not found"); |
warnx("symbol table not found"); |
|
|
/* Find string table location and size. */ |
|
if (elf_getsection(p, filesize, ELF_STRTAB, shstab, shstabsz, &strtab, |
|
&strtabsz) == -1) |
|
warnx("string table not found"); |
|
|
|
/* Find CTF section and dump it. */ |
/* Find CTF section and dump it. */ |
for (i = 0; i < eh->e_shnum; i++) { |
for (i = 0; i < eh->e_shnum; i++) { |