Skip to content

Commit

Permalink
Elf reader fix
Browse files Browse the repository at this point in the history
  • Loading branch information
djphoenix committed Nov 18, 2016
1 parent fbc7edb commit 5197e2c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/readelf/readelf.cpp
Expand Up @@ -116,6 +116,7 @@ size_t readelf(Process *process, Stream *stream) {
size = sect->offset + sect->size;
// Skip null sections
if (sect->type == SHT_NULL) continue;
if ((sect->flags & SHF_ALLOC) == 0) continue;
// Skip SYMTAB sections
if (sect->type == SHT_SYMTAB) continue;
// Skip empty sections
Expand Down Expand Up @@ -165,6 +166,8 @@ size_t readelf(Process *process, Stream *stream) {
ELF64SECT *symsect = sections + sym->shndx;
// Skip undefined symbols
if (symsect->type == SHT_NULL) continue;
// Skip non-existing sections
if (sym->shndx >= elf->shnum) continue;
// Find vaddr of symbol section
uintptr_t symbase = sectmap[sym->shndx];
// Skip non-allocated symbols
Expand Down

0 comments on commit 5197e2c

Please sign in to comment.