Skip to content

Commit

Permalink
Apply #1391 with additional doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
Arusekk committed Dec 13, 2019
1 parent c578d56 commit 76de930
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pwnlib/tubes/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,7 @@ def libs(self):
return pwnlib.elf.elf.ELF(self.executable).maps

# Enumerate all of the libraries actually loaded right now.
maps = {}
for line in maps_raw.splitlines():
if '/' not in line: continue
path = line[line.index('/'):]
Expand All @@ -881,6 +882,13 @@ def libc(self):
Returns an ELF for the libc for the current process.
If possible, it is adjusted to the correct address
automatically.
Example:
>>> p = process("/bin/cat")
>>> p.libc # doctest: +ELLIPSIS
ELF('/lib64/libc-...so')
>>> p.close()
"""
from pwnlib.elf import ELF

Expand Down

0 comments on commit 76de930

Please sign in to comment.