File tree Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Expand file tree Collapse file tree 1 file changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -1322,33 +1322,24 @@ def libs(self):
1322
1322
by the process to the address it is loaded at in the process' address
1323
1323
space.
1324
1324
"""
1325
- from pwnlib .util .proc import memory_maps
1326
- maps_raw = self .poll () is not None and memory_maps (self .pid )
1325
+ maps = self .poll () is None and self .maps ()
1327
1326
1328
- if not maps_raw :
1327
+ if not maps :
1329
1328
import pwnlib .elf .elf
1330
1329
1331
1330
with context .quiet :
1332
1331
return pwnlib .elf .elf .ELF (self .executable ).maps
1333
1332
1334
1333
# Enumerate all of the libraries actually loaded right now.
1335
- maps = {}
1336
- for mapping in maps_raw :
1334
+ libs = {}
1335
+ for mapping in maps :
1337
1336
path = mapping .path
1338
1337
if os .sep not in path : continue
1339
1338
path = os .path .realpath (path )
1340
- if path not in maps :
1341
- maps [path ]= 0
1342
-
1343
- for lib in maps :
1344
- path = os .path .realpath (lib )
1345
- for mapping in maps_raw :
1346
- if mapping .path == path :
1347
- address = mapping .addr .split ('-' )[0 ]
1348
- maps [lib ] = int (address , 16 )
1349
- break
1339
+ if path not in libs :
1340
+ libs [path ] = mapping .addr
1350
1341
1351
- return maps
1342
+ return libs
1352
1343
1353
1344
@property
1354
1345
def libc (self ):
You can’t perform that action at this time.
0 commit comments