| IDA SDK

Functions
Registers
Debugger functions

## Detailed Description

Inspect/Manipulate registers for debugged process.

The debugger structure defines a set of hardware registers in debugger_t::registers IDA also recognizes register names for each defined bit in bit registers. You can use all these names to set or get a register value.

For example, with the x86 Userland Win32 debugger you can use register names like:

- "EAX", ... "EBP", "ESP", "EFL": for classical integer registers
- "CS", "DS", ... : for segment registers
- "ST0", "ST1", ... : for FPU registers
- "CF", "PF", "AF", "ZF", ... : for special bit values

## Functions
bool idaapi | get_dbg_reg_info (const char *regname, register_info_t *ri)
| Get register information. More...
bool idaapi | get_reg_val (const char *regname, regval_t *regval)
| Read a register value from the current thread. More...
bool idaapi | get_reg_val (const char *regname, uint64 *ival)
| Get register value as an unsigned 64-bit int.
bool idaapi | get_sp_val (ea_t *out)
| Get value of the SP register for the current thread. More...
bool idaapi | get_ip_val (ea_t *out)
| Get value of the IP (program counter) register for the current thread. More...
bool idaapi | set_reg_val (const char *regname, const regval_t *regval)
| Write a register value to the current thread. More...
bool idaapi | set_reg_val (const char *regname, uint64 ival)
| Write a register value to the current thread.
bool idaapi | request_set_reg_val (const char *regname, const regval_t *regval)
| Post a set_reg_val() request.
bool idaapi | is_reg_integer (const char *regname)
| Does a register contain an integer value? More...
bool idaapi | is_reg_float (const char *regname)
| Does a register contain a floating point value? More...
bool idaapi | is_reg_custom (const char *regname)
| Does a register contain a value of a custom data type? More...

## Function Documentation

## ◆ get_dbg_reg_info()

bool idaapi get_dbg_reg_info | ( | const char * | regname,
|  | register_info_t * | ri
| ) |  |
| inline

Get register information.

Type | Synchronous function
Notification | none (synchronous function)

## ◆ get_reg_val()

bool idaapi get_reg_val | ( | const char * | regname,
|  | regval_t * | regval
| ) |  |
| inline

Read a register value from the current thread.

Type | Synchronous function
Notification | none (synchronous function)

## ◆ get_sp_val()

bool idaapi get_sp_val | ( | ea_t * | out | ) |
| inline

Get value of the SP register for the current thread.

Requires a suspended debugger.

## ◆ get_ip_val()

bool idaapi get_ip_val | ( | ea_t * | out | ) |
| inline

Get value of the IP (program counter) register for the current thread.

Requires a suspended debugger.

## ◆ set_reg_val()

bool idaapi set_reg_val | ( | const char * | regname,
|  | const regval_t * | regval
| ) |  |
| inline

Write a register value to the current thread.

Type | Synchronous function - available as Request
Notification | none (synchronous function)

## ◆ is_reg_integer()

bool idaapi is_reg_integer | ( | const char * | regname | ) |
| inline

Does a register contain an integer value?

Type | Synchronous function
Notification | none (synchronous function)

## ◆ is_reg_float()

bool idaapi is_reg_float | ( | const char * | regname | ) |
| inline

Does a register contain a floating point value?

Type | Synchronous function
Notification | none (synchronous function)

## ◆ is_reg_custom()

bool idaapi is_reg_custom | ( | const char * | regname | ) |
| inline

Does a register contain a value of a custom data type?

Type | Synchronous function
Notification | none (synchronous function)