Skip to content

Commit

Permalink
add .plt.sec to search section
Browse files Browse the repository at this point in the history
  • Loading branch information
shift-crops committed Jun 11, 2020
1 parent f1628b8 commit b93bc2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pwnlib/elf/elf.py
Expand Up @@ -1026,17 +1026,18 @@ 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
inv_symbols = {v:k for k,v in self.got.items()}
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

Expand Down

0 comments on commit b93bc2d

Please sign in to comment.