Skip to content

Commit f6f278b

Browse files
committed
fix build fail
1 parent 79f8bb9 commit f6f278b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pwnlib/tubes/process.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@ def __on_enoexec(self, exception):
476476
binfmt helpers installed for QEMU.
477477
"""
478478
# Get the ELF binary for the target executable
479-
binary = pwnlib.elf.ELF(self.executable)
479+
from pwnlib.elf import ELF
480+
binary = ELF(self.executable)
480481

481482
# If we're on macOS, this will never work. Bail now.
482483
# if platform.mac_ver()[0]:
@@ -1330,10 +1331,8 @@ def libs(self):
13301331
maps_raw = self.poll() is not None and memory_maps(self.pid)
13311332

13321333
if not maps_raw:
1333-
import pwnlib.elf.elf
1334-
1335-
with context.quiet:
1336-
return pwnlib.elf.elf.ELF(self.executable).maps
1334+
from pwnlib.elf import ELF
1335+
return ELF(self.executable, checksec=False).maps
13371336

13381337
# Enumerate all of the libraries actually loaded right now.
13391338
maps = {}
@@ -1385,7 +1384,8 @@ def elf(self):
13851384
13861385
Returns an ELF file for the executable that launched the process.
13871386
"""
1388-
return pwnlib.elf.ELF(self.executable)
1387+
from pwnlib.elf import ELF
1388+
return ELF(self.executable)
13891389

13901390
@property
13911391
def corefile(self):

pwnlib/tubes/ssh.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,14 @@ def elf(self):
360360
361361
Returns an ELF file for the executable that launched the process.
362362
"""
363-
import pwnlib.elf.elf
363+
from pwnlib.elf import ELF
364364

365365
libs = self.parent.libs(self.executable)
366366

367367
for lib in libs:
368368
# Cannot just check "executable in lib", see issue #1047
369369
if lib.endswith(self.executable):
370-
return pwnlib.elf.elf.ELF(lib)
370+
return ELF(lib, checksec=True)
371371

372372

373373
@property

0 commit comments

Comments
 (0)