@@ -0,0 +1,2458 @@
+# Copyright 2019 Google LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A#      http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%22%22%22Fuzzing engine interface.%22%22%22%0A%0Afrom builtins import object%0A%0A%0Aclass FuzzOptions(object):%0A  %22%22%22Represents options passed to the engine. Can be overridden to provide more%0A  options.%22%22%22%0A%0A  def __init__(self, corpus_dir, arguments, strategies):%0A    self.corpus_dir = corpus_dir%0A    self.arguments = arguments%0A    self.strategies = strategies%0A%0A%0Aclass Crash(object):%0A  %22%22%22Represents a crash found by the fuzzing engine.%22%22%22%0A%0A  def __init__(self, input_path, stacktrace, reproduce_args):%0A    self.input_path = input_path%0A    self.stacktrace = stacktrace%0A    self.reproduce_args = reproduce_args%0A%0A%0Aclass Result(object):%0A  %22%22%22Represents a result of a fuzzing session: a list of crashes found and the%0A  stats generated.%22%22%22%0A%0A  def __init__(self, crashes, stats):%0A    self.crashes = crashes%0A    self.stats = stats%0A%0A%0Aclass Engine(object):%0A  %22%22%22Base interface for a grey box fuzzing engine.%22%22%22%0A%0A  def prepare(self, corpus_dir, target_path, build_dir):%0A    %22%22%22Prepare for a fuzzing session, by generating options. Returns a%0A    FuzzOptions object.%22%22%22%0A    raise NotImplementedError%0A%0A  def fuzz(self, target_path, options, max_time):%0A    %22%22%22Run a fuzz session. Returns a Result.%22%22%22%0A    raise NotImplementedError%0A%0A  def reproduce(self, target_path, input_path, arguments, max_time):%0A    %22%22%22Reproduce a crash given an input. Returns a Result.%22%22%22%0A    raise NotImplementedError%0A%0A  def minimize_corpus(self, target_path, dirs, max_time):%0A    %22%22%22Optional (but recommended): run corpus minimization. Returns a Result.%22%22%22%0A    raise NotImplementedError%0A%0A  def minimize_testcase(self, target_path, input_path, output_path, max_time):%0A    %22%22%22Optional: minimize a testcase. Returns a bool.%22%22%22%0A    raise NotImplementedError%0A%0A  def cleanse(self, target_path, input_path, output_path, max_time):%0A    %22%22%22Optional: scrub a testcase of potentially sensitive bytes. Returns a%0A    bool.%22%22%22%0A    raise NotImplementedError%0A

Add engine.py as start of fuzzing engine refactor. (#627)