Skip to content

regs_mod ¤

Reading register value from the inferior, and provides a standardized interface to registers like "sp" and "pc".

Classes:

Functions:

Attributes:

PTRACE_ARCH_PRCTL module-attribute ¤

PTRACE_ARCH_PRCTL = 30

ARCH_GET_FS module-attribute ¤

ARCH_GET_FS = 4099

ARCH_GET_GS module-attribute ¤

ARCH_GET_GS = 4100

regs module-attribute ¤

RegisterManager ¤

Methods:

Attributes:

previous class-attribute instance-attribute ¤

previous: dict[str, int | None] = {}

last class-attribute instance-attribute ¤

last: dict[str, int | None] = {}

pc property writable ¤

pc: int | None

Get the value of the program counter register

sp property writable ¤

sp: int | None

Get the value of the stack pointer register

current property ¤

current: RegisterSet

gpr property ¤

gpr: tuple[str, ...]

common property ¤

common: list[str]

frame property ¤

frame: str | None

retaddr property ¤

retaddr: tuple[str, ...]

kernel property ¤

kernel: KernelRegisterSet | None

flags property ¤

flags: dict[str, BitFlags]

extra_flags property ¤

extra_flags: dict[str, BitFlags]

stack property ¤

stack: str

retval property ¤

retval: str | None

all property ¤

all: set[str]

reg_sets class-attribute instance-attribute ¤

reg_sets = reg_sets

changed property ¤

changed: list[str]

idt property ¤

idt: int | None

idt_limit property ¤

idt_limit: int | None

fsbase property ¤

fsbase: int

gsbase property ¤

gsbase: int

regs_in_frame ¤

regs_in_frame(frame: Frame) -> Registers

get_register ¤

get_register(name: str, frame: Frame) -> Value | None

get_qemu_register ¤

get_qemu_register(name: str) -> int | None

read_reg_uncached_in_frame ¤

read_reg_uncached_in_frame(reg: str, frame: Frame) -> int | None

read_reg_uncached ¤

read_reg_uncached(reg: str) -> int | None

read_reg_in_frame ¤

read_reg_in_frame(reg: str, frame: Frame) -> int | None

Same as read_reg() except for the provided frame, rather than the currently selected frame.

read_reg ¤

read_reg(reg: str) -> int | None

Query the underlying debugger for the value of a register.

Note that in some rare cases, debuggers won't directly expose the values of some special model specific registers. Although we can sometimes determine these by other indirect means, this function does not run any extra logic to handle these special cases.

Specifically, if you need to ensure you are reading the correct value of "gs", "fs", "idt", or "idt_limit", use the specific helpers functions on the regs module as necessary to determine the values.

Use read_reg_in_frame() if you have a frame object, its faster.

write_reg ¤

write_reg(reg: str, value: int) -> None

__contains__ ¤

__contains__(reg: str) -> bool

__iter__ ¤

__iter__() -> Iterator[str]

fix ¤

fix(expression: str) -> str

This is used in CLI parsing. It takes in a string with a register name, "rax", and prefixes it with a $ ("$rax") so that the underlying debugger can evaluate it to resolve the value

items ¤

items() -> Generator[tuple[str, Any], None, None]

update_last ¤

update_last() -> None