Utilities

lief.is_pe(*args) bool
lief.is_pe(raw: list[int]) bool

Overloaded function.

  1. is_pe(file: str) -> bool

Check if the given file is a PE

  1. is_pe(raw: list[int]) -> bool

Check if the given raw data is a PE

lief.is_elf(*args) bool
lief.is_elf(raw: list[int]) bool

Overloaded function.

  1. is_elf(filename: str) -> bool

Check if the given file is an ELF

  1. is_elf(raw: list[int]) -> bool

Check if the given raw data is an ELF

lief.is_macho(*args) bool
lief.is_macho(raw: list[int]) bool

Overloaded function.

  1. is_macho(filename: str) -> bool

Check if the given file is a MachO (from filename)

  1. is_macho(raw: list[int]) -> bool

Check if the given raw data is a MachO

lief.is_oat(*args) bool
lief.is_oat(path: str) bool
lief.is_oat(raw: list[int]) bool

Overloaded function.

  1. is_oat(binary: lief._lief.ELF.Binary) -> bool

Check if the Binary given in parameter is an OAT

  1. is_oat(path: str) -> bool

Check if the file given in parameter is an OAT

  1. is_oat(raw: list[int]) -> bool

Check if the raw data given in parameter is an OAT

lief.is_dex(*args) bool
lief.is_dex(raw: list[int]) bool

Overloaded function.

  1. is_dex(path: str) -> bool

Check if the file given in parameter is a DEX

  1. is_dex(raw: list[int]) -> bool

Check if the raw data given in parameter is a DEX

lief.is_vdex(*args) bool
lief.is_vdex(raw: list[int]) bool

Overloaded function.

  1. is_vdex(path: str) -> bool

Check if the file given in parameter is an VDEX

  1. is_vdex(raw: list[int]) -> bool

Check if the raw data given in parameter is a VDEX

lief.is_art(*args) bool
lief.is_art(raw: list[int]) bool

Overloaded function.

  1. is_art(path: str) -> bool

Check if the file given in parameter is an ART

  1. is_art(raw: list[int]) -> bool

Check if the raw data given in parameter is a ART

lief.disable_leak_warning() None

Disable nanobind warnings about leaked objects. For instance:

nanobind: leaked 45 instances!
nanobind: leaked 25 types!
 - leaked type "lief._lief.FORMATS"
 - ... skipped remainder
nanobind: leaked 201 functions!
 - leaked function ""
 - leaked function "export_symbol"
 - ... skipped remainder
nanobind: this is likely caused by a reference counting issue in the binding code.