version 1.8, 2017/09/23 12:25:39 |
version 1.9, 2017/10/05 02:59:39 |
|
|
/* elf.c */ |
/* elf.c */ |
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 *, const char *, size_t, |
ssize_t elf_getsymtab(const char *, size_t filesize, const char *, |
const Elf_Sym **, size_t *); |
size_t, const Elf_Sym **, size_t *); |
ssize_t elf_getsection(char *, 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 *); |
|
|
char *decompress(const char *, size_t, off_t); |
char *decompress(const char *, size_t, off_t); |
|
|
return 1; |
return 1; |
|
|
/* Find symbol table location and number of symbols. */ |
/* Find symbol table location and number of symbols. */ |
if (elf_getsymtab(p, shstab, shstabsz, &symtab, &nsymb) == -1) |
if (elf_getsymtab(p, filesize, shstab, shstabsz, &symtab, &nsymb) == -1) |
warnx("symbol table not found"); |
warnx("symbol table not found"); |
|
|
/* Find string table location and size. */ |
/* Find string table location and size. */ |
if (elf_getsection(p, ELF_STRTAB, shstab, shstabsz, &strtab, |
if (elf_getsection(p, filesize, ELF_STRTAB, shstab, shstabsz, &strtab, |
&strtabsz) == -1) |
&strtabsz) == -1) |
warnx("string table not found"); |
warnx("string table not found"); |
|
|