binaryninja::architecture::register

Trait RegisterStackInfo

source
pub trait RegisterStackInfo: Sized {
    type RegStackType: RegisterStack<InfoType = Self>;
    type RegType: Register<InfoType = Self::RegInfoType>;
    type RegInfoType: RegisterInfo<RegType = Self::RegType>;

    // Required methods
    fn storage_regs(&self) -> (Self::RegType, usize);
    fn top_relative_regs(&self) -> Option<(Self::RegType, usize)>;
    fn stack_top_reg(&self) -> Self::RegType;
}
Expand description

Information about a register stack.

Required Associated Types§

source

type RegStackType: RegisterStack<InfoType = Self>

source

type RegType: Register<InfoType = Self::RegInfoType>

source

type RegInfoType: RegisterInfo<RegType = Self::RegType>

Required Methods§

source

fn storage_regs(&self) -> (Self::RegType, usize)

The sequence of physical registers that back this stack.

This defines the absolute storage locations in the hardware, ignoring the current stack pointer.

Return the start of the “fake” registers defined. The core requires that the id’s be contiguous as you only return the first storage register and the count.

§Example (x87 FPU)

RegisterStackInfo::top_relative_regs with (REG_ST0, 8) and then define here (REG_PHYSICAL_0, 8).

source

fn top_relative_regs(&self) -> Option<(Self::RegType, usize)>

The sequence of registers used to access the stack relative to the current top.

Return the start of the relative registers defined. The core requires that the id’s be contiguous as you only return the first relative register and the count.

§Example (x87 FPU)

Returns (REG_ST0, 8), where the id’s of all the later relative registers are contiguous.

source

fn stack_top_reg(&self) -> Self::RegType

The specific register that holds the index of the current stack top.

The value in this register determines which physical storage_reg corresponds to the first top_relative_reg.

§Example (x87 FPU)

Returns the TOP as a fake register.

  • If TOP == 0: top_relative_regs[0] maps to storage_regs[0].
  • If TOP == 1: top_relative_regs[0] maps to storage_regs[1].

Object Safety§

This trait is not object safe.

Implementors§