libdebug.architectures package#
Subpackages#
- libdebug.architectures.amd64 package
- Submodules
- libdebug.architectures.amd64.amd64_ptrace_hw_bp_helper module
Amd64PtraceHardwareBreakpointManager
Amd64PtraceHardwareBreakpointManager.thread
Amd64PtraceHardwareBreakpointManager.peek_user
Amd64PtraceHardwareBreakpointManager.poke_user
Amd64PtraceHardwareBreakpointManager.breakpoint_count
Amd64PtraceHardwareBreakpointManager.install_breakpoint()
Amd64PtraceHardwareBreakpointManager.remove_breakpoint()
Amd64PtraceHardwareBreakpointManager.available_breakpoints()
Amd64PtraceHardwareBreakpointManager.is_watchpoint_hit()
- 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
Submodules#
libdebug.architectures.ptrace_hardware_breakpoint_manager module#
- class libdebug.architectures.ptrace_hardware_breakpoint_manager.PtraceHardwareBreakpointManager(thread: ThreadContext, peek_user: Callable[[int, int], int], poke_user: Callable[[int, int, int], None])[source]#
Bases:
ABC
An architecture-independent interface for managing hardware breakpoints.
- thread#
The target thread.
- Type:
- peek_user#
A function that reads a number of bytes from the target thread registers.
- Type:
callable
- poke_user#
A function that writes a number of bytes to the target thread registers.
- Type:
callable
- breakpoint_count#
The number of hardware breakpoints set.
- Type:
int
- abstract install_breakpoint(bp: Breakpoint) None [source]#
Installs a hardware breakpoint at the provided location.
- abstract remove_breakpoint(bp: Breakpoint) None [source]#
Removes a hardware breakpoint at the provided location.
- abstract available_breakpoints() int [source]#
Returns the number of available hardware breakpoint registers.
- abstract is_watchpoint_hit() Breakpoint | None [source]#
Checks if a watchpoint has been hit.
- Returns:
The watchpoint that has been hit, or None if no watchpoint has been hit.
- Return type:
Breakpoint | None
libdebug.architectures.ptrace_hardware_breakpoint_provider module#
- libdebug.architectures.ptrace_hardware_breakpoint_provider.ptrace_hardware_breakpoint_manager_provider(thread: ThreadContext, peek_user: Callable[[int, int], int], poke_user: Callable[[int, int, int], None]) PtraceHardwareBreakpointManager [source]#
Returns an instance of the hardware breakpoint manager to be used by the _InternalDebugger class.
libdebug.architectures.ptrace_software_breakpoint_patcher module#
libdebug.architectures.register_helper module#
- libdebug.architectures.register_helper.register_holder_provider(register_file: object, _: Callable[[], object] | None = None, __: Callable[[object], None] | None = None) RegisterHolder [source]#
Returns an instance of the register holder to be used by the _InternalDebugger class.
libdebug.architectures.stack_unwinding_manager module#
- class libdebug.architectures.stack_unwinding_manager.StackUnwindingManager[source]#
Bases:
ABC
An architecture-independent interface for stack unwinding.
- abstract unwind(target: ThreadContext) list [source]#
Unwind the stack of the target process.
- abstract get_return_address(target: ThreadContext) int [source]#
Get the return address of the current function.
libdebug.architectures.stack_unwinding_provider module#
- libdebug.architectures.stack_unwinding_provider.stack_unwinding_provider() StackUnwindingManager [source]#
Returns an instance of the stack unwinding provider to be used by the _InternalDebugger class.
libdebug.architectures.syscall_hijacking_manager module#
- class libdebug.architectures.syscall_hijacking_manager.SyscallHijackingManager[source]#
Bases:
ABC
An architecture-independent interface for syscall hijacking.
- abstract create_hijacker(new_syscall: int, **kwargs: int) Callable[[ThreadContext, int], None] [source]#
Create a new hijacker for the given syscall.
libdebug.architectures.syscall_hijacking_provider module#
- libdebug.architectures.syscall_hijacking_provider.syscall_hijacking_provider() SyscallHijackingManager [source]#
Returns an instance of the syscall hijacking provider to be used by the _InternalDebugger class.