'Extract DataBlob from Stat response.'

@flow.StateHandler()
def ProcessFileStats(self, responses):

    if (not responses.success):
        return
    system_root_paths = ['Windows', 'WinNT', 'WINNT35', 'WTSRV', 'WINDOWS']
    for response in responses:
        if (response.pathspec.path[4:] in system_root_paths):
            systemdrive = response.pathspec.path[1:3]
            systemroot = ('%s\\%s' % (systemdrive, response.pathspec.path[4:]))
            data = rdf_protodict.DataBlob().SetValue(systemroot)
            self.SendReply(rdf_client.StatEntry(registry_data=data))
            self.state.success = True
            break
