PE¶
- class cle.backends.PE[source]¶
Bases:
BackendRepresentation of a PE (i.e. Windows) binary.
Useful backend options:
debug_symbols: Provides the path to a PDB file which contains the binary’s debug symbolsdebug_symbol_dirs: List of directories to search for PDB files (searched before symbol servers)debug_symbol_path_str: A string indicating symbol search paths, which may be provided in the_NT_SYMBOL_PATH format.
download_debug_symbols: Whether to attempt downloading debug symbols from symbol servers (if provided) ornot. Default to False.
download_debug_symbol_confirm: A callable that takes a URL string and returns True if downloading the debugsymbol from the URL is allowed by the user, False otherwise.
download_debug_symbol_progress: A callable that takes two integer arguments: bytes downloaded and total bytes.This callable is called periodically to report download progress.
search_microsoft_symserver: Whether to include the Microsoft symbol server in symbol searches. Default toTrue. Requires
download_debug_symbolsto be True to have any effect.
- is_default = True¶
- __init__(*args, debug_symbols=None, debug_symbol_dirs=None, debug_symbol_path_str: str | None = None, download_debug_symbols: bool = False, download_debug_symbol_confirm: Callable[[str], bool] | None = None, download_debug_symbol_progress: Callable[[int, int | None], bool] | None = None, search_microsoft_symserver: bool = True, **kwargs)[source]¶
- Parameters:
binary – The path to the binary to load
binary_stream – The open stream to this binary. The reference to this will be held until you call close.
is_main_bin – Whether this binary should be loaded as the main executable
debug_symbol_path_str (str | None)
download_debug_symbols (bool)
download_debug_symbol_confirm (Callable[[str], bool] | None)
download_debug_symbol_progress (Callable[[int, int | None], bool] | None)
search_microsoft_symserver (bool)
- classmethod is_compatible(stream)[source]¶
Determine quickly whether this backend can load an object from this stream
- classmethod check_magic_compatibility(stream)[source]¶
Check if a stream of bytes contains the same magic number as the main object
- classmethod check_compatibility(spec, obj)[source]¶
Performs a minimal static load of
specand returns whether it’s compatible with other_obj
- class cle.backends.pe.regions.PESection[source]¶
Bases:
SectionRepresents a section for the PE format.
- property is_readable¶
Whether this section has read permissions
- property is_writable¶
Whether this section has write permissions
- property is_executable¶
Whether this section has execute permissions
- property only_contains_uninitialized_data¶
Whether this section is initialized to zero after the executable is loaded.