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

lief.logging.set_path(path: str) None

Change the logger as a file-base logging and set its path

Logging levels

class lief.logging.LOGGING_LEVEL

Bases: object

CRITICAL = lief._lief.logging.LOGGING_LEVEL.CRITICAL
DEBUG = lief._lief.logging.LOGGING_LEVEL.DEBUG
ERROR = lief._lief.logging.LOGGING_LEVEL.ERROR
INFO = lief._lief.logging.LOGGING_LEVEL.INFO
TRACE = lief._lief.logging.LOGGING_LEVEL.TRACE
WARNING = lief._lief.logging.LOGGING_LEVEL.WARNING

Error Handling

class lief.lief_errors

Bases: object

asn1_bad_tag = lief._lief.lief_errors.asn1_bad_tag
build_error = lief._lief.lief_errors.build_error
conversion_error = lief._lief.lief_errors.conversion_error
corrupted = lief._lief.lief_errors.corrupted
data_too_large = lief._lief.lief_errors.data_too_large
file_error = lief._lief.lief_errors.file_error
file_format_error = lief._lief.lief_errors.file_format_error
not_found = lief._lief.lief_errors.not_found
not_implemented = lief._lief.lief_errors.not_implemented
not_supported = lief._lief.lief_errors.not_supported
parsing_error = lief._lief.lief_errors.parsing_error
read_error = lief._lief.lief_errors.read_error
read_out_of_bound = lief._lief.lief_errors.read_out_of_bound
class lief.ok_t

Bases: object

Opaque value returned when a void function is executed successfully.

class lief.ok_error_t

Bases: object

Return either: ok_t (success) or lief_errors (error)

property error lief.lief_errors
property is_error bool
property is_value bool
property value lief.ok_t

See also the section Error Handling

Exceptions

LIEF no longer uses exceptions which have been replaced with the ResultOrError idiom.

See: