示例#1
0
文件: mutator.py 项目: pla93/NaFl
    def apply_pre_processing(self, file_contents):
        """
        Applies the selected plugins in order to
        extract the raw data to be mutated
        :param file_contents: eeeh... the input file contents :)
        :return: extracted data
        """
        data = file_contents

        for p in self.plugin_list:
            plugin = load_plugin(p)
            data, self.data_to_post = plugin.pre(data)

        return data
示例#2
0
文件: mutator.py 项目: BwRy/NaFl
    def apply_pre_processing(self, file_contents):
        """
        Applies the selected plugins in order to
        extract the raw data to be mutated
        :param file_contents: eeeh... the input file contents :)
        :return: extracted data
        """
        data = file_contents

        for p in self.plugin_list:
            plugin = load_plugin(p)
            data, self.data_to_post = plugin.pre(data)

        return data
示例#3
0
文件: mutator.py 项目: pla93/NaFl
    def apply_post_processing(self, mutated_buffer):
        """
        Applies the selected plugins in *reverse* order
        to recreate the original file format
        :param mutated_buffer: eeeh... the mutated buffer :)
        :return: new file contents
        """
        data = mutated_buffer

        for p in self.plugin_list[::-1]:
            # The plugins are applied in reverse order
            plugin = load_plugin(p)
            data = plugin.post(data, self.data_to_post)

        return data
示例#4
0
文件: mutator.py 项目: BwRy/NaFl
    def apply_post_processing(self, mutated_buffer):
        """
        Applies the selected plugins in *reverse* order
        to recreate the original file format
        :param mutated_buffer: eeeh... the mutated buffer :)
        :return: new file contents
        """
        data = mutated_buffer

        for p in self.plugin_list[::-1]:
            # The plugins are applied in reverse order
            plugin = load_plugin(p)
            data = plugin.post(data, self.data_to_post)

        return data