regfi
|
This top layer of API functions provides an iterator interface which makes traversing registry data structures easy in both single-threaded and multi-threaded scenarios. More...
Data Structures | |
struct | REGFI_ITERATOR |
Registry hive iterator. More... | |
Functions | |
REGFI_ITERATOR * | regfi_iterator_new (REGFI_FILE *file) |
Creates a new iterator for the provided registry file. | |
void | regfi_iterator_free (REGFI_ITERATOR *i) |
Frees a registry file iterator previously created by regfi_iterator_new. | |
bool | regfi_iterator_down (REGFI_ITERATOR *i) |
Traverse deeper into the registry tree at the current subkey. | |
bool | regfi_iterator_up (REGFI_ITERATOR *i) |
Traverse up to the current key's parent key. | |
bool | regfi_iterator_to_root (REGFI_ITERATOR *i) |
Traverse up to the root key of the hive. | |
bool | regfi_iterator_descend (REGFI_ITERATOR *i, const char **path) |
Traverse down multiple levels in the registry hive. | |
const REGFI_NK * | regfi_iterator_cur_key (REGFI_ITERATOR *i) |
Returns the currently referenced key. | |
bool | regfi_iterator_first_subkey (REGFI_ITERATOR *i) |
Sets the internal subkey index to the first subkey referenced by the current key. | |
const REGFI_NK * | regfi_iterator_cur_subkey (REGFI_ITERATOR *i) |
Returns the currently indexed subkey. | |
bool | regfi_iterator_next_subkey (REGFI_ITERATOR *i) |
Increments the internal subkey index to the next key in the subkey-list. | |
bool | regfi_iterator_find_subkey (REGFI_ITERATOR *i, const char *name) |
Searches for a subkey with a given name under the current key. | |
bool | regfi_iterator_first_value (REGFI_ITERATOR *i) |
Sets the internal value index to the first value referenced by the current key. | |
const REGFI_VK * | regfi_iterator_cur_value (REGFI_ITERATOR *i) |
Returns the currently indexed value. | |
bool | regfi_iterator_next_value (REGFI_ITERATOR *i) |
Increments the internal value index to the next value in the value-list. | |
bool | regfi_iterator_find_value (REGFI_ITERATOR *i, const char *name) |
Searches for a value with a given name under the current key. | |
const REGFI_NK ** | regfi_iterator_ancestry (REGFI_ITERATOR *i) |
Returns the current key and all parent keys as a list of NK records. |
This top layer of API functions provides an iterator interface which makes traversing registry data structures easy in both single-threaded and multi-threaded scenarios.
REGFI_ITERATOR* regfi_iterator_new | ( | REGFI_FILE * | file | ) |
Creates a new iterator for the provided registry file.
file | The opened registry file the iterator should be created for. |
References REGFI_ITERATOR::f, REGFI_ITERATOR::key_positions, REGFI_NK::offset, regfi_fetch_num_subkeys(), regfi_fetch_num_values(), regfi_free_record(), regfi_get_rootkey(), REGFI_NK::subkeys_off, REGFI_NK::values_off, and void_stack_new().
void regfi_iterator_free | ( | REGFI_ITERATOR * | i | ) |
Frees a registry file iterator previously created by regfi_iterator_new.
This does not affect the underlying registry file's allocation status.
i | the iterator to be freed |
bool regfi_iterator_down | ( | REGFI_ITERATOR * | i | ) |
Traverse deeper into the registry tree at the current subkey.
i | the iterator |
References REGFI_ITERATOR::f, REGFI_ITERATOR::key_positions, REGFI_NK::offset, regfi_fetch_num_subkeys(), regfi_fetch_num_values(), regfi_free_record(), regfi_iterator_cur_subkey(), REGFI_NK::subkeys_off, REGFI_NK::values_off, and void_stack_push().
Referenced by regfi_iterator_descend().
bool regfi_iterator_up | ( | REGFI_ITERATOR * | i | ) |
Traverse up to the current key's parent key.
i | the iterator |
References REGFI_ITERATOR::f, REGFI_ITERATOR::key_positions, and void_stack_pop().
Referenced by regfi_iterator_descend(), and regfi_iterator_to_root().
bool regfi_iterator_to_root | ( | REGFI_ITERATOR * | i | ) |
Traverse up to the root key of the hive.
i | the iterator |
References regfi_iterator_up().
bool regfi_iterator_descend | ( | REGFI_ITERATOR * | i, |
const char ** | path | ||
) |
Traverse down multiple levels in the registry hive.
XXX: This currently only accepts ASCII key names. Need to look into accepting other encodings.
i | the iterator |
path | a list of key names representing the path. This list must contain NUL terminated strings. The list itself is terminated with a NULL pointer. All path elements must be keys; value names are not accepted (even as the last element). |
References regfi_iterator_down(), regfi_iterator_find_subkey(), and regfi_iterator_up().
const REGFI_NK* regfi_iterator_cur_key | ( | REGFI_ITERATOR * | i | ) |
Returns the currently referenced key.
i | the iterator |
References REGFI_ITERATOR::f, and regfi_load_key().
Referenced by regfi_iterator_cur_subkey(), regfi_iterator_cur_value(), regfi_iterator_find_subkey(), and regfi_iterator_find_value().
bool regfi_iterator_first_subkey | ( | REGFI_ITERATOR * | i | ) |
Sets the internal subkey index to the first subkey referenced by the current key.
i | the iterator |
const REGFI_NK* regfi_iterator_cur_subkey | ( | REGFI_ITERATOR * | i | ) |
Returns the currently indexed subkey.
i | the iterator |
References REGFI_ITERATOR::f, regfi_free_record(), regfi_get_subkey(), and regfi_iterator_cur_key().
Referenced by regfi_iterator_down().
bool regfi_iterator_next_subkey | ( | REGFI_ITERATOR * | i | ) |
Increments the internal subkey index to the next key in the subkey-list.
i | the iterator |
bool regfi_iterator_find_subkey | ( | REGFI_ITERATOR * | i, |
const char * | name | ||
) |
Searches for a subkey with a given name under the current key.
i | the iterator |
name | subkey name to search for |
References REGFI_ITERATOR::f, regfi_find_subkey(), regfi_free_record(), and regfi_iterator_cur_key().
Referenced by regfi_iterator_descend().
bool regfi_iterator_first_value | ( | REGFI_ITERATOR * | i | ) |
Sets the internal value index to the first value referenced by the current key.
i | the iterator |
const REGFI_VK* regfi_iterator_cur_value | ( | REGFI_ITERATOR * | i | ) |
Returns the currently indexed value.
i | the iterator |
References REGFI_ITERATOR::f, regfi_free_record(), regfi_get_value(), and regfi_iterator_cur_key().
bool regfi_iterator_next_value | ( | REGFI_ITERATOR * | i | ) |
Increments the internal value index to the next value in the value-list.
i | the iterator |
bool regfi_iterator_find_value | ( | REGFI_ITERATOR * | i, |
const char * | name | ||
) |
Searches for a value with a given name under the current key.
i | the iterator |
name | value name to search for |
References REGFI_ITERATOR::f, regfi_find_value(), regfi_free_record(), and regfi_iterator_cur_key().
const REGFI_NK** regfi_iterator_ancestry | ( | REGFI_ITERATOR * | i | ) |
Returns the current key and all parent keys as a list of NK records.
i | the iterator |
References REGFI_ITERATOR::f, REGFI_ITERATOR::key_positions, regfi_load_key(), void_stack_iterator_free(), void_stack_iterator_new(), void_stack_iterator_next(), and void_stack_size().