ida_registry

Registry related functions.

IDA uses the registry to store global configuration options that must persist after IDA has been closed. On Windows, IDA uses the Windows registry directly. On Unix systems, the registry is stored in a file (typically ~/.idapro/ida.reg). The root key for accessing IDA settings in the registry is defined by ROOT_KEY_NAME.

Attributes

SWIG_PYTHON_LEGACY_BOOL

IDA_REGISTRY_NAME

HVUI_REGISTRY_NAME

ROOT_KEY_NAME

Default key used to store IDA settings in registry (Windows version).

reg_unknown

unknown

reg_sz

utf8 string

reg_binary

binary data

reg_dword

32-bit number

Functions

reg_read_string(→ PyObject *)

Read a string from the registry.

reg_data_type(→ regval_type_t)

Get data type of a given value.

reg_read_binary(→ PyObject *)

Read binary data from the registry.

reg_write_binary(→ PyObject *)

Write binary data to the registry.

reg_subkey_subkeys(→ PyObject *)

Get all subkey names of given key.

reg_subkey_values(→ PyObject *)

Get all value names under given key.

reg_delete_subkey(→ bool)

Delete a key from the registry.

reg_delete_tree(→ bool)

Delete a subtree from the registry.

reg_delete(→ bool)

Delete a value from the registry.

reg_subkey_exists(→ bool)

Is there already a key with the given name?

reg_exists(→ bool)

Is there already a value with the given name?

reg_read_strlist(→ List[str])

Retrieve all string values associated with the given key.

reg_write_strlist(items, subkey)

Write string values associated with the given key.

reg_update_strlist(subkey, add, maxrecs[, rem, ignorecase])

Add and/or remove items from the list, and possibly trim that list.

reg_write_string(→ None)

Write a string to the registry.

reg_read_int(→ int)

Read integer value from the registry.

reg_write_int(→ None)

Write integer value to the registry.

reg_read_bool(→ bool)

Read boolean value from the registry.

reg_write_bool(→ None)

Write boolean value to the registry.

reg_update_filestrlist(→ None)

Update registry with a file list. Case sensitivity will vary depending on the target OS.

set_registry_name(→ bool)

Module Contents

ida_registry.SWIG_PYTHON_LEGACY_BOOL
ida_registry.reg_read_string(name: str, subkey: str = None, _def: str = None) PyObject *

Read a string from the registry.

Parameters:
  • name – value name

  • subkey – key name

Returns:

success

ida_registry.reg_data_type(name: str, subkey: str = None) regval_type_t

Get data type of a given value.

Parameters:
  • name – value name

  • subkey – key name

Returns:

false if the [key+]value doesn’t exist

ida_registry.reg_read_binary(name: str, subkey: str = None) PyObject *

Read binary data from the registry.

Parameters:
  • name – value name

  • subkey – key name

Returns:

false if ‘data’ is not large enough to hold all data present. in this case ‘data’ is left untouched.

ida_registry.reg_write_binary(name: str, py_bytes: PyObject *, subkey: str = None) PyObject *

Write binary data to the registry.

Parameters:
  • name – value name

  • subkey – key name

ida_registry.reg_subkey_subkeys(name: str) PyObject *

Get all subkey names of given key.

ida_registry.reg_subkey_values(name: str) PyObject *

Get all value names under given key.

ida_registry.IDA_REGISTRY_NAME
ida_registry.HVUI_REGISTRY_NAME
ida_registry.ROOT_KEY_NAME

Default key used to store IDA settings in registry (Windows version).

ida_registry.reg_unknown

unknown

ida_registry.reg_sz

utf8 string

ida_registry.reg_binary

binary data

ida_registry.reg_dword

32-bit number

ida_registry.reg_delete_subkey(name: str) bool

Delete a key from the registry.

ida_registry.reg_delete_tree(name: str) bool

Delete a subtree from the registry.

ida_registry.reg_delete(name: str, subkey: str = None) bool

Delete a value from the registry.

Parameters:
  • name – value name

  • subkey – parent key

Returns:

success

ida_registry.reg_subkey_exists(name: str) bool

Is there already a key with the given name?

ida_registry.reg_exists(name: str, subkey: str = None) bool

Is there already a value with the given name?

Parameters:
  • name – value name

  • subkey – parent key

ida_registry.reg_read_strlist(subkey: str) List[str]

Retrieve all string values associated with the given key.

Parameters:

subkey – a key from which to read the list of items

Returns:

the list of items

ida_registry.reg_write_strlist(items: List[str], subkey: str)

Write string values associated with the given key.

Parameters:
  • items – the list of items to write

  • subkey – a key under which to write the list of items

ida_registry.reg_update_strlist(subkey: str, add: str | None, maxrecs: int, rem: str | None = None, ignorecase: bool = False)

Add and/or remove items from the list, and possibly trim that list.

Parameters:
  • subkey – the key under which the list is located

  • add – an item to add to the list, or None

  • maxrecs – the maximum number of items the list should hold

  • rem – an item to remove from the list, or None

  • ignorecase – ignore case for ‘add’ and ‘rem’

ida_registry.reg_write_string(name: str, utf8: str, subkey: str = None) None

Write a string to the registry.

Parameters:
  • name – value name

  • utf8 – utf8-encoded string

  • subkey – key name

ida_registry.reg_read_int(name: str, defval: int, subkey: str = None) int

Read integer value from the registry.

Parameters:
  • name – value name

  • defval – default value

  • subkey – key name

Returns:

the value read from the registry, or ‘defval’ if the read failed

ida_registry.reg_write_int(name: str, value: int, subkey: str = None) None

Write integer value to the registry.

Parameters:
  • name – value name

  • value – value to write

  • subkey – key name

ida_registry.reg_read_bool(name: str, defval: bool, subkey: str = None) bool

Read boolean value from the registry.

Parameters:
  • name – value name

  • defval – default value

  • subkey – key name

Returns:

boolean read from registry, or ‘defval’ if the read failed

ida_registry.reg_write_bool(name: str, value: int, subkey: str = None) None

Write boolean value to the registry.

Parameters:
  • name – value name

  • value – boolean to write (nonzero = true)

  • subkey – key name

ida_registry.reg_update_filestrlist(subkey: str, add: str, maxrecs: size_t, rem: str = None) None

Update registry with a file list. Case sensitivity will vary depending on the target OS.

ida_registry.set_registry_name(name: str) bool