Python

Formats specific

Logging

lief.logging.set_level(level: lief.logging.LOGGING_LEVEL) None

Change logging level

lief.logging.enable() None

Enable the logger globally

lief.logging.disable() None

Disable the logger globally

Logging levels

class lief.logging.LOGGING_LEVEL(self: lief.logging.LOGGING_LEVEL, value: int) None

Members:

TRACE

DEBUG

CRITICAL

ERROR

WARNING

INFO

CRITICAL = <LOGGING_LEVEL.CRITICAL: 5>
DEBUG = <LOGGING_LEVEL.DEBUG: 1>
ERROR = <LOGGING_LEVEL.ERROR: 4>
INFO = <LOGGING_LEVEL.INFO: 2>
TRACE = <LOGGING_LEVEL.TRACE: 0>
WARNING = <LOGGING_LEVEL.WARNING: 3>
property name
property value

Error Handling

class lief.lief_errors(self: lief.lief_errors, value: int) None

Enum class which represents an error generated by LIEF’s functions

Members:

read_error

not_found

not_implemented

not_supported

corrupted

conversion_error

read_out_of_bound

asn1_bad_tag

file_error

file_format_error

parsing_error

build_error

data_too_large

asn1_bad_tag = <lief_errors.asn1_bad_tag: 8>
build_error = <lief_errors.build_error: 12>
conversion_error = <lief_errors.conversion_error: 6>
corrupted = <lief_errors.corrupted: 5>
data_too_large = <lief_errors.data_too_large: 13>
file_error = <lief_errors.file_error: 9>
file_format_error = <lief_errors.file_format_error: 10>
property name
not_found = <lief_errors.not_found: 2>
not_implemented = <lief_errors.not_implemented: 3>
not_supported = <lief_errors.not_supported: 4>
parsing_error = <lief_errors.parsing_error: 11>
read_error = <lief_errors.read_error: 1>
read_out_of_bound = <lief_errors.read_out_of_bound: 7>
property value
class lief.ok_t

Opaque value returned when a void function is executed successfully.

See also the section Error Handling

Exceptions

In the future versions of LIEF, the exceptions will be removed to be replaced with the ResultOrError idiom.

See: