python: upgrade nanobind 2.13.0 -> 3.0.1

This commit is contained in:
lief-integration-bot
2026-08-29 08:32:32 +02:00
parent 4c9c42c483
commit 3cc572c3bb
58 changed files with 457 additions and 309 deletions
+2 -2
View File
@@ -17,8 +17,8 @@ if (LIEF_EXTERNAL_NANOBIND)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
find_package(nanobind REQUIRED)
else()
set(NANOBIND_VERSION 2.13.0.r26.g6eeef765)
set(NANOBIND_SHA256 SHA256=43e5912518c889e206e3e01915d2fb5be0cd13f4d2afae2ae80941c1be4e3d7e)
set(NANOBIND_VERSION 3.0.1)
set(NANOBIND_SHA256 SHA256=20111f42e0608e4e518bbe6095bdf64ef74d1d21bad22cb6f2aa3aff013e4443)
set(NANOBIND_URL "${THIRD_PARTY_DIRECTORY}/nanobind-${NANOBIND_VERSION}.zip"
CACHE STRING "URL to the Nanobind")
FetchContent_Declare(nanobind
+1 -1
View File
@@ -2,7 +2,7 @@ from collections.abc import Sequence
import enum
import io
import os
from typing import Iterator, Optional, Union, overload
from typing import Optional, Union, overload
import lief
import lief.Android
-1
View File
@@ -1,5 +1,4 @@
import enum
from typing import Iterator, Optional, Union
class ANDROID_VERSIONS(enum.Enum):
+2 -1
View File
@@ -1,7 +1,8 @@
from collections.abc import Iterator
import enum
import io
import os
from typing import Final, Iterator, Optional, Union, overload
from typing import Final, Optional, Union, overload
import lief
import lief.PE
+4 -4
View File
@@ -2,7 +2,7 @@ from collections.abc import Sequence
import enum
import io
import os
from typing import Iterator, Optional, Union, overload
from typing import Optional, Union, overload
import lief
@@ -275,12 +275,12 @@ class Class(lief.Object):
@property
def methods(self) -> Class.it_methods: ...
def get_method(self, name: str) -> it_named_methods: ...
def get_method(self, name: str) -> Class.it_named_methods: ...
@property
def fields(self) -> Class.it_fields: ...
def get_field(self, name: str) -> it_named_fields: ...
def get_field(self, name: str) -> Class.it_named_fields: ...
@property
def access_flags(self) -> list[ACCESS_FLAGS]: ...
@@ -418,7 +418,7 @@ class Type(lief.Object):
def underlying_array_type(self) -> Type: ...
@staticmethod
def pretty_name(primitive: PRIMITIVES) -> str: ...
def pretty_name(primitive: Type.PRIMITIVES) -> str: ...
def __str__(self) -> str: ...
+213 -92
View File
@@ -1,14 +1,15 @@
from collections.abc import Iterable, Mapping, Sequence
import enum
import io
import os
from typing import Final, Iterator, Optional, Union, overload
from collections.abc import Iterable, Iterator, Mapping, Sequence
from typing import Final, Optional, Union, overload
import lief
def check_layout(binary: Binary) -> tuple[bool, str]: ...
class ARCH(enum.Enum):
@staticmethod
def from_value(arg: int, /) -> ARCH: ...
@@ -377,6 +378,7 @@ class ARCH(enum.Enum):
ALPHA_ALT = 36902
class ParserConfig:
def __init__(self) -> None: ...
@@ -410,21 +412,35 @@ class ParserConfig:
parse_overlay: bool
count_mtd: DYNSYM_COUNT
count_mtd: ParserConfig.DYNSYM_COUNT
page_size: int
all: Final[ParserConfig] = ...
@overload
def parse_from_memory(address: int, config: ParserConfig = ...) -> Optional[Binary]: ...
@overload
def parse_from_memory(address: int, size: int, config: ParserConfig = ...) -> Optional[Binary]: ...
def parse_from_memory(
address: int, size: int, config: ParserConfig = ...
) -> Optional[Binary]: ...
def parse_from_dump(obj: Union[str | io.IOBase | os.PathLike | bytes | list[int]], addr: int, config: ParserConfig = ...) -> Optional[Binary]: ...
def parse(obj: Union[str | io.IOBase | os.PathLike | bytes | list[int]], config: ParserConfig = ...) -> Optional[Binary]: ...
def parse_from_dump(
obj: Union[str | io.IOBase | os.PathLike | bytes | list[int]],
addr: int,
config: ParserConfig = ...,
) -> Optional[Binary]: ...
def parse(
obj: Union[str | io.IOBase | os.PathLike | bytes | list[int]],
config: ParserConfig = ...,
) -> Optional[Binary]: ...
class SymbolVersion(lief.Object):
@overload
@@ -456,6 +472,7 @@ class SymbolVersion(lief.Object):
def __str__(self) -> str: ...
class Binary(lief.Binary):
class it_notes:
def __getitem__(self, arg: int, /) -> Note: ...
@@ -587,10 +604,10 @@ class Binary(lief.Binary):
def type(self) -> Header.CLASS: ...
@property
def header(self) -> Header: ... # type: ignore
def header(self) -> Header: ... # type: ignore
@property
def sections(self) -> Binary.it_sections: ... # type: ignore
def sections(self) -> Binary.it_sections: ... # type: ignore
@property
def segments(self) -> Binary.it_segments: ...
@@ -602,7 +619,12 @@ class Binary(lief.Binary):
def add(self, arg: DynamicEntry, /) -> DynamicEntry: ...
@overload
def add(self, section: Section, loaded: bool = True, pos: SEC_INSERT_POS = SEC_INSERT_POS.AUTO) -> Section | None: ...
def add(
self,
section: Section,
loaded: bool = True,
pos: Binary.SEC_INSERT_POS = Binary.SEC_INSERT_POS.AUTO,
) -> Section | None: ...
@overload
def add(self, segment: Segment, base: int = 0) -> Segment | None: ...
@@ -617,7 +639,7 @@ class Binary(lief.Binary):
def dynamic_symbols(self) -> Binary.it_symbols: ...
@property
def symbols(self) -> Binary.it_dyn_symtab_symbols: ... # type: ignore
def symbols(self) -> Binary.it_dyn_symtab_symbols: ... # type: ignore
@property
def exported_symbols(self) -> Binary.it_filter_symbols: ...
@@ -632,7 +654,9 @@ class Binary(lief.Binary):
def add_pltgot_relocation(self, relocation: Relocation) -> Relocation: ...
def add_object_relocation(self, relocation: Relocation, section: Section) -> Relocation | None: ...
def add_object_relocation(
self, relocation: Relocation, section: Section
) -> Relocation | None: ...
@property
def pltgot_relocations(self) -> Binary.it_filter_relocation: ...
@@ -641,7 +665,7 @@ class Binary(lief.Binary):
def object_relocations(self) -> Binary.it_filter_relocation: ...
@property
def relocations(self) -> Binary.it_relocations: ... # type: ignore
def relocations(self) -> Binary.it_relocations: ... # type: ignore
@property
def symbols_version(self) -> Binary.it_symbols_version: ...
@@ -681,9 +705,13 @@ class Binary(lief.Binary):
interpreter: str
def section_from_offset(self, offset: int, skip_nobits: bool = True) -> Section | None: ...
def section_from_offset(
self, offset: int, skip_nobits: bool = True
) -> Section | None: ...
def section_from_virtual_address(self, address: int, skip_nobits: bool = True) -> Section | None: ...
def section_from_virtual_address(
self, address: int, skip_nobits: bool = True
) -> Section | None: ...
def segment_from_virtual_address(self, address: int) -> Segment | None: ...
@@ -741,11 +769,17 @@ class Binary(lief.Binary):
def add_symtab_symbol(self, symbol: Symbol) -> Symbol: ...
def add_dynamic_symbol(self, symbol: Symbol, symbol_version: SymbolVersion | None = None) -> Symbol: ...
def add_dynamic_symbol(
self, symbol: Symbol, symbol_version: SymbolVersion | None = None
) -> Symbol: ...
def virtual_address_to_offset(self, virtual_address: int) -> Union[int, lief.lief_errors]: ...
def virtual_address_to_offset(
self, virtual_address: int
) -> Union[int, lief.lief_errors]: ...
def replace(self, new_segment: Segment, original_segment: Segment, base: int = 0) -> Segment | None: ...
def replace(
self, new_segment: Segment, original_segment: Segment, base: int = 0
) -> Segment | None: ...
@overload
def extend(self, segment: Segment, size: int) -> Segment | None: ...
@@ -788,7 +822,9 @@ class Binary(lief.Binary):
def write(self, output: Union[str | os.PathLike]) -> None: ...
@overload
def write(self, output: Union[str | os.PathLike], config: Builder.config_t) -> None: ...
def write(
self, output: Union[str | os.PathLike], config: Builder.config_t
) -> None: ...
@overload
def write_to_bytes(self, config: Builder.config_t) -> bytes: ...
@@ -834,7 +870,7 @@ class Binary(lief.Binary):
@overload
def remove_dynamic_symbol(self, arg: str, /) -> None: ...
def add_exported_function(self, address: int, name: str = '') -> Symbol: ...
def add_exported_function(self, address: int, name: str = "") -> Symbol: ...
@overload
def export_symbol(self, symbol: Symbol) -> Symbol: ...
@@ -875,11 +911,15 @@ class Binary(lief.Binary):
@overlay.setter
def overlay(self, arg: bytes, /) -> None: ...
def relocate_phdr_table(self, type: PHDR_RELOC = PHDR_RELOC.AUTO) -> int: ...
def relocate_phdr_table(
self, type: Binary.PHDR_RELOC = Binary.PHDR_RELOC.AUTO
) -> int: ...
def get_relocated_dynamic_array(self, array_tag: DynamicEntry.TAG) -> list[int]: ...
def find_version_requirement(self, libname: str) -> SymbolVersionRequirement | None: ...
def find_version_requirement(
self, libname: str
) -> SymbolVersionRequirement | None: ...
def remove_version_requirement(self, libname: str) -> bool: ...
@@ -933,6 +973,7 @@ class Binary(lief.Binary):
def __str__(self) -> str: ...
class PROCESSOR_FLAGS(enum.Enum):
@staticmethod
def from_value(arg: int, /) -> PROCESSOR_FLAGS: ...
@@ -1081,6 +1122,7 @@ class PROCESSOR_FLAGS(enum.Enum):
RISCV_FLOAT_ABI_TSO = 43980465111056
class Header(lief.Object):
def __init__(self) -> None: ...
@@ -1202,13 +1244,13 @@ class Header(lief.Object):
MSB = 2
identity_class: CLASS
identity_class: Header.CLASS
identity_data: ELF_DATA
identity_data: Header.ELF_DATA
identity_version: VERSION
identity_version: Header.VERSION
identity_os_abi: OS_ABI
identity_os_abi: Header.OS_ABI
identity_abi_version: int
@@ -1218,11 +1260,11 @@ class Header(lief.Object):
@identity.setter
def identity(self, arg: object, /) -> None: ...
file_type: FILE_TYPE
file_type: Header.FILE_TYPE
machine_type: ARCH
object_file_version: VERSION
object_file_version: Header.VERSION
entrypoint: int
@@ -1251,12 +1293,15 @@ class Header(lief.Object):
def __str__(self) -> str: ...
class Section(lief.Section):
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, name: str, type: TYPE = TYPE.PROGBITS) -> None: ...
def __init__(
self, name: str, type: Section.TYPE = Section.TYPE.PROGBITS
) -> None: ...
class it_segments:
def __getitem__(self, arg: int, /) -> Segment: ...
@@ -1508,7 +1553,7 @@ class Section(lief.Section):
@property
def is_frame(self) -> bool: ...
type: TYPE
type: Section.TYPE
flags: int
@@ -1533,28 +1578,29 @@ class Section(lief.Section):
def clear(self, value: int = 0) -> Section: ...
def add(self, flag: FLAGS) -> None: ...
def add(self, flag: Section.FLAGS) -> None: ...
def remove(self, flag: FLAGS) -> None: ...
def remove(self, flag: Section.FLAGS) -> None: ...
@overload
def has(self, flag: FLAGS) -> bool: ...
def has(self, flag: Section.FLAGS) -> bool: ...
@overload
def has(self, segment: Segment) -> bool: ...
def __iadd__(self, arg: FLAGS, /) -> Section: ...
def __iadd__(self, arg: Section.FLAGS, /) -> Section: ...
def __isub__(self, arg: FLAGS, /) -> Section: ...
def __isub__(self, arg: Section.FLAGS, /) -> Section: ...
@overload
def __contains__(self, arg: FLAGS, /) -> bool: ...
def __contains__(self, arg: Section.FLAGS, /) -> bool: ...
@overload
def __contains__(self, arg: Segment, /) -> bool: ...
def __str__(self) -> str: ...
class Segment(lief.Object):
def __init__(self) -> None: ...
@@ -1676,9 +1722,9 @@ class Segment(lief.Object):
@staticmethod
def from_raw(arg: bytes, /) -> Union[Segment, lief.lief_errors]: ...
type: TYPE
type: Segment.TYPE
flags: FLAGS
flags: Segment.FLAGS
raw_flags: int
@@ -1700,12 +1746,12 @@ class Segment(lief.Object):
@content.setter
def content(self, arg: Sequence[int], /) -> None: ...
def add(self, flag: FLAGS) -> None: ...
def add(self, flag: Segment.FLAGS) -> None: ...
def remove(self, flag: FLAGS) -> None: ...
def remove(self, flag: Segment.FLAGS) -> None: ...
@overload
def has(self, flag: FLAGS) -> bool: ...
def has(self, flag: Segment.FLAGS) -> bool: ...
@overload
def has(self, section: Section) -> bool: ...
@@ -1720,12 +1766,12 @@ class Segment(lief.Object):
@property
def sections(self) -> Segment.it_sections: ...
def __iadd__(self, arg: FLAGS, /) -> Segment: ...
def __iadd__(self, arg: Segment.FLAGS, /) -> Segment: ...
def __isub__(self, arg: FLAGS, /) -> Segment: ...
def __isub__(self, arg: Segment.FLAGS, /) -> Segment: ...
@overload
def __contains__(self, arg: FLAGS, /) -> bool: ...
def __contains__(self, arg: Segment.FLAGS, /) -> bool: ...
@overload
def __contains__(self, arg: Section, /) -> bool: ...
@@ -1735,6 +1781,7 @@ class Segment(lief.Object):
def __str__(self) -> str: ...
class Symbol(lief.Symbol):
def __init__(self) -> None: ...
@@ -1803,15 +1850,15 @@ class Symbol(lief.Symbol):
@property
def demangled_name(self) -> str: ...
type: TYPE
type: Symbol.TYPE
binding: BINDING
binding: Symbol.BINDING
information: int
other: int
visibility: VISIBILITY
visibility: Symbol.VISIBILITY
value: int
@@ -1843,6 +1890,7 @@ class Symbol(lief.Symbol):
def __str__(self) -> str: ...
class Relocation(lief.Relocation):
@overload
def __init__(self) -> None: ...
@@ -1851,7 +1899,9 @@ class Relocation(lief.Relocation):
def __init__(self, arch: ARCH) -> None: ...
@overload
def __init__(self, address: int, type: TYPE, encoding: ENCODING) -> None: ...
def __init__(
self, address: int, type: Relocation.TYPE, encoding: Relocation.ENCODING
) -> None: ...
class TYPE(enum.Enum):
@staticmethod
@@ -4165,9 +4215,9 @@ class Relocation(lief.Relocation):
info: int
purpose: PURPOSE
purpose: Relocation.PURPOSE
type: TYPE
type: Relocation.TYPE
@property
def has_symbol(self) -> bool: ...
@@ -4208,6 +4258,7 @@ class Relocation(lief.Relocation):
def __str__(self) -> str: ...
class SymbolVersionAux(lief.Object):
@property
def name(self) -> Union[str, bytes]: ...
@@ -4217,6 +4268,7 @@ class SymbolVersionAux(lief.Object):
def __str__(self) -> str: ...
class SymbolVersionAuxRequirement(SymbolVersionAux):
def __init__(self) -> None: ...
@@ -4228,6 +4280,7 @@ class SymbolVersionAuxRequirement(SymbolVersionAux):
def __str__(self) -> str: ...
class SymbolVersionDefinition(lief.Object):
class it_version_aux:
def __getitem__(self, arg: int, /) -> SymbolVersionAux: ...
@@ -4252,6 +4305,7 @@ class SymbolVersionDefinition(lief.Object):
def __str__(self) -> str: ...
class SymbolVersionRequirement(lief.Object):
class it_aux_requirement:
def __getitem__(self, arg: int, /) -> SymbolVersionAuxRequirement: ...
@@ -4266,9 +4320,11 @@ class SymbolVersionRequirement(lief.Object):
name: str
def get_auxiliary_symbols(self) -> it_aux_requirement: ...
def get_auxiliary_symbols(self) -> SymbolVersionRequirement.it_aux_requirement: ...
def add_auxiliary_requirement(self, arg: SymbolVersionAuxRequirement, /) -> SymbolVersionAuxRequirement: ...
def add_auxiliary_requirement(
self, arg: SymbolVersionAuxRequirement, /
) -> SymbolVersionAuxRequirement: ...
def find_aux(self, name: str) -> SymbolVersionAuxRequirement | None: ...
@@ -4280,12 +4336,13 @@ class SymbolVersionRequirement(lief.Object):
def __str__(self) -> str: ...
class DynamicEntry(lief.Object):
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, tag: TAG, value: int) -> None: ...
def __init__(self, tag: DynamicEntry.TAG, value: int) -> None: ...
class TAG(enum.Enum):
@staticmethod
@@ -4613,12 +4670,13 @@ class DynamicEntry(lief.Object):
IA_64_VMS_FPMODE = 35970351170
tag: TAG
tag: DynamicEntry.TAG
value: int
def __str__(self) -> str: ...
class DynamicEntryLibrary(DynamicEntry):
def __init__(self, library_name: str) -> None: ...
@@ -4630,6 +4688,7 @@ class DynamicEntryLibrary(DynamicEntry):
def __str__(self) -> str: ...
class DynamicSharedObject(DynamicEntry):
def __init__(self, library_name: str) -> None: ...
@@ -4641,6 +4700,7 @@ class DynamicSharedObject(DynamicEntry):
def __str__(self) -> str: ...
class DynamicEntryAuxiliary(DynamicEntry):
def __init__(self, library_name: str) -> None: ...
@@ -4652,6 +4712,7 @@ class DynamicEntryAuxiliary(DynamicEntry):
def __str__(self) -> str: ...
class DynamicEntryFilter(DynamicEntry):
def __init__(self, library_name: str) -> None: ...
@@ -4663,6 +4724,7 @@ class DynamicEntryFilter(DynamicEntry):
def __str__(self) -> str: ...
class DynamicEntryArray(DynamicEntry):
def __init__(self, tag: DynamicEntry.TAG, array: Sequence[int]) -> None: ...
@@ -4688,9 +4750,10 @@ class DynamicEntryArray(DynamicEntry):
def __str__(self) -> str: ...
class DynamicEntryRpath(DynamicEntry):
@overload
def __init__(self, path: str = '') -> None: ...
def __init__(self, path: str = "") -> None: ...
@overload
def __init__(self, paths: Sequence[str]) -> None: ...
@@ -4719,9 +4782,10 @@ class DynamicEntryRpath(DynamicEntry):
def __str__(self) -> str: ...
class DynamicEntryRunPath(DynamicEntry):
@overload
def __init__(self, path: str = '') -> None: ...
def __init__(self, path: str = "") -> None: ...
@overload
def __init__(self, paths: Sequence[str]) -> None: ...
@@ -4750,6 +4814,7 @@ class DynamicEntryRunPath(DynamicEntry):
def __str__(self) -> str: ...
class DynamicEntryFlags(DynamicEntry):
class FLAG(enum.Enum):
@staticmethod
@@ -4834,20 +4899,21 @@ class DynamicEntryFlags(DynamicEntry):
@property
def flags(self) -> list[DynamicEntryFlags.FLAG]: ...
def has(self, flag: FLAG) -> bool: ...
def has(self, flag: DynamicEntryFlags.FLAG) -> bool: ...
def add(self, flag: FLAG) -> None: ...
def add(self, flag: DynamicEntryFlags.FLAG) -> None: ...
def remove(self, flag: FLAG) -> None: ...
def remove(self, flag: DynamicEntryFlags.FLAG) -> None: ...
def __iadd__(self, arg: FLAG, /) -> DynamicEntryFlags: ...
def __iadd__(self, arg: DynamicEntryFlags.FLAG, /) -> DynamicEntryFlags: ...
def __isub__(self, arg: FLAG, /) -> DynamicEntryFlags: ...
def __isub__(self, arg: DynamicEntryFlags.FLAG, /) -> DynamicEntryFlags: ...
def __contains__(self, arg: FLAG, /) -> bool: ...
def __contains__(self, arg: DynamicEntryFlags.FLAG, /) -> bool: ...
def __str__(self) -> str: ...
class GnuHash(lief.Object):
def __init__(self) -> None: ...
@@ -4881,6 +4947,7 @@ class GnuHash(lief.Object):
def __str__(self) -> str: ...
class SysvHash(lief.Object):
def __init__(self) -> None: ...
@@ -4897,12 +4964,13 @@ class SysvHash(lief.Object):
def __str__(self) -> str: ...
class Builder:
@overload
def __init__(self, elf: Binary) -> None: ...
@overload
def __init__(self, elf: Binary, config: config_t) -> None: ...
def __init__(self, elf: Binary, config: Builder.config_t) -> None: ...
class config_t:
def __init__(self) -> None: ...
@@ -4958,6 +5026,7 @@ class Builder:
def get_build(self) -> list[int]: ...
class Note(lief.Object):
class TYPE(enum.Enum):
@staticmethod
@@ -5059,15 +5128,36 @@ class Note(lief.Object):
@overload
@staticmethod
def create(name: str, original_type: int, description: Sequence[int], section_name: str, file_type: Header.FILE_TYPE = Header.FILE_TYPE.NONE, arch: ARCH = ARCH.NONE, cls: Header.CLASS = Header.CLASS.NONE) -> Optional[Note]: ...
def create(
name: str,
original_type: int,
description: Sequence[int],
section_name: str,
file_type: Header.FILE_TYPE = Header.FILE_TYPE.NONE,
arch: ARCH = ARCH.NONE,
cls: Header.CLASS = Header.CLASS.NONE,
) -> Optional[Note]: ...
@overload
@staticmethod
def create(raw: bytes, section_name: str = '', file_type: Header.FILE_TYPE = Header.FILE_TYPE.NONE, arch: ARCH = ARCH.NONE, cls: Header.CLASS = Header.CLASS.NONE) -> Optional[Note]: ...
def create(
raw: bytes,
section_name: str = "",
file_type: Header.FILE_TYPE = Header.FILE_TYPE.NONE,
arch: ARCH = ARCH.NONE,
cls: Header.CLASS = Header.CLASS.NONE,
) -> Optional[Note]: ...
@overload
@staticmethod
def create(name: str, type: TYPE, description: Sequence[int], section_name: str, arch: ARCH = ARCH.NONE, cls: Header.CLASS = Header.CLASS.NONE) -> Optional[Note]: ...
def create(
name: str,
type: Note.TYPE,
description: Sequence[int],
section_name: str,
arch: ARCH = ARCH.NONE,
cls: Header.CLASS = Header.CLASS.NONE,
) -> Optional[Note]: ...
name: str
@@ -5090,6 +5180,7 @@ class Note(lief.Object):
def __str__(self) -> str: ...
class NoteGnuProperty(Note):
class Property:
@property
@@ -5128,10 +5219,13 @@ class NoteGnuProperty(Note):
@property
def properties(self) -> list[Optional[NoteGnuProperty.Property]]: ...
def find(self, arg: Property.TYPE, /) -> Optional[Property]: ...
def find(
self, arg: NoteGnuProperty.Property.TYPE, /
) -> Optional[NoteGnuProperty.Property]: ...
def __str__(self) -> str: ...
class AArch64Feature(NoteGnuProperty.Property):
@property
def features(self) -> list[AArch64Feature.FEATURE]: ...
@@ -5154,6 +5248,7 @@ class AArch64Feature(NoteGnuProperty.Property):
GCS = 3
class AArch64PAuth(NoteGnuProperty.Property):
@property
def platform(self) -> int: ...
@@ -5161,6 +5256,7 @@ class AArch64PAuth(NoteGnuProperty.Property):
@property
def version(self) -> int: ...
class Needed(NoteGnuProperty.Property):
class NEED(enum.Enum):
@staticmethod
@@ -5179,6 +5275,7 @@ class Needed(NoteGnuProperty.Property):
@property
def needs(self) -> list[Needed.NEED]: ...
class X86Features(NoteGnuProperty.Property):
@property
def features(self) -> list[tuple[X86Features.FLAG, X86Features.FEATURE]]: ...
@@ -5243,6 +5340,7 @@ class X86Features(NoteGnuProperty.Property):
MASK = 16
class X86ISA(NoteGnuProperty.Property):
@property
def values(self) -> list[tuple[X86ISA.FLAG, X86ISA.ISA]]: ...
@@ -5339,17 +5437,21 @@ class X86ISA(NoteGnuProperty.Property):
AVX512_BF16 = 32
class StackSize(NoteGnuProperty.Property):
@property
def stack_size(self) -> int: ...
class NoteNoCopyOnProtected(NoteGnuProperty.Property):
pass
class Generic(NoteGnuProperty.Property):
@property
def raw_type(self) -> int: ...
class AndroidIdent(Note):
sdk_version: int
@@ -5359,6 +5461,7 @@ class AndroidIdent(Note):
def __str__(self) -> str: ...
class NoteAbi(Note):
class ABI(enum.Enum):
@staticmethod
@@ -5392,6 +5495,7 @@ class NoteAbi(Note):
def __str__(self) -> str: ...
class CoreAuxv(Note):
class TYPE(enum.Enum):
@staticmethod
@@ -5466,31 +5570,32 @@ class CoreAuxv(Note):
@property
def values(self) -> dict[CoreAuxv.TYPE, int]: ...
def get(self, type: TYPE) -> Optional[int]: ...
def get(self, type: CoreAuxv.TYPE) -> Optional[int]: ...
def __getitem__(self, arg: TYPE, /) -> Optional[int]: ...
def __getitem__(self, arg: CoreAuxv.TYPE, /) -> Optional[int]: ...
@overload
def set(self, type: TYPE, value: int) -> bool: ...
def set(self, type: CoreAuxv.TYPE, value: int) -> bool: ...
@overload
def set(self, arg: Mapping[TYPE, int], /) -> bool: ...
def set(self, arg: Mapping[CoreAuxv.TYPE, int], /) -> bool: ...
@overload
def __setitem__(self, arg0: TYPE, arg1: int, /) -> bool: ...
def __setitem__(self, arg0: CoreAuxv.TYPE, arg1: int, /) -> bool: ...
@overload
def __setitem__(self, arg: Mapping[TYPE, int], /) -> bool: ...
def __setitem__(self, arg: Mapping[CoreAuxv.TYPE, int], /) -> bool: ...
def __str__(self) -> str: ...
class CoreFile(Note):
class files_t:
@overload
def __init__(self) -> None: ...
@overload
def __init__(self, arg: CoreFile.files_t) -> None: ...
def __init__(self, arg: CoreFile.files_t, /) -> None: ...
@overload
def __init__(self, arg: Iterable[CoreFile.entry_t], /) -> None: ...
@@ -5542,14 +5647,15 @@ class CoreFile(Note):
def __str__(self) -> str: ...
files: files_t
files: CoreFile.files_t
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[entry_t]: ...
def __iter__(self) -> Iterator[CoreFile.entry_t]: ...
def __str__(self) -> str: ...
class CorePrPsInfo(Note):
class info_t:
state: int
@@ -5592,6 +5698,7 @@ class CorePrPsInfo(Note):
def __str__(self) -> str: ...
class CoreSigInfo(Note):
@property
def signo(self) -> Optional[int]: ...
@@ -5613,6 +5720,7 @@ class CoreSigInfo(Note):
def __str__(self) -> str: ...
class CorePrStatus(Note):
class timeval_t:
sec: int
@@ -5880,7 +5988,7 @@ class CorePrStatus(Note):
PSTATE = 33
status: pr_status_t
status: CorePrStatus.pr_status_t
@property
def architecture(self) -> ARCH: ...
@@ -5898,55 +6006,68 @@ class CorePrStatus(Note):
def register_values(self) -> list[int]: ...
@overload
def get(self, reg: Registers.X86) -> Optional[int]: ...
def get(self, reg: CorePrStatus.Registers.X86) -> Optional[int]: ...
@overload
def get(self, reg: Registers.X86_64) -> Optional[int]: ...
def get(self, reg: CorePrStatus.Registers.X86_64) -> Optional[int]: ...
@overload
def get(self, reg: Registers.ARM) -> Optional[int]: ...
def get(self, reg: CorePrStatus.Registers.ARM) -> Optional[int]: ...
@overload
def get(self, reg: Registers.AARCH64) -> Optional[int]: ...
def get(self, reg: CorePrStatus.Registers.AARCH64) -> Optional[int]: ...
@overload
def __getitem__(self, arg: Registers.X86, /) -> Optional[int]: ...
def __getitem__(self, arg: CorePrStatus.Registers.X86, /) -> Optional[int]: ...
@overload
def __getitem__(self, arg: Registers.X86_64, /) -> Optional[int]: ...
def __getitem__(self, arg: CorePrStatus.Registers.X86_64, /) -> Optional[int]: ...
@overload
def __getitem__(self, arg: Registers.ARM, /) -> Optional[int]: ...
def __getitem__(self, arg: CorePrStatus.Registers.ARM, /) -> Optional[int]: ...
@overload
def __getitem__(self, arg: Registers.AARCH64, /) -> Optional[int]: ...
def __getitem__(self, arg: CorePrStatus.Registers.AARCH64, /) -> Optional[int]: ...
@overload
def set(self, reg: Registers.X86, value: int) -> lief.ok_error_t: ...
def set(self, reg: CorePrStatus.Registers.X86, value: int) -> lief.ok_error_t: ...
@overload
def set(self, reg: Registers.X86_64, value: int) -> lief.ok_error_t: ...
def set(
self, reg: CorePrStatus.Registers.X86_64, value: int
) -> lief.ok_error_t: ...
@overload
def set(self, reg: Registers.ARM, value: int) -> lief.ok_error_t: ...
def set(self, reg: CorePrStatus.Registers.ARM, value: int) -> lief.ok_error_t: ...
@overload
def set(self, reg: Registers.AARCH64, value: int) -> lief.ok_error_t: ...
def set(
self, reg: CorePrStatus.Registers.AARCH64, value: int
) -> lief.ok_error_t: ...
@overload
def __setitem__(self, arg0: Registers.X86, arg1: int, /) -> lief.ok_error_t: ...
def __setitem__(
self, arg0: CorePrStatus.Registers.X86, arg1: int, /
) -> lief.ok_error_t: ...
@overload
def __setitem__(self, arg0: Registers.X86_64, arg1: int, /) -> lief.ok_error_t: ...
def __setitem__(
self, arg0: CorePrStatus.Registers.X86_64, arg1: int, /
) -> lief.ok_error_t: ...
@overload
def __setitem__(self, arg0: Registers.ARM, arg1: int, /) -> lief.ok_error_t: ...
def __setitem__(
self, arg0: CorePrStatus.Registers.ARM, arg1: int, /
) -> lief.ok_error_t: ...
@overload
def __setitem__(self, arg0: Registers.AARCH64, arg1: int, /) -> lief.ok_error_t: ...
def __setitem__(
self, arg0: CorePrStatus.Registers.AARCH64, arg1: int, /
) -> lief.ok_error_t: ...
def __str__(self) -> str: ...
class QNXStack(Note):
stack_size: int
+35 -35
View File
@@ -1,10 +1,10 @@
from collections.abc import Sequence
from collections.abc import Iterator, Sequence
import enum
import io
import os
from typing import Final, Iterator, Optional, Union, overload
from typing import Final, Optional, Union, overload
import lief.MachO
import lief
import lief
import lief.objc
@@ -656,7 +656,7 @@ class FatBinary:
@overload
def __getitem__(self, arg: Header.CPU_TYPE, /) -> Binary | None: ...
def __iter__(self) -> it_binaries: ...
def __iter__(self) -> FatBinary.it_binaries: ...
def __str__(self) -> str: ...
@@ -1322,11 +1322,11 @@ class Header(lief.Object):
magic: MACHO_TYPES
cpu_type: CPU_TYPE
cpu_type: Header.CPU_TYPE
cpu_subtype: int
file_type: FILE_TYPE
file_type: Header.FILE_TYPE
flags: int
@@ -1345,17 +1345,17 @@ class Header(lief.Object):
@property
def is_64bit(self) -> bool: ...
def add(self, flag: FLAGS) -> None: ...
def add(self, flag: Header.FLAGS) -> None: ...
def remove(self, flag: FLAGS) -> None: ...
def remove(self, flag: Header.FLAGS) -> None: ...
def has(self, flag: FLAGS) -> bool: ...
def has(self, flag: Header.FLAGS) -> bool: ...
def __iadd__(self, arg: FLAGS, /) -> Header: ...
def __iadd__(self, arg: Header.FLAGS, /) -> Header: ...
def __isub__(self, arg: FLAGS, /) -> Header: ...
def __isub__(self, arg: Header.FLAGS, /) -> Header: ...
def __contains__(self, arg: FLAGS, /) -> bool: ...
def __contains__(self, arg: Header.FLAGS, /) -> bool: ...
def __str__(self) -> str: ...
@@ -1494,7 +1494,7 @@ class LoadCommand(lief.Object):
LIEF_UNKNOWN = 4293787649
command: TYPE
command: LoadCommand.TYPE
size: int
@@ -1742,11 +1742,11 @@ class Section(lief.Section):
@overload
@staticmethod
def create(name: str, content: Sequence[int], type: TYPE = TYPE.REGULAR) -> Optional[Section]: ...
def create(name: str, content: Sequence[int], type: Section.TYPE = Section.TYPE.REGULAR) -> Optional[Section]: ...
@overload
@staticmethod
def create(name: str, type: TYPE = TYPE.REGULAR) -> Optional[Section]: ...
def create(name: str, type: Section.TYPE = Section.TYPE.REGULAR) -> Optional[Section]: ...
alignment: int
@@ -1754,7 +1754,7 @@ class Section(lief.Section):
numberof_relocations: int
type: TYPE
type: Section.TYPE
@property
def relocations(self) -> SegmentCommand.it_relocations: ...
@@ -1782,17 +1782,17 @@ class Section(lief.Section):
@property
def has_segment(self) -> bool: ...
def has(self, flag: FLAGS) -> bool: ...
def has(self, flag: Section.FLAGS) -> bool: ...
def add(self, flag: FLAGS) -> None: ...
def add(self, flag: Section.FLAGS) -> None: ...
def remove(self, flag: FLAGS) -> None: ...
def remove(self, flag: Section.FLAGS) -> None: ...
def __iadd__(self, arg: FLAGS, /) -> Section: ...
def __iadd__(self, arg: Section.FLAGS, /) -> Section: ...
def __isub__(self, arg: FLAGS, /) -> Section: ...
def __isub__(self, arg: Section.FLAGS, /) -> Section: ...
def __contains__(self, arg: FLAGS, /) -> bool: ...
def __contains__(self, arg: Section.FLAGS, /) -> bool: ...
def __str__(self) -> str: ...
@@ -2251,13 +2251,13 @@ class ThreadLocalVariables(Section):
@property
def nb_thunks(self) -> int: ...
def get(self, idx: int) -> Thunk | None: ...
def get(self, idx: int) -> ThreadLocalVariables.Thunk | None: ...
def set(self, idx: int, thunk: Thunk) -> None: ...
def set(self, idx: int, thunk: ThreadLocalVariables.Thunk) -> None: ...
def __getitem__(self, idx: int) -> Thunk | None: ...
def __getitem__(self, idx: int) -> ThreadLocalVariables.Thunk | None: ...
def __setitem__(self, idx: int, thunk: Thunk) -> None: ...
def __setitem__(self, idx: int, thunk: ThreadLocalVariables.Thunk) -> None: ...
class RPathCommand(LoadCommand):
@staticmethod
@@ -2521,9 +2521,9 @@ class DyldBindingInfo(BindingInfo):
TEXT_PCREL32 = 3
binding_class: CLASS
binding_class: DyldBindingInfo.CLASS
binding_type: TYPE
binding_type: DyldBindingInfo.TYPE
@property
def original_offset(self) -> int: ...
@@ -2587,7 +2587,7 @@ class ExportInfo(lief.Object):
@property
def has_symbol(self) -> bool: ...
def has(self, flag: FLAGS) -> bool: ...
def has(self, flag: ExportInfo.FLAGS) -> bool: ...
@property
def symbol(self) -> Symbol | None: ...
@@ -2870,7 +2870,7 @@ class FunctionVariantFixups(LoadCommand):
@property
def fixups(self) -> FunctionVariantFixups.it_fixups: ...
def add(self, fixup: Fixup) -> FunctionVariantFixups: ...
def add(self, fixup: FunctionVariantFixups.Fixup) -> FunctionVariantFixups: ...
def __str__(self) -> str: ...
@@ -3013,7 +3013,7 @@ class DataCodeEntry(lief.Object):
length: int
type: TYPES
type: DataCodeEntry.TYPES
def __str__(self) -> str: ...
@@ -3157,7 +3157,7 @@ class BuildVersion(LoadCommand):
ANY = 4294967295
platform: PLATFORMS
platform: BuildVersion.PLATFORMS
@property
def minos(self) -> list[int]: ...
@@ -3283,7 +3283,7 @@ class UnknownCommand(LoadCommand):
def __str__(self) -> str: ...
class Stub:
def __init__(self, target_info: target_info_t, address: int, raw_stub: Sequence[int]) -> None: ...
def __init__(self, target_info: Stub.target_info_t, address: int, raw_stub: Sequence[int]) -> None: ...
class target_info_t:
@overload
@@ -3319,7 +3319,7 @@ class Builder:
@overload
@staticmethod
def write(binary: Binary, output: str, config: config_t) -> Union[lief.ok_t, lief.lief_errors]: ...
def write(binary: Binary, output: str, config: Builder.config_t) -> Union[lief.ok_t, lief.lief_errors]: ...
@overload
@staticmethod
@@ -3327,7 +3327,7 @@ class Builder:
@overload
@staticmethod
def write(fat_binary: FatBinary, output: str, config: config_t) -> Union[lief.ok_t, lief.lief_errors]: ...
def write(fat_binary: FatBinary, output: str, config: Builder.config_t) -> Union[lief.ok_t, lief.lief_errors]: ...
def is_fat(file: Union[str | os.PathLike]) -> bool: ...
+1 -1
View File
@@ -2,7 +2,7 @@ from collections.abc import Sequence
import enum
import io
import os
from typing import Iterator, Optional, Union, overload
from typing import Optional, Union, overload
import lief
import lief.Android
+43 -42
View File
@@ -1,16 +1,17 @@
from collections.abc import Callable, Sequence
import enum
import io
import lief.PE
import os
from typing import Final, Iterator, Optional, Union, overload
from typing import Final, Optional, Union, overload
from . import (
import lief.PE
import lief
import lief.COFF
from lief.PE import (
unwind_aarch64 as unwind_aarch64,
unwind_x64 as unwind_x64
)
import lief
import lief.COFF
class PE_TYPE(enum.Enum):
@@ -274,7 +275,7 @@ class Header(lief.Object):
@signature.setter
def signature(self, arg: Sequence[int], /) -> None: ...
machine: MACHINE_TYPES
machine: Header.MACHINE_TYPES
numberof_sections: int
@@ -288,11 +289,11 @@ class Header(lief.Object):
characteristics: int
def has_characteristic(self, characteristic: CHARACTERISTICS) -> bool: ...
def has_characteristic(self, characteristic: Header.CHARACTERISTICS) -> bool: ...
def add_characteristic(self, characteristic: CHARACTERISTICS) -> None: ...
def add_characteristic(self, characteristic: Header.CHARACTERISTICS) -> None: ...
def remove_characteristic(self, characteristic: CHARACTERISTICS) -> None: ...
def remove_characteristic(self, characteristic: Header.CHARACTERISTICS) -> None: ...
@property
def characteristics_list(self) -> list[Header.CHARACTERISTICS]: ...
@@ -423,18 +424,18 @@ class OptionalHeader(lief.Object):
checksum: int
subsystem: SUBSYSTEM
subsystem: OptionalHeader.SUBSYSTEM
dll_characteristics: int
def add(self, characteristic: DLL_CHARACTERISTICS) -> None: ...
def add(self, characteristic: OptionalHeader.DLL_CHARACTERISTICS) -> None: ...
def remove(self, characteristic: DLL_CHARACTERISTICS) -> None: ...
def remove(self, characteristic: OptionalHeader.DLL_CHARACTERISTICS) -> None: ...
@property
def dll_characteristics_lists(self) -> list[OptionalHeader.DLL_CHARACTERISTICS]: ...
def has(self, characteristics: DLL_CHARACTERISTICS) -> bool: ...
def has(self, characteristics: OptionalHeader.DLL_CHARACTERISTICS) -> bool: ...
sizeof_stack_reserve: int
@@ -448,11 +449,11 @@ class OptionalHeader(lief.Object):
numberof_rva_and_size: int
def __iadd__(self, arg: DLL_CHARACTERISTICS, /) -> OptionalHeader: ...
def __iadd__(self, arg: OptionalHeader.DLL_CHARACTERISTICS, /) -> OptionalHeader: ...
def __isub__(self, arg: DLL_CHARACTERISTICS, /) -> OptionalHeader: ...
def __isub__(self, arg: OptionalHeader.DLL_CHARACTERISTICS, /) -> OptionalHeader: ...
def __contains__(self, arg: DLL_CHARACTERISTICS, /) -> bool: ...
def __contains__(self, arg: OptionalHeader.DLL_CHARACTERISTICS, /) -> bool: ...
def copy(self) -> OptionalHeader: ...
@@ -690,7 +691,7 @@ class Section(lief.Section):
@property
def characteristics_lists(self) -> list[Section.CHARACTERISTICS]: ...
def has_characteristic(self, characteristic: CHARACTERISTICS) -> bool: ...
def has_characteristic(self, characteristic: Section.CHARACTERISTICS) -> bool: ...
@property
def is_discardable(self) -> bool: ...
@@ -735,7 +736,7 @@ class RelocationEntry(lief.Relocation):
def __init__(self) -> None: ...
@overload
def __init__(self, arg0: int, arg1: BASE_TYPES, /) -> None: ...
def __init__(self, arg0: int, arg1: RelocationEntry.BASE_TYPES, /) -> None: ...
class BASE_TYPES(enum.Enum):
@staticmethod
@@ -784,7 +785,7 @@ class RelocationEntry(lief.Relocation):
position: int
type: BASE_TYPES
type: RelocationEntry.BASE_TYPES
def __str__(self) -> str: ...
@@ -1381,7 +1382,7 @@ class CodeView(Debug):
def __init__(self) -> None: ...
@overload
def __init__(self, arg: SIGNATURES, /) -> None: ...
def __init__(self, arg: CodeView.SIGNATURES, /) -> None: ...
class SIGNATURES(enum.Enum):
@staticmethod
@@ -1508,7 +1509,7 @@ class PogoEntry(lief.Object):
def __str__(self) -> str: ...
class PDBChecksum(Debug):
def __init__(self, algo: HASH_ALGO, hash: Sequence[int]) -> None: ...
def __init__(self, algo: PDBChecksum.HASH_ALGO, hash: Sequence[int]) -> None: ...
class HASH_ALGO(enum.Enum):
UNKNOWN = 0
@@ -1521,7 +1522,7 @@ class PDBChecksum(Debug):
@hash.setter
def hash(self, arg: Sequence[int], /) -> None: ...
algorithm: HASH_ALGO
algorithm: PDBChecksum.HASH_ALGO
def __str__(self) -> str: ...
@@ -1563,7 +1564,7 @@ class ExDllCharacteristics(Debug):
HOTPATCH_COMPATIBLE = 128
def has(self, characteristic: CHARACTERISTICS) -> bool: ...
def has(self, characteristic: ExDllCharacteristics.CHARACTERISTICS) -> bool: ...
@property
def ex_characteristics(self) -> ExDllCharacteristics.CHARACTERISTICS: ...
@@ -1748,7 +1749,7 @@ class ResourcesManager(lief.Object):
def add_icon(self, icon: ResourceIcon) -> None: ...
def has_type(self, type: TYPE) -> bool: ...
def has_type(self, type: ResourcesManager.TYPE) -> bool: ...
@property
def has_string_table(self) -> bool: ...
@@ -1768,7 +1769,7 @@ class ResourcesManager(lief.Object):
@property
def accelerator(self) -> ResourcesManager.it_const_accelerators: ...
def get_node_type(self, type: TYPE) -> ResourceNode | None: ...
def get_node_type(self, type: ResourcesManager.TYPE) -> ResourceNode | None: ...
def print(self, max_depth: int = 0) -> str: ...
@@ -1983,7 +1984,7 @@ class ResourceVersion(lief.Object):
file_date_ls: int
def has(self, flag: FILE_FLAGS) -> bool: ...
def has(self, flag: ResourceVersion.fixed_file_info_t.FILE_FLAGS) -> bool: ...
@property
def flags(self) -> list[ResourceVersion.fixed_file_info_t.FILE_FLAGS]: ...
@@ -2352,13 +2353,13 @@ class ResourceDialog(lief.Object):
cy: int
@overload
def has(self, arg: DIALOG_STYLES, /) -> bool: ...
def has(self, arg: ResourceDialog.DIALOG_STYLES, /) -> bool: ...
@overload
def has(self, arg: WINDOW_STYLES, /) -> bool: ...
def has(self, arg: ResourceDialog.WINDOW_STYLES, /) -> bool: ...
@overload
def has(self, arg: WINDOW_EXTENDED_STYLES, /) -> bool: ...
def has(self, arg: ResourceDialog.WINDOW_EXTENDED_STYLES, /) -> bool: ...
@property
def styles_list(self) -> list[ResourceDialog.DIALOG_STYLES]: ...
@@ -2430,7 +2431,7 @@ class ResourceDialogExtended(ResourceDialog):
@property
def font(self) -> ResourceDialogExtended.font_t: ...
def add_item(self, item: Item) -> None: ...
def add_item(self, item: ResourceDialogExtended.Item) -> None: ...
def __str__(self) -> str: ...
@@ -2469,7 +2470,7 @@ class ResourceDialogRegular(ResourceDialog):
@property
def font(self) -> ResourceDialogRegular.font_t: ...
def add_item(self, item: Item) -> None: ...
def add_item(self, item: ResourceDialogRegular.Item) -> None: ...
def __str__(self) -> str: ...
@@ -2863,11 +2864,11 @@ class ResourceAccelerator(lief.Object):
@property
def padding(self) -> int: ...
def has(self, arg: FLAGS, /) -> bool: ...
def has(self, arg: ResourceAccelerator.FLAGS, /) -> bool: ...
def add(self, arg: FLAGS, /) -> ResourceAccelerator: ...
def add(self, arg: ResourceAccelerator.FLAGS, /) -> ResourceAccelerator: ...
def remove(self, arg: FLAGS, /) -> ResourceAccelerator: ...
def remove(self, arg: ResourceAccelerator.FLAGS, /) -> ResourceAccelerator: ...
def __str__(self) -> str: ...
@@ -3197,7 +3198,7 @@ class Signature(lief.Object):
@overload
def find_crt_issuer(self, issuer: str, serialno: Sequence[int]) -> x509 | None: ...
def check(self, checks: VERIFICATION_CHECKS = VERIFICATION_CHECKS.DEFAULT) -> VERIFICATION_FLAGS: ...
def check(self, checks: Signature.VERIFICATION_CHECKS = Signature.VERIFICATION_CHECKS.DEFAULT) -> Signature.VERIFICATION_FLAGS: ...
@property
def raw_der(self) -> memoryview: ...
@@ -3392,9 +3393,9 @@ class x509(lief.Object):
@property
def signature(self) -> bytes: ...
def verify(self, ca: x509) -> VERIFICATION_FLAGS: ...
def verify(self, ca: x509) -> x509.VERIFICATION_FLAGS: ...
def is_trusted_by(self, ca_list: Sequence[x509]) -> VERIFICATION_FLAGS: ...
def is_trusted_by(self, ca_list: Sequence[x509]) -> x509.VERIFICATION_FLAGS: ...
def __str__(self) -> str: ...
@@ -4068,10 +4069,10 @@ class FunctionOverride(DynamicFixup):
def bdd_info(self) -> FunctionOverride.it_bdd_info: ...
@overload
def find_bdd_info(self, arg: int, /) -> image_bdd_info_t | None: ...
def find_bdd_info(self, arg: int, /) -> FunctionOverride.image_bdd_info_t | None: ...
@overload
def find_bdd_info(self, arg: FunctionOverrideInfo, /) -> image_bdd_info_t | None: ...
def find_bdd_info(self, arg: FunctionOverrideInfo, /) -> FunctionOverride.image_bdd_info_t | None: ...
class EnclaveImport:
class TYPE(enum.Enum):
@@ -4085,7 +4086,7 @@ class EnclaveImport:
IMAGE_ID = 4
type: TYPE
type: EnclaveImport.TYPE
min_security_version: int
@@ -4368,7 +4369,7 @@ class LoadConfiguration(lief.Object):
@guard_flags.setter
def guard_flags(self, arg: int, /) -> LoadConfiguration: ...
def has(self, arg: IMAGE_GUARD, /) -> bool: ...
def has(self, arg: LoadConfiguration.IMAGE_GUARD, /) -> bool: ...
@property
def guard_cf_flags_list(self) -> list[LoadConfiguration.IMAGE_GUARD]: ...
@@ -4900,7 +4901,7 @@ class Binary(lief.Binary):
def __str__(self) -> str: ...
class Builder:
def __init__(self, binary: Binary, config: config_t) -> None: ...
def __init__(self, binary: Binary, config: Builder.config_t) -> None: ...
class config_t:
def __init__(self) -> None: ...
-1
View File
@@ -1,5 +1,4 @@
from collections.abc import Sequence
from typing import Iterator, Optional, Union
import lief.PE
-2
View File
@@ -1,5 +1,3 @@
from typing import Iterator, Optional, Union
import lief.PE
+1 -1
View File
@@ -1,7 +1,7 @@
from collections.abc import Sequence
import io
import os
from typing import Iterator, Optional, Union, overload
from typing import Optional, Union, overload
import lief
import lief.Android
+11 -13
View File
@@ -1,15 +1,13 @@
from collections.abc import Mapping, Sequence
from collections.abc import Iterator, Mapping, Sequence
import enum
import io
import os
from typing import Any, Optional, Union, overload
import lief
import lief.PE
import os
from typing import Any, Iterator, Optional, Union, overload
import lief.ELF
import lief.MachO
from . import (
from lief import (
ART as ART,
Android as Android,
COFF as COFF,
@@ -645,14 +643,14 @@ class Binary(Object):
def get_function_address(self, function_name: str) -> Union[int, lief_errors]: ...
@overload
def patch_address(self, address: int, patch_value: Sequence[int], va_type: VA_TYPES = VA_TYPES.AUTO) -> None: ...
def patch_address(self, address: int, patch_value: Sequence[int], va_type: Binary.VA_TYPES = Binary.VA_TYPES.AUTO) -> None: ...
@overload
def patch_address(self, address: int, patch_value: int, size: int = 8, va_type: VA_TYPES = VA_TYPES.AUTO) -> None: ...
def patch_address(self, address: int, patch_value: int, size: int = 8, va_type: Binary.VA_TYPES = Binary.VA_TYPES.AUTO) -> None: ...
def get_content_from_virtual_address(self, virtual_address: int, size: int, va_type: VA_TYPES = VA_TYPES.AUTO) -> memoryview: ...
def get_content_from_virtual_address(self, virtual_address: int, size: int, va_type: Binary.VA_TYPES = Binary.VA_TYPES.AUTO) -> memoryview: ...
def get_int_from_virtual_address(self, address: int, interger_size: int, type: VA_TYPES = VA_TYPES.AUTO) -> Optional[int]: ...
def get_int_from_virtual_address(self, address: int, interger_size: int, type: Binary.VA_TYPES = Binary.VA_TYPES.AUTO) -> Optional[int]: ...
@property
def abstract(self) -> lief.Binary: ...
@@ -797,9 +795,9 @@ class Function(Symbol):
DEBUG_INFO = 4
def add(self, flag: FLAGS) -> Function: ...
def add(self, flag: Function.FLAGS) -> Function: ...
def has(self, flag: FLAGS) -> bool: ...
def has(self, flag: Function.FLAGS) -> bool: ...
@property
def flags(self) -> Function.FLAGS: ...
+4 -4
View File
@@ -1,7 +1,8 @@
import enum
from typing import Iterator, Optional, Union
from typing import Union
from . import (
import lief
from lief.assembly import (
aarch64 as aarch64,
arm as arm,
ebpf as ebpf,
@@ -10,7 +11,6 @@ from . import (
riscv as riscv,
x86 as x86
)
import lief
class Engine:
@@ -118,6 +118,6 @@ class AssemblerConfig:
@staticmethod
def default_config() -> AssemblerConfig: ...
dialect: DIALECT
dialect: AssemblerConfig.DIALECT
def resolve_symbol(self, name: str) -> int | None: ...
@@ -1,8 +1,9 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union
from typing import Optional
from . import operands as operands
import lief.assembly
from lief.assembly.aarch64 import operands as operands
class OPCODE(enum.Enum):
@@ -1,6 +1,7 @@
import enum
from typing import Optional, Union
import lief.assembly.aarch64
from typing import Iterator, Optional, Union
import lief.assembly.aarch64
-1
View File
@@ -1,5 +1,4 @@
import enum
from typing import Iterator, Optional, Union
import lief.assembly
+3 -2
View File
@@ -1,8 +1,9 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union
from typing import Optional
from . import operands as operands
import lief.assembly
from lief.assembly.ebpf import operands as operands
class OPCODE(enum.Enum):
@@ -1,5 +1,3 @@
from typing import Iterator, Optional, Union
import lief.assembly.ebpf
+3 -2
View File
@@ -1,8 +1,9 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union
from typing import Optional
from . import operands as operands
import lief.assembly
from lief.assembly.mips import operands as operands
class OPCODE(enum.Enum):
+2 -1
View File
@@ -1,5 +1,6 @@
from typing import Optional, Union
import lief.assembly.mips
from typing import Iterator, Optional, Union
import lief.assembly.mips
@@ -1,8 +1,9 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union
from typing import Optional
from . import operands as operands
import lief.assembly
from lief.assembly.powerpc import operands as operands
class OPCODE(enum.Enum):
@@ -1,5 +1,6 @@
from typing import Optional, Union
import lief.assembly.powerpc
from typing import Iterator, Optional, Union
import lief.assembly.powerpc
+3 -2
View File
@@ -1,8 +1,9 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union
from typing import Optional
from . import operands as operands
import lief.assembly
from lief.assembly.riscv import operands as operands
class OPCODE(enum.Enum):
+2 -1
View File
@@ -1,5 +1,6 @@
from typing import Optional, Union
import lief.assembly.riscv
from typing import Iterator, Optional, Union
import lief.assembly.riscv
+3 -2
View File
@@ -1,8 +1,9 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union
from typing import Optional
from . import operands as operands
import lief.assembly
from lief.assembly.x86 import operands as operands
class OPCODE(enum.Enum):
@@ -1,5 +1,3 @@
from typing import Iterator, Optional, Union
import lief.assembly.x86
+3 -3
View File
@@ -1,7 +1,7 @@
from collections.abc import Sequence
from collections.abc import Iterator, Sequence
import enum
import os
from typing import Iterator, Optional, Union, overload
from typing import Optional, Union, overload
import lief
import lief.MachO
@@ -191,7 +191,7 @@ class Dylib:
@property
def padding(self) -> int: ...
def get(self, opt: extract_opt_t = ...) -> Optional[lief.MachO.Binary]: ...
def get(self, opt: Dylib.extract_opt_t = ...) -> Optional[lief.MachO.Binary]: ...
class SubCache:
@property
+8 -7
View File
@@ -1,14 +1,15 @@
from collections.abc import Iterator
import enum
import os
from typing import Iterator, Optional, Union, overload
from typing import Optional, Union, overload
from . import (
import lief
import lief.assembly
from lief.dwarf import (
editor as editor,
parameters as parameters,
types as types
)
import lief
import lief.assembly
def load(path: Union[str | os.PathLike]) -> Optional[DebugInfo]: ...
@@ -214,7 +215,7 @@ class Parameter:
@property
def type(self) -> Parameter.Location.Type: ...
class RegisterLoc(Location):
class RegisterLoc(Parameter.Location):
@property
def id(self) -> int: ...
@@ -261,7 +262,7 @@ class CompilationUnit:
COBOL = 10
lang: LANG
lang: CompilationUnit.Language.LANG
version: int
@@ -356,7 +357,7 @@ class Editor:
def from_binary(bin: lief.Binary) -> Optional[Editor]: ...
@staticmethod
def create(fmt: FORMAT, arch: ARCH) -> Optional[Editor]: ...
def create(fmt: Editor.FORMAT, arch: Editor.ARCH) -> Optional[Editor]: ...
def create_compilation_unit(self) -> Optional[editor.CompilationUnit]: ...
+9 -9
View File
@@ -1,6 +1,6 @@
from collections.abc import Sequence
import enum
from typing import Iterator, Optional, Union, overload
from typing import Optional, overload
class Type:
@@ -17,7 +17,7 @@ class EnumType(Type):
def set_underlying_type(self, type: Type) -> EnumType: ...
def add_value(self, name: str, value: int) -> Optional[Value]: ...
def add_value(self, name: str, value: int) -> Optional[EnumType.Value]: ...
class BaseType(Type):
class ENCODING(enum.Enum):
@@ -46,7 +46,7 @@ class FunctionType(Type):
def set_return_type(self, type: Type) -> FunctionType: ...
def add_parameter(self, type: Type) -> Optional[Parameter]: ...
def add_parameter(self, type: Type) -> Optional[FunctionType.Parameter]: ...
class TypeDef(Type):
pass
@@ -64,9 +64,9 @@ class StructType(Type):
def set_size(self, size: int) -> StructType: ...
def add_member(self, name: str, type: Type, offset: int = -1) -> Optional[Member]: ...
def add_member(self, name: str, type: Type, offset: int = -1) -> Optional[StructType.Member]: ...
def add_bitfield(self, name: str, type: Type, bitsize: int, bitoffset: int = -1) -> Optional[Member]: ...
def add_bitfield(self, name: str, type: Type, bitsize: int, bitoffset: int = -1) -> Optional[StructType.Member]: ...
class Function:
class range_t:
@@ -105,19 +105,19 @@ class Function:
def set_low_high(self, low: int, high: int) -> Function: ...
def set_ranges(self, ranges: Sequence[range_t]) -> Function: ...
def set_ranges(self, ranges: Sequence[Function.range_t]) -> Function: ...
def set_external(self) -> Function: ...
def set_return_type(self, type: Type) -> Function: ...
def add_parameter(self, name: str, type: Type) -> Optional[Parameter]: ...
def add_parameter(self, name: str, type: Type) -> Optional[Function.Parameter]: ...
def create_stack_variable(self, name: str) -> Optional[Variable]: ...
def add_lexical_block(self, start: int, end: int) -> Optional[LexicalBlock]: ...
def add_lexical_block(self, start: int, end: int) -> Optional[Function.LexicalBlock]: ...
def add_label(self, addr: int, label: str) -> Optional[Label]: ...
def add_label(self, addr: int, label: str) -> Optional[Function.Label]: ...
def add_description(self, description: str) -> Function: ...
+1 -1
View File
@@ -1,4 +1,4 @@
from typing import Iterator, Optional, Union
from typing import Optional
import lief.dwarf
+4 -3
View File
@@ -1,5 +1,6 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union as _Union
from typing import Optional
import lief.dwarf
@@ -30,7 +31,7 @@ class ClassLike(lief.dwarf.Type):
@property
def members(self) -> list[ClassLike.Member]: ...
def find_member(self, offset: int) -> Optional[Member]: ...
def find_member(self, offset: int) -> Optional[ClassLike.Member]: ...
@property
def functions(self) -> Iterator[Optional[lief.dwarf.Function]]: ...
@@ -121,7 +122,7 @@ class Enum(lief.dwarf.Type):
@property
def underlying_type(self) -> lief.dwarf.Type | None: ...
def find_entry(self, value: int) -> Entry | None: ...
def find_entry(self, value: int) -> Enum.Entry | None: ...
class File(lief.dwarf.Type):
pass
+1 -1
View File
@@ -1,6 +1,6 @@
import enum
import os
from typing import Iterator, Optional, Union, overload
from typing import Union, overload
class Level(enum.Enum):
+2 -1
View File
@@ -1,4 +1,5 @@
from typing import Iterator, Optional, Union
from collections.abc import Iterator
from typing import Optional
class DeclOpt:
+3 -2
View File
@@ -1,9 +1,10 @@
from collections.abc import Iterator
import enum
import os
from typing import Iterator, Optional, Union, overload
from typing import Optional, Union, overload
from . import types as types
import lief
from lief.pdb import types as types
def load(path: str) -> Optional[DebugInfo]: ...
+3 -2
View File
@@ -1,5 +1,6 @@
from collections.abc import Iterator
import enum
from typing import Iterator, Optional, Union as _Union
from typing import Optional
import lief.pdb
@@ -218,7 +219,7 @@ class Enum(lief.pdb.Type):
@property
def underlying_type(self) -> lief.pdb.Type | None: ...
def find_entry(self, value: int) -> Entry | None: ...
def find_entry(self, value: int) -> Enum.Entry | None: ...
class Function(lief.pdb.Type):
@property
+42 -22
View File
@@ -1,15 +1,21 @@
from collections.abc import Mapping
import enum
from typing import Any, Final, Iterator, Optional, Union, overload
from collections.abc import Iterator, Mapping
from typing import Any, Final, Optional, overload
from . import (
android as android,
linux as linux,
osx as osx,
windows as windows
)
import lief
import lief.assembly
from lief.runtime import (
android as android,
)
from lief.runtime import (
linux as linux,
)
from lief.runtime import (
osx as osx,
)
from lief.runtime import (
windows as windows,
)
class ARCH(enum.Enum):
@@ -21,6 +27,7 @@ class ARCH(enum.Enum):
RISCV64 = 3
class PLATFORMS(enum.Enum):
NONE = 0
@@ -34,12 +41,14 @@ class PLATFORMS(enum.Enum):
IOS = 5
enabled: bool = ...
platform: PLATFORMS = ...
arch: ARCH = ...
class Host:
name: Final[str] = ...
@@ -51,6 +60,7 @@ class Host:
cache_dir: Final[str] = ...
class Process:
class EnvVars:
@property
@@ -72,7 +82,8 @@ class Process:
@staticmethod
def get_env(key: str) -> str | None: ...
envs: Final[EnvVars] = ...
envs: Final[Process.EnvVars] = ...
class Module:
@property
@@ -100,14 +111,19 @@ class Module:
def __str__(self) -> str: ...
def modules() -> Iterator[Optional[Module]]: ...
def module_from_name(name: str) -> Optional[Module]: ...
def module_from_path(path: str) -> Optional[Module]: ...
def module_from_addr(addr: int) -> Optional[Module]: ...
class Memory:
class MMAP_FLAGS(enum.IntFlag):
def __repr__(self, /): ...
@@ -124,17 +140,17 @@ class Memory:
JIT = 16
NONE: PERM = ...
NONE: Memory.PERM = ...
PRIVATE: MMAP_FLAGS = ...
PRIVATE: Memory.MMAP_FLAGS = ...
ANONYMOUS: MMAP_FLAGS = ...
ANONYMOUS: Memory.MMAP_FLAGS = ...
SHARED: MMAP_FLAGS = ...
SHARED: Memory.MMAP_FLAGS = ...
FIXED: MMAP_FLAGS = ...
FIXED: Memory.MMAP_FLAGS = ...
JIT: MMAP_FLAGS = ...
JIT: Memory.MMAP_FLAGS = ...
class PERM(enum.IntFlag):
def __repr__(self, /): ...
@@ -147,11 +163,11 @@ class Memory:
EXEC = 4
READ: PERM = ...
READ: Memory.PERM = ...
WRITE: PERM = ...
WRITE: Memory.PERM = ...
EXEC: PERM = ...
EXEC: Memory.PERM = ...
class Chunk:
@overload
@@ -204,13 +220,13 @@ class Memory:
def __str__(self) -> str: ...
@staticmethod
def mmap(size: int, flags: int, permissions: int = 0) -> Chunk | None: ...
def mmap(size: int, flags: int, permissions: int = 0) -> Memory.Chunk | None: ...
@staticmethod
def munmap(chunk: Chunk) -> lief.ok_error_t: ...
def munmap(chunk: Memory.Chunk) -> lief.ok_error_t: ...
@staticmethod
def mprotect(chunk: Chunk, flags: int) -> lief.ok_error_t: ...
def mprotect(chunk: Memory.Chunk, flags: int) -> lief.ok_error_t: ...
@staticmethod
def perm_str(flags: int) -> str: ...
@@ -283,6 +299,10 @@ class Memory:
@staticmethod
def read_i64(addr: int) -> int: ...
def disassemble(addr: int) -> Iterator[Optional[lief.assembly.Instruction]]: ...
def assemble(address: int, assembly: str, config: lief.assembly.AssemblerConfig = ...) -> bytes: ...
def assemble(
address: int, assembly: str, config: lief.assembly.AssemblerConfig = ...
) -> bytes: ...
+1 -1
View File
@@ -1,5 +1,5 @@
import os
from typing import Any, Final, Iterator, Optional, Union, overload
from typing import Any, Final, Optional, Union, overload
import lief.ELF
import lief.runtime
+1 -1
View File
@@ -1,5 +1,5 @@
import os
from typing import Any, Final, Iterator, Optional, Union, overload
from typing import Any, Final, Optional, Union, overload
import lief.ELF
import lief.runtime
+2 -2
View File
@@ -1,5 +1,5 @@
import os
from typing import Any, Final, Iterator, Optional, Union, overload
from typing import Any, Final, Optional, Union, overload
import lief.MachO
import lief.runtime
@@ -72,7 +72,7 @@ class Host:
os_version_name: Final[str] = ...
os_version: Final[version_t] = ...
os_version: Final[Host.version_t] = ...
is_sip_enabled: Final[bool] = ...
+3 -3
View File
@@ -1,6 +1,6 @@
from collections.abc import Mapping
from collections.abc import Iterator, Mapping
import os
from typing import Any, Final, Iterator, Optional, Union, overload
from typing import Any, Final, Optional, Union, overload
import lief
import lief.PE
@@ -60,7 +60,7 @@ class Host:
def __str__(self) -> str: ...
version: Final[version_t] = ...
version: Final[Host.version_t] = ...
class LdrDataTableEntry:
@property
+1 -1
View File
@@ -9,7 +9,7 @@ authors = [
{name = "Romain Thomas", email = "contact@lief.re"},
]
description = "Library to instrument executable formats"
requires-python = ">=3.9"
requires-python = ">=3.10"
keywords = ["parser", "elf", "pe", "macho", "reverse-engineering"]
license = {text = "Apache License 2.0"}
classifiers = [
+1 -1
View File
@@ -13,7 +13,7 @@ template<>
struct type_caster<LIEF::PE::ResourceDialog::ordinal_or_str_t> {
NB_TYPE_CASTER(LIEF::PE::ResourceDialog::ordinal_or_str_t, const_name("Optional[Union[int, str]]"));
bool from_python(handle, uint8_t, cleanup_list *) noexcept {
bool from_python(handle, uint32_t, cleanup_list *) noexcept {
return false;
}
@@ -9,7 +9,7 @@ struct type_caster<LIEF::assembly::aarch64::operands::Memory::offset_t> {
NB_TYPE_CASTER(LIEF::assembly::aarch64::operands::Memory::offset_t,
const_name("Optional[Union[lief.assembly.aarch64.REG, int]]"));
bool from_python(handle, uint8_t, cleanup_list *) noexcept {
bool from_python(handle, uint32_t, cleanup_list *) noexcept {
return false;
}
@@ -9,7 +9,7 @@ struct type_caster<LIEF::assembly::aarch64::operands::Register::reg_t> {
NB_TYPE_CASTER(LIEF::assembly::aarch64::operands::Register::reg_t,
const_name("Optional[Union[lief.assembly.aarch64.REG, lief.assembly.aarch64.SYSREG]]"));
bool from_python(handle, uint8_t, cleanup_list *) noexcept {
bool from_python(handle, uint32_t, cleanup_list *) noexcept {
return false;
}
@@ -9,7 +9,7 @@ struct type_caster<LIEF::assembly::mips::operands::Memory::offset_t> {
NB_TYPE_CASTER(LIEF::assembly::mips::operands::Memory::offset_t,
const_name("Optional[Union[lief.assembly.mips.REG, int]]"));
bool from_python(handle, uint8_t, cleanup_list *) noexcept {
bool from_python(handle, uint32_t, cleanup_list *) noexcept {
return false;
}
@@ -9,7 +9,7 @@ struct type_caster<LIEF::assembly::powerpc::operands::Memory::offset_t> {
NB_TYPE_CASTER(LIEF::assembly::powerpc::operands::Memory::offset_t,
const_name("Optional[Union[lief.assembly.powerpc.REG, int]]"));
bool from_python(handle, uint8_t, cleanup_list *) noexcept {
bool from_python(handle, uint32_t, cleanup_list *) noexcept {
return false;
}
+1 -2
View File
@@ -9,8 +9,7 @@ namespace LIEF::assembly::py {
class PyAssemblerConfig : public assembly::AssemblerConfig {
public:
static constexpr auto NB_NUM_SLOTS = 3;
NB_TRAMPOLINE(assembly::AssemblerConfig, NB_NUM_SLOTS);
NB_TRAMPOLINE(assembly::AssemblerConfig);
std::optional<uint64_t> resolve_symbol(const std::string& name) override {
NB_OVERRIDE(resolve_symbol, name);
@@ -9,7 +9,7 @@ struct type_caster<LIEF::assembly::riscv::operands::Register::reg_t> {
NB_TYPE_CASTER(LIEF::assembly::riscv::operands::Register::reg_t,
const_name("Optional[Union[lief.assembly.riscv.REG, lief.assembly.riscv.SYSREG]]"));
bool from_python(handle, uint8_t, cleanup_list *) noexcept {
bool from_python(handle, uint32_t, cleanup_list *) noexcept {
return false;
}
+1 -1
View File
@@ -36,7 +36,7 @@ public:
PyObject *ptr = PyMemoryView_FromMemory(
reinterpret_cast<char *>(mem), size, (readonly) ? PyBUF_READ : PyBUF_WRITE);
if (!ptr) {
detail::fail("Could not allocate memoryview object!");
detail::raise_python_error();
}
return memoryview(object(ptr, detail::steal_t{}));
}
@@ -15,7 +15,7 @@ class TypedRandomIterator : public nanobind::iterator {
{}
};
template <typename Access, rv_policy Policy, typename Iterator,
template <typename Access, rv_policy::value Policy, typename Iterator,
typename Sentinel, typename ValueType, typename... Extra>
struct random_iterator_state {
Iterator it;
@@ -24,7 +24,7 @@ struct random_iterator_state {
bool first_or_done;
};
template <typename Access, rv_policy Policy, typename Iterator,
template <typename Access, rv_policy::value Policy, typename Iterator,
typename Sentinel, typename ValueType, typename... Extra>
iterator make_rnd_iterator_impl(handle scope, const char *name,
Iterator &&first, Sentinel &&last,
@@ -49,10 +49,10 @@ iterator make_rnd_iterator_impl(handle scope, const char *name,
}
Iterator it = s.begin + i;
return Access()(it);
}, std::forward<Extra>(extra)..., Policy)
}, std::forward<Extra>(extra)..., rv_policy::policy_tag<Policy>())
.def("__next__",
[](State &s) -> ValueType {
[](State &s) -> iter_result<ValueType> {
if (!s.first_or_done)
++s.it;
else
@@ -60,13 +60,13 @@ iterator make_rnd_iterator_impl(handle scope, const char *name,
if (s.it == s.end) {
s.first_or_done = true;
throw stop_iteration();
return { };
}
return Access()(s.it);
},
std::forward<Extra>(extra)...,
Policy);
rv_policy::policy_tag<Policy>());
}
auto begin = first;
return borrow<iterator>(cast(State{ std::forward<Iterator>(first),
@@ -76,7 +76,7 @@ iterator make_rnd_iterator_impl(handle scope, const char *name,
}
template <rv_policy Policy = rv_policy::reference_internal,
template <rv_policy::value Policy = rv_policy::reference_internal_v,
typename Iterator,
typename Sentinel,
typename ValueType = typename detail::iterator_access<Iterator>::result_type,
@@ -88,7 +88,7 @@ detail::TypedRandomIterator<ValueType> make_random_access_iterator(handle scope,
std::forward<Sentinel>(last), std::forward<Extra>(extra)...);
}
template <rv_policy Policy = rv_policy::reference_internal,
template <rv_policy::value Policy = rv_policy::reference_internal_v,
typename Type,
typename ValueType = typename detail::iterator_access<typename Type::IteratorTy>::result_type,
typename... Extra>
@@ -16,7 +16,7 @@ struct type_caster<LIEF::result<T>> {
const_name("Union[") + Caster::Name + const_name(",") + const_name("lief.lief_errors") + const_name("]"));
bool from_python(handle src, uint8_t flags, cleanup_list * cleanup) noexcept {
bool from_python(handle src, uint32_t flags, cleanup_list * cleanup) noexcept {
Caster caster;
if (!caster.from_python(src, flags_for_local_caster<T>(flags), cleanup) ||
!caster.template can_cast<T>())
@@ -1,7 +1,6 @@
#pragma once
#include <nanobind/nanobind.h>
#include <string>
#include "LIEF/span.hpp"
@@ -18,7 +17,7 @@ struct type_caster<LIEF::span<T>> {
NB_TYPE_CASTER(LIEF::span<T>, const_name("memoryview"));
bool from_python(handle /*src*/, uint8_t, cleanup_list *) noexcept {
bool from_python(handle /*src*/, uint32_t, cleanup_list *) noexcept {
return false;
}
@@ -30,13 +29,8 @@ struct type_caster<LIEF::span<T>> {
mem = (void*)&empty;
}
PyObject *ptr = PyMemoryView_FromMemory(
return PyMemoryView_FromMemory(
reinterpret_cast<char *>(mem), val.size(), IsRO ? PyBUF_READ : PyBUF_WRITE);
if (!ptr) {
detail::fail("Could not allocate memoryview object!");
}
return ptr;
}
};
@@ -11,7 +11,7 @@ template <> struct type_caster<std::u16string> {
using CharT = typename std::u16string::value_type;
NB_TYPE_CASTER(std::u16string, const_name("str"));
bool from_python(handle src, uint8_t, cleanup_list *) noexcept {
bool from_python(handle src, uint32_t, cleanup_list *) noexcept {
const object Nbytes = steal(PyUnicode_AsUTF16String(src.ptr()));
if (!Nbytes) {
PyErr_Clear();
+1 -1
View File
@@ -9,7 +9,7 @@ NAMESPACE_BEGIN(detail)
template <> struct type_caster<std::wstring> {
NB_TYPE_CASTER(std::wstring, const_name("Union[str, bytes]"));
bool from_python(handle src, uint8_t, cleanup_list *) noexcept {
bool from_python(handle src, uint32_t, cleanup_list *) noexcept {
Py_ssize_t size;
const wchar_t *str = PyUnicode_AsWideCharString(src.ptr(), &size);
if (str == nullptr) {
+8
View File
@@ -55,6 +55,14 @@
section = coff.get_section(".debug_rnglists")
section.name # '/18'
section.coff_string.string # '.debug_rnglists'
:Dependencies:
* Update nanobind to version ``3.0.1``
:Python:
* Python 3.9 is no longer supported. nanobind 3 requires Python 3.10 or newer.
```
## 1.0.0 - July 12th, 2026
+1 -1
View File
@@ -11,7 +11,7 @@ To compile **LIEF**, you need at least the following:
- C++17 compiler (GCC, Clang, MSVC, etc.)
- CMake
- Python >= 3.9 (for the bindings)
- Python >= 3.10 (for the bindings)
:::{note}
Compiling from scratch with all options enabled can take approximately