libdebug package#
Subpackages#
- libdebug.architectures package
- Subpackages
- libdebug.architectures.amd64 package
- Submodules
- libdebug.architectures.amd64.amd64_ptrace_hw_bp_helper module
- libdebug.architectures.amd64.amd64_ptrace_register_holder module
- libdebug.architectures.amd64.amd64_registers module
- libdebug.architectures.amd64.amd64_stack_unwinder module
- libdebug.architectures.amd64.amd64_syscall_hijacker module
- Module contents
- libdebug.architectures.amd64 package
- Submodules
- libdebug.architectures.ptrace_hardware_breakpoint_manager module
PtraceHardwareBreakpointManager
PtraceHardwareBreakpointManager.thread
PtraceHardwareBreakpointManager.peek_user
PtraceHardwareBreakpointManager.poke_user
PtraceHardwareBreakpointManager.breakpoint_count
PtraceHardwareBreakpointManager.install_breakpoint()
PtraceHardwareBreakpointManager.remove_breakpoint()
PtraceHardwareBreakpointManager.available_breakpoints()
PtraceHardwareBreakpointManager.is_watchpoint_hit()
- libdebug.architectures.ptrace_hardware_breakpoint_provider module
- libdebug.architectures.ptrace_software_breakpoint_patcher module
- libdebug.architectures.register_helper module
- libdebug.architectures.stack_unwinding_manager module
- libdebug.architectures.stack_unwinding_provider module
- libdebug.architectures.syscall_hijacking_manager module
- libdebug.architectures.syscall_hijacking_provider module
- Module contents
- Subpackages
- libdebug.builtin package
- libdebug.cffi package
- libdebug.data package
- Submodules
- libdebug.data.breakpoint module
Breakpoint
Breakpoint.address
Breakpoint.symbol
Breakpoint.hit_count
Breakpoint.hardware
Breakpoint.condition
Breakpoint.length
Breakpoint.enabled
Breakpoint.address
Breakpoint.symbol
Breakpoint.hit_count
Breakpoint.hardware
Breakpoint.callback
Breakpoint.condition
Breakpoint.length
Breakpoint.enabled
Breakpoint.enable()
Breakpoint.disable()
Breakpoint.hit_on()
- libdebug.data.memory_map module
- libdebug.data.memory_view module
- libdebug.data.register_holder module
- libdebug.data.registers module
- libdebug.data.signal_catcher module
- libdebug.data.syscall_handler module
- Module contents
- libdebug.debugger package
- Submodules
- libdebug.debugger.debugger module
Debugger
Debugger.post_init_()
Debugger.run()
Debugger.attach()
Debugger.detach()
Debugger.kill()
Debugger.terminate()
Debugger.cont()
Debugger.interrupt()
Debugger.wait()
Debugger.maps()
Debugger.print_maps()
Debugger.breakpoint()
Debugger.watchpoint()
Debugger.hook_signal()
Debugger.unhook_signal()
Debugger.hijack_signal()
Debugger.hook_syscall()
Debugger.unhook_syscall()
Debugger.hijack_syscall()
Debugger.migrate_to_gdb()
Debugger.r()
Debugger.c()
Debugger.int()
Debugger.w()
Debugger.bp()
Debugger.wp()
Debugger.threads
Debugger.memory
Debugger.mem
Debugger.breakpoints
Debugger.syscall_hooks
Debugger.signal_hooks
Debugger.pprint_syscalls
Debugger.pprint_syscalls_context()
Debugger.syscalls_to_pprint
Debugger.syscalls_to_not_pprint
Debugger.signals_to_block
- libdebug.debugger.internal_debugger module
InternalDebugger
InternalDebugger.auto_interrupt_on_command
InternalDebugger.memory
InternalDebugger.debugging_interface
InternalDebugger.aslr_enabled
InternalDebugger.autoreach_entrypoint
InternalDebugger.argv
InternalDebugger.env
InternalDebugger.escape_antidebug
InternalDebugger.breakpoints
InternalDebugger.syscall_hooks
InternalDebugger.signal_hooks
InternalDebugger.syscalls_to_pprint
InternalDebugger.syscalls_to_not_pprint
InternalDebugger.signals_to_block
InternalDebugger.pprint_syscalls
InternalDebugger.pipe_manager
InternalDebugger.process_id
InternalDebugger.threads
InternalDebugger.instanced
InternalDebugger.resume_context
InternalDebugger.clear()
InternalDebugger.start_up()
InternalDebugger.start_processing_thread()
InternalDebugger.run()
InternalDebugger.attach()
InternalDebugger.detach()
InternalDebugger.kill()
InternalDebugger.terminate()
InternalDebugger.cont()
InternalDebugger.interrupt()
InternalDebugger.wait()
InternalDebugger.maps()
InternalDebugger.print_maps()
InternalDebugger.breakpoint()
InternalDebugger.hook_signal()
InternalDebugger.unhook_signal()
InternalDebugger.hijack_signal()
InternalDebugger.hook_syscall()
InternalDebugger.unhook_syscall()
InternalDebugger.hijack_syscall()
InternalDebugger.migrate_to_gdb()
InternalDebugger.step()
InternalDebugger.step_until()
InternalDebugger.finish()
InternalDebugger.enable_pretty_print()
InternalDebugger.disable_pretty_print()
InternalDebugger.insert_new_thread()
InternalDebugger.set_thread_as_dead()
InternalDebugger.get_thread_by_id()
InternalDebugger.resolve_address()
InternalDebugger.resolve_symbol()
InternalDebugger.running
InternalDebugger.set_running()
InternalDebugger.set_stopped()
- libdebug.debugger.internal_debugger_holder module
- libdebug.debugger.internal_debugger_instance_manager module
- Module contents
- libdebug.interfaces package
- Submodules
- libdebug.interfaces.debugging_interface module
DebuggingInterface
DebuggingInterface.reset()
DebuggingInterface.run()
DebuggingInterface.attach()
DebuggingInterface.detach()
DebuggingInterface.kill()
DebuggingInterface.cont()
DebuggingInterface.wait()
DebuggingInterface.migrate_to_gdb()
DebuggingInterface.migrate_from_gdb()
DebuggingInterface.step()
DebuggingInterface.step_until()
DebuggingInterface.finish()
DebuggingInterface.maps()
DebuggingInterface.set_breakpoint()
DebuggingInterface.unset_breakpoint()
DebuggingInterface.set_syscall_hook()
DebuggingInterface.unset_syscall_hook()
DebuggingInterface.set_signal_hook()
DebuggingInterface.unset_signal_hook()
DebuggingInterface.peek_memory()
DebuggingInterface.poke_memory()
- libdebug.interfaces.interface_helper module
- libdebug.interfaces.interfaces module
- Module contents
- libdebug.ptrace package
- Subpackages
- Submodules
- libdebug.ptrace.ptrace_constants module
StopEvents
Commands
Commands.PTRACE_TRACEME
Commands.PTRACE_PEEKTEXT
Commands.PTRACE_PEEKDATA
Commands.PTRACE_PEEKUSER
Commands.PTRACE_POKETEXT
Commands.PTRACE_POKEDATA
Commands.PTRACE_POKEUSER
Commands.PTRACE_CONT
Commands.PTRACE_KILL
Commands.PTRACE_SINGLESTEP
Commands.PTRACE_GETREGS
Commands.PTRACE_SETREGS
Commands.PTRACE_GETFPREGS
Commands.PTRACE_SETFPREGS
Commands.PTRACE_ATTACH
Commands.PTRACE_DETACH
Commands.PTRACE_GETFPXREGS
Commands.PTRACE_SETFPXREGS
Commands.PTRACE_SYSCALL
Commands.PTRACE_SETOPTIONS
Commands.PTRACE_GETEVENTMSG
Commands.PTRACE_GETSIGINFO
Commands.PTRACE_SETSIGINFO
Commands.PTRACE_GETREGSET
Commands.PTRACE_SETREGSET
Commands.PTRACE_SEIZE
Commands.PTRACE_INTERRUPT
Commands.PTRACE_LISTEN
Commands.PTRACE_PEEKSIGINFO
Commands.PTRACE_GETSIGMASK
Commands.PTRACE_SETSIGMASK
Commands.PTRACE_SECCOMP_GET_FILTER
Commands.PTRACE_SECCOMP_GET_METADATA
Commands.PTRACE_GET_SYSCALL_INFO
- libdebug.ptrace.ptrace_interface module
PtraceInterface
PtraceInterface.process_id
PtraceInterface.detached
PtraceInterface.hardware_bp_helpers
PtraceInterface.reset()
PtraceInterface.run()
PtraceInterface.attach()
PtraceInterface.detach()
PtraceInterface.kill()
PtraceInterface.cont()
PtraceInterface.step()
PtraceInterface.step_until()
PtraceInterface.finish()
PtraceInterface.wait()
PtraceInterface.forward_signal()
PtraceInterface.migrate_to_gdb()
PtraceInterface.migrate_from_gdb()
PtraceInterface.register_new_thread()
PtraceInterface.unregister_thread()
PtraceInterface.set_breakpoint()
PtraceInterface.unset_breakpoint()
PtraceInterface.set_syscall_hook()
PtraceInterface.unset_syscall_hook()
PtraceInterface.set_signal_hook()
PtraceInterface.unset_signal_hook()
PtraceInterface.peek_memory()
PtraceInterface.poke_memory()
PtraceInterface.maps()
- libdebug.ptrace.ptrace_register_holder module
- libdebug.ptrace.ptrace_status_handler module
- Module contents
- libdebug.state package
- Submodules
- libdebug.state.resume_context module
- libdebug.state.thread_context module
ThreadContext
ThreadContext.instruction_pointer
ThreadContext.syscall_arg0
ThreadContext.syscall_arg1
ThreadContext.syscall_arg2
ThreadContext.syscall_arg3
ThreadContext.syscall_arg4
ThreadContext.syscall_arg5
ThreadContext.syscall_number
ThreadContext.syscall_return
ThreadContext.regs
ThreadContext.set_as_dead()
ThreadContext.dead
ThreadContext.memory
ThreadContext.process_id
ThreadContext.pid
ThreadContext.thread_id
ThreadContext.tid
ThreadContext.running
ThreadContext.exit_code
ThreadContext.exit_signal
ThreadContext.signal
ThreadContext.backtrace()
ThreadContext.current_return_address()
ThreadContext.step()
ThreadContext.step_until()
ThreadContext.finish()
ThreadContext.si()
ThreadContext.su()
ThreadContext.fin()
- Module contents
- libdebug.utils package
- Submodules
- libdebug.utils.debugger_wrappers module
- libdebug.utils.debugging_utils module
- libdebug.utils.elf_utils module
- libdebug.utils.gdb module
- libdebug.utils.libcontext module
- libdebug.utils.pipe_manager module
- libdebug.utils.posix_spawn module
- libdebug.utils.print_style module
- libdebug.utils.process_utils module
- libdebug.utils.signal_utils module
- libdebug.utils.syscall_utils module
- Module contents
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:
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.
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: