public interface

IRegisterBank

com.pnfsoftware.jeb.core.units.code.asm.processor.IRegisterBank

Class Overview

Definition for bank of registers. The common names as well are indexes will be defined by contract. Note that a register value may not be known.

CONTRACTS FOR BANK LAYOUTS FOR COMMON PROCESSORS:

  • ARM (<=v7): a bank will contain at least the following 17 registers: GPR #0 through #15 are indexes 0-15 (names: "r0" through "r15"), and the CPSR is index 16 (name: "cpsr").
  • aarch64: ...
  • x86: ...
  • AMD64: ...

Summary

Public Methods
abstract byte[] getBytes(int index)
Get the binary value of a register.
abstract long getFlags()
This convenience method returns the value of the general purpose flag.
abstract String getName(int index)
Get the common name of a register.
abstract long getProgramCounter()
This convenience method returns the value of the program counter register.
abstract int getSize(int index)
Get the register size, in bits.
abstract int size()
Number of registers held in this bank.

Public Methods

public abstract byte[] getBytes (int index)

Get the binary value of a register. This method returns null if the value is not available. The bytes are laid out in the target processor byte order.

Note: If the register size is not a multiple of 8, the resulting integer value should be masked to discard the irrelevant upper bits.

Parameters
index register index, should be less than size()

public abstract long getFlags ()

This convenience method returns the value of the general purpose flag. Which register(s) that value maps to is processor-dependent.

Returns
  • the GP flags value, 0 if none

public abstract String getName (int index)

Get the common name of a register.

Parameters
index register index, should be less than size()

public abstract long getProgramCounter ()

This convenience method returns the value of the program counter register. The value should be interpreted as an unsigned 64-bit integer.

Returns
  • the value of PC, 0 if the value is unknown

public abstract int getSize (int index)

Get the register size, in bits.

Parameters
index register index, should be less than size()

public abstract int size ()

Number of registers held in this bank.