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
PtraceHardwareBreakpointManagerPtraceHardwareBreakpointManager.threadPtraceHardwareBreakpointManager.peek_userPtraceHardwareBreakpointManager.poke_userPtraceHardwareBreakpointManager.breakpoint_countPtraceHardwareBreakpointManager.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
BreakpointBreakpoint.addressBreakpoint.symbolBreakpoint.hit_countBreakpoint.hardwareBreakpoint.conditionBreakpoint.lengthBreakpoint.enabledBreakpoint.addressBreakpoint.symbolBreakpoint.hit_countBreakpoint.hardwareBreakpoint.callbackBreakpoint.conditionBreakpoint.lengthBreakpoint.enabledBreakpoint.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
DebuggerDebugger.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.threadsDebugger.memoryDebugger.memDebugger.breakpointsDebugger.syscall_hooksDebugger.signal_hooksDebugger.pprint_syscallsDebugger.pprint_syscalls_context()Debugger.syscalls_to_pprintDebugger.syscalls_to_not_pprintDebugger.signals_to_block
- libdebug.debugger.internal_debugger module
InternalDebuggerInternalDebugger.auto_interrupt_on_commandInternalDebugger.memoryInternalDebugger.debugging_interfaceInternalDebugger.aslr_enabledInternalDebugger.autoreach_entrypointInternalDebugger.argvInternalDebugger.envInternalDebugger.escape_antidebugInternalDebugger.breakpointsInternalDebugger.syscall_hooksInternalDebugger.signal_hooksInternalDebugger.syscalls_to_pprintInternalDebugger.syscalls_to_not_pprintInternalDebugger.signals_to_blockInternalDebugger.pprint_syscallsInternalDebugger.pipe_managerInternalDebugger.process_idInternalDebugger.threadsInternalDebugger.instancedInternalDebugger.resume_contextInternalDebugger.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.runningInternalDebugger.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
DebuggingInterfaceDebuggingInterface.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
StopEventsCommandsCommands.PTRACE_TRACEMECommands.PTRACE_PEEKTEXTCommands.PTRACE_PEEKDATACommands.PTRACE_PEEKUSERCommands.PTRACE_POKETEXTCommands.PTRACE_POKEDATACommands.PTRACE_POKEUSERCommands.PTRACE_CONTCommands.PTRACE_KILLCommands.PTRACE_SINGLESTEPCommands.PTRACE_GETREGSCommands.PTRACE_SETREGSCommands.PTRACE_GETFPREGSCommands.PTRACE_SETFPREGSCommands.PTRACE_ATTACHCommands.PTRACE_DETACHCommands.PTRACE_GETFPXREGSCommands.PTRACE_SETFPXREGSCommands.PTRACE_SYSCALLCommands.PTRACE_SETOPTIONSCommands.PTRACE_GETEVENTMSGCommands.PTRACE_GETSIGINFOCommands.PTRACE_SETSIGINFOCommands.PTRACE_GETREGSETCommands.PTRACE_SETREGSETCommands.PTRACE_SEIZECommands.PTRACE_INTERRUPTCommands.PTRACE_LISTENCommands.PTRACE_PEEKSIGINFOCommands.PTRACE_GETSIGMASKCommands.PTRACE_SETSIGMASKCommands.PTRACE_SECCOMP_GET_FILTERCommands.PTRACE_SECCOMP_GET_METADATACommands.PTRACE_GET_SYSCALL_INFO
- libdebug.ptrace.ptrace_interface module
PtraceInterfacePtraceInterface.process_idPtraceInterface.detachedPtraceInterface.hardware_bp_helpersPtraceInterface.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
ThreadContextThreadContext.instruction_pointerThreadContext.syscall_arg0ThreadContext.syscall_arg1ThreadContext.syscall_arg2ThreadContext.syscall_arg3ThreadContext.syscall_arg4ThreadContext.syscall_arg5ThreadContext.syscall_numberThreadContext.syscall_returnThreadContext.regsThreadContext.set_as_dead()ThreadContext.deadThreadContext.memoryThreadContext.process_idThreadContext.pidThreadContext.thread_idThreadContext.tidThreadContext.runningThreadContext.exit_codeThreadContext.exit_signalThreadContext.signalThreadContext.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:
objectCustom 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: