'Parses the Rekall response and initiates FileFinder flows.'

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

    if (not responses.success):
        self.Log('Error    fetching    VAD    data:    %s', responses.status)
        return
    self.Log('Found    %d    binaries', len(responses))
    if self.args.filename_regex:
        binaries = []
        for response in responses:
            if self.args.filename_regex.Match(response.CollapsePath()):
                binaries.append(response)
        self.Log('Applied    filename    regex.    Have    %d    files    after    filtering.', len(binaries))
    else:
        binaries = responses
    if self.args.fetch_binaries:
        self.CallFlow(file_finder.FileFinder.__name__, next_state='HandleDownloadedFiles', paths=[rdf_paths.GlobExpression(b.CollapsePath()) for b in binaries], pathtype=rdf_paths.PathSpec.PathType.OS, action=rdf_file_finder.FileFinderAction(action_type=rdf_file_finder.FileFinderAction.Action.DOWNLOAD))
    else:
        for b in binaries:
            self.SendReply(b)
