Exemple #1
0
  def testWinPyregf(self):
    test_file = self._GetTestFilePath(['NTUSER.DAT'])
    file_entry = self._GetTestFileEntry(test_file)
    winreg_file = winpyregf.WinPyregfFile()
    winreg_file.Open(file_entry)

    self._KeyPathCompare(winreg_file, u'\\')
    self._KeyPathCompare(winreg_file, u'\\Printers')
    self._KeyPathCompare(winreg_file, u'\\Printers\\Connections')
    self._KeyPathCompare(winreg_file, u'\\Software')
Exemple #2
0
    def OpenFile(self, file_entry, codepage='cp1252'):
        """Opens the file object based on the back-end.

    Args:
      file_entry: The file entry object.

    Returns:
      The a Windows Registry file (instance of WinRegFile) if successful
      or None otherwise.
    """
        winreg_file = None

        if self._backend == self.BACKEND_PYREGF:
            winreg_file = winpyregf.WinPyregfFile()

        if winreg_file:
            winreg_file.Open(file_entry, codepage=codepage)

        return winreg_file