From 7c5336189d7bb8b5208684fef378b189ff6e1b60 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 | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/fuzzers/grimoire/fuzzer.py b/fuzzers/grimoire/fuzzer.py index 1c156412a..ae658dd97 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,8 @@ 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, '-r', output_corpus, '-o', out]) print(command) subprocess.check_call(command, cwd=os.environ['OUT'])