pyregfi Namespace Reference

Python interface to the regfi library. More...

## Namespaces

| structures
| Low-level data structures and C API mappings.
| winsec
| Low-level data structures for winsec library.

## Classes

class | DATA_TYPES
| An enumeration of registry Value data types. More...
class | LOG_TYPES
| An enumeration of log message types. More...
class | _StructureWrapper
| Abstract class for most objects returned by the library. More...
class | Key
| Registry key These represent registry keys (REGFI_NK records) and provide access to their subkeys, values, and other metadata. More...
class | Value
| Registry value (metadata) More...
class | Security
| Represents a registry SK record which contains a security descriptor. More...
class | _GenericList
| Abstract class for ValueList and SubkeyList. More...
class | SubkeyList
| The list of subkeys associated with a Key. More...
class | ValueList
| The list of values associated with a Key. More...
class | Hive
| Represents a single registry hive (file) More...
class | HiveIterator
| A special purpose iterator for registry hives. More...

## Functions

def | getVersion ()
| Returns the (py)regfi library version. More...
def | getLogMessages ()
| Retrieves messages produced by regfi during parsing and interpretation. More...
def | setLogMask (log_types)
| Sets the types of log messages to record. More...
def | openHive (path)
| Opens a file as a registry hive. More...

## Detailed Description

Python interface to the regfi library.

## Function Documentation

## getVersion()

def pyregfi.getVersion | ( |  | ) |

Returns the (py)regfi library version.

Returns
  A string indicating the version

## getLogMessages()

def pyregfi.getLogMessages | ( |  | ) |

Retrieves messages produced by regfi during parsing and interpretation.

The regfi C library may generate log messages stored in a special thread-safe global data structure. These messages should be retrieved periodically or after each major operation by callers to determine if any errors or warnings should be reported to the user. Failure to retrieve these could result in excessive memory consumption.

Referenced by pyregfi.Hive.__init__(), and pyregfi.HiveIterator.descend().

## setLogMask()

def pyregfi.setLogMask | ( |  | log_types | ) |

Sets the types of log messages to record.

Parameters

  log_types | A sequence of message types that regfi should generate. Message types can be found in the LOG_TYPES enumeration.

Returns
  True on success, False on failure. Failures are rare, but could indicate that global logging is not operating as expected.

Example:

setLogMask((LOG_TYPES.ERROR, LOG_TYPES.WARN, LOG_TYPES.INFO))

The message mask is a global (all hives, iterators), thread-specific value. For more information, see regfi_log_set_mask.

## openHive()

def pyregfi.openHive | ( |  | path | ) |

Opens a file as a registry hive.

Parameters

  path | The file path of a hive, as one would provide to the open() built-in

Returns
  A new Hive instance