From b93bc2d6689ba112a23098296a3dc6d2979cfdc8 Mon Sep 17 00:00:00 2001 From: Yutaro Shimizu Date: Fri, 12 Jun 2020 02:02:26 +0900 Subject: [PATCH] add .plt.sec to search section --- pwnlib/elf/elf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pwnlib/elf/elf.py b/pwnlib/elf/elf.py index 94c7682e1..290b2178c 100644 --- a/pwnlib/elf/elf.py +++ b/pwnlib/elf/elf.py @@ -1026,9 +1026,10 @@ def _populate_plt(self): # In particular, this is where EBX points when it points into the GOT. dt_pltgot = self.dynamic_value_by_tag('DT_PLTGOT') or 0 - # There are two PLTs we may need to search + # There are three PLTs we may need to search plt = self.get_section_by_name('.plt') # <-- Functions only plt_got = self.get_section_by_name('.plt.got') # <-- Functions used as data + plt_sec = self.get_section_by_name('.plt.sec') plt_mips = self.get_section_by_name('.MIPS.stubs') # Invert the GOT symbols we already have, so we can look up by address @@ -1036,7 +1037,7 @@ def _populate_plt(self): inv_symbols.update({v:k for k,v in self.symbols.items()}) with context.local(arch=self.arch, bits=self.bits, endian=self.endian): - for section in (plt, plt_got, plt_mips): + for section in (plt, plt_got, plt_sec, plt_mips): if not section: continue