From f460f2c00b4cfe21bdab045101b90af6e4ae281e Mon Sep 17 00:00:00 2001 From: Renata Hodovan Date: Wed, 18 Sep 2024 14:24:20 +0200 Subject: [PATCH] Fix the setup of Grimoire The previous version of fuzzer.py was possibly copy-pasted from Nautilus and applied unexpected CLI setup. The patch fixes these issues. --- fuzzers/grimoire/fuzzer.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/fuzzers/grimoire/fuzzer.py b/fuzzers/grimoire/fuzzer.py index 1c156412a..1c909121a 100755 --- a/fuzzers/grimoire/fuzzer.py +++ b/fuzzers/grimoire/fuzzer.py @@ -41,18 +41,6 @@ def prepare_fuzz_environment(input_corpus): def build(): # pylint: disable=too-many-branches,too-many-statements """Build benchmark.""" - benchmark_name = os.environ['BENCHMARK'].lower() - if 'php' in benchmark_name: - copy_file = '/libafl_fuzzbench/grammars/php_nautilus.json' - elif 'ruby' in benchmark_name: - copy_file = '/libafl_fuzzbench/grammars/ruby_nautilus.json' - elif 'js' in benchmark_name or 'javascript' in benchmark_name: - copy_file = '/libafl_fuzzbench/grammars/js_nautilus.json' - else: - raise RuntimeError('Unsupported benchmark, unavailable grammar') - dest = os.path.join(os.environ['OUT'], 'grammar.json') - shutil.copy(copy_file, dest) - os.environ['CC'] = '/libafl_fuzzbench/target/release/grimoire_cc' os.environ['CXX'] = '/libafl_fuzzbench/target/release/grimoire_cxx' @@ -74,9 +62,6 @@ def fuzz(input_corpus, output_corpus, target_binary): command = [target_binary] if dictionary_path: command += (['-x', dictionary_path]) - grammar = os.path.join(os.environ['OUT'], 'grammar.json') - out = os.path.join(os.environ['OUT'], 'out') - os.mkdir(out) - command += (['-r', output_corpus, '-o', out, '-g', grammar]) + command += (['-i', input_corpus, '-o', output_corpus]) print(command) subprocess.check_call(command, cwd=os.environ['OUT'])