Пример #1
0
    def GetNannyStatus(self):
        try:
            value, _ = winreg.QueryValueEx(_GetServiceKey(), "Nanny.status")
        except OSError:
            return None

        return value
Пример #2
0
    def GetNannyMessage(self):
        try:
            value, _ = winreg.QueryValueEx(_GetServiceKey(), "Nanny.message")
        except OSError:
            return None

        return value
Пример #3
0
 def Run(self, unused_args):
   """Estimate the install date of this system."""
   # Don't use winreg.KEY_WOW64_64KEY since it breaks on Windows 2000
   subkey = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE,
                           "Software\\Microsoft\\Windows NT\\CurrentVersion",
                           0, winreg.KEY_READ)
   install_date = winreg.QueryValueEx(subkey, "InstallDate")
   self.SendReply(rdfvalue.RDFDatetime.FromSecondsSinceEpoch(install_date[0]))
Пример #4
0
  def Get(self):
    """Return a GrrMessage instance from the transaction log or None."""
    try:
      value, reg_type = winreg.QueryValueEx(_GetServiceKey(), "Transaction")
    except OSError:
      return

    if reg_type != winreg.REG_BINARY:
      return

    try:
      return rdf_flows.GrrMessage.FromSerializedBytes(value)
    except message.Error:
      return