diff --git a/CHANGELOG.md b/CHANGELOG.md index 8476e8086..959a8b924 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,11 +114,13 @@ The table below shows which release corresponds to each branch, and what date th ## 4.14.1 (`stable`) +- [#2451][2451] Show symbols defined to value 0 (start of file) - [#2533][2533] Fix installation on Python 3.5 and lower - [#2518][2518] fix: update apport coredump path handling for CorefileFinder - [#2559][2559] Fix parsing corefile with missing auxv - [#2565][2565] Exclude broken Unicorn +[2451]: https://github.com/Gallopsled/pwntools/pull/2451 [2533]: https://github.com/Gallopsled/pwntools/pull/2533 [2518]: https://github.com/Gallopsled/pwntools/pull/2518 [2559]: https://github.com/Gallopsled/pwntools/pull/2559 diff --git a/pwnlib/elf/elf.py b/pwnlib/elf/elf.py index acb0a2d7a..02cfbb441 100644 --- a/pwnlib/elf/elf.py +++ b/pwnlib/elf/elf.py @@ -908,10 +908,9 @@ def _populate_symbols(self): continue for symbol in _iter_symbols(section): - value = symbol.entry.st_value - if not value: + if not symbol.name or symbol.entry.st_shndx == 'SHN_UNDEF': continue - self.symbols[symbol.name] = value + self.symbols[symbol.name] = symbol.entry.st_value def _populate_synthetic_symbols(self): """Adds symbols from the GOT and PLT to the symbols dictionary. diff --git a/pwnlib/rop/rop.py b/pwnlib/rop/rop.py index 4505962d7..84d8bcdae 100644 --- a/pwnlib/rop/rop.py +++ b/pwnlib/rop/rop.py @@ -841,7 +841,7 @@ def describe(self, object): """ if isinstance(object, enums): return str(object) - if isinstance(object, six.integer_types): + if isinstance(object, six.integer_types) and object: return self.unresolve(object) if isinstance(object, (bytes, six.text_type)): return repr(object)