Skip to content

Commit

Permalink
Don't cache loaded modules
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Nov 30, 2023
1 parent 33f559c commit 73de76f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pwnlib/tubes/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ def __init__(self, argv = None,
self.suid = self.uid = None
self.sgid = self.gid = None
internal_preexec_fn = None

self._libs = None
else:
# Determine which descriptors will be attached to a new PTY
handles = (stdin, stdout, stderr)
Expand Down Expand Up @@ -925,9 +923,7 @@ def libs(self):
if IS_WINDOWS:
if not self._check_initialized():
raise Exception("PEB not initialized while getting the loaded modules")
if not self._libs:
self._libs = {module.name.lower(): module.baseaddr for module in self.win_process.peb.modules if module.name}
return self._libs
return {module.name.lower(): module.baseaddr for module in self.win_process.peb.modules if module.name}

try:
maps_raw = open('/proc/%d/maps' % self.pid).read()
Expand Down

0 comments on commit 73de76f

Please sign in to comment.