diff --git a/pwnlib/elf/elf.py b/pwnlib/elf/elf.py index 5ac219299..a4beb657d 100644 --- a/pwnlib/elf/elf.py +++ b/pwnlib/elf/elf.py @@ -51,12 +51,17 @@ from elftools.elf.constants import SHN_INDICES from elftools.elf.descriptions import describe_e_type from elftools.elf.elffile import ELFFile -from elftools.elf.enums import ENUM_P_TYPE from elftools.elf.gnuversions import GNUVerDefSection from elftools.elf.relocation import RelocationSection from elftools.elf.sections import SymbolTableSection from elftools.elf.segments import InterpSegment +# See https://github.com/Gallopsled/pwntools/issues/1189 +try: + from elftools.elf.enums import ENUM_P_TYPE +except ImportError: + from elftools.elf.enums import ENUM_P_TYPE_BASE as ENUM_P_TYPE + import intervaltree from pwnlib import adb @@ -1767,4 +1772,3 @@ def disable_nx(self): return log.error("Could not find PT_GNU_STACK, stack should already be executable") -