libdebug package#

Subpackages#

Submodules#

libdebug.libdebug module#

libdebug.libdebug.debugger(argv: str | list[str] = [], enable_aslr: bool = False, env: dict[str, str] | None = None, escape_antidebug: bool = False, continue_to_binary_entrypoint: bool = True, auto_interrupt_on_command: bool = False) Debugger[source]#

This function is used to create a new Debugger object. It returns a Debugger object.

Parameters:
  • argv (str | list[str], optional) – The location of the binary to debug, and any additional arguments to pass to it.

  • enable_aslr (bool, optional) – Whether to enable ASLR. Defaults to False.

  • env (dict[str, str], optional) – The environment variables to use. Defaults to the same environment of the debugging script.

  • escape_antidebug (bool) – Whether to automatically attempt to patch antidebugger detectors based on the ptrace syscall.

  • continue_to_binary_entrypoint (bool, optional) – Whether to automatically continue to the binary entrypoint. Defaults to True.

  • auto_interrupt_on_command (bool, optional) – Whether to automatically interrupt the process when a command is issued. Defaults to False.

Returns:

The Debugger object.

Return type:

Debugger

libdebug.liblog module#

class libdebug.liblog.LibLog[source]#

Bases: object

Custom logger singleton class that can be used to log messages to the console.

debugger(message: str, *args: str, **kwargs: str) None[source]#

Log a message to the debugger logger.

Parameters:
  • message (str) – the message to log.

  • *args – positional arguments to pass to the logger.

  • **kwargs – keyword arguments to pass to the logger.

pipe(message: str, *args: str, **kwargs: str) None[source]#

Log a message to the pipe logger.

Parameters:
  • message (str) – the message to log.

  • *args – positional arguments to pass to the logger.

  • **kwargs – keyword arguments to pass to the logger.

info(message: str, *args: str, **kwargs: str) None[source]#

Log a info message to the general logger.

Parameters:
  • message (str) – the message to log.

  • *args – positional arguments to pass to the logger.

  • **kwargs – keyword arguments to pass to the logger.

warning(message: str, *args: str, **kwargs: str) None[source]#

Log a warning message to the general logger.

Parameters:
  • message (str) – the message to log.

  • *args – positional arguments to pass to the logger.

  • **kwargs – keyword arguments to pass to the logger.

error(message: str, *args: str, **kwargs: str) None[source]#

Log an error message to the general logger.

Parameters:
  • message (str) – the message to log.

  • *args – positional arguments to pass to the logger.

  • **kwargs – keyword arguments to pass to the logger.

Module contents#

libdebug.debugger(argv: str | list[str] = [], enable_aslr: bool = False, env: dict[str, str] | None = None, escape_antidebug: bool = False, continue_to_binary_entrypoint: bool = True, auto_interrupt_on_command: bool = False) Debugger[source]#

This function is used to create a new Debugger object. It returns a Debugger object.

Parameters:
  • argv (str | list[str], optional) – The location of the binary to debug, and any additional arguments to pass to it.

  • enable_aslr (bool, optional) – Whether to enable ASLR. Defaults to False.

  • env (dict[str, str], optional) – The environment variables to use. Defaults to the same environment of the debugging script.

  • escape_antidebug (bool) – Whether to automatically attempt to patch antidebugger detectors based on the ptrace syscall.

  • continue_to_binary_entrypoint (bool, optional) – Whether to automatically continue to the binary entrypoint. Defaults to True.

  • auto_interrupt_on_command (bool, optional) – Whether to automatically interrupt the process when a command is issued. Defaults to False.

Returns:

The Debugger object.

Return type:

Debugger