Skip to content

Commit f460f2c

Browse files
committed
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.
1 parent 915cd23 commit f460f2c

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

fuzzers/grimoire/fuzzer.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,6 @@ def prepare_fuzz_environment(input_corpus):
4141

4242
def build(): # pylint: disable=too-many-branches,too-many-statements
4343
"""Build benchmark."""
44-
benchmark_name = os.environ['BENCHMARK'].lower()
45-
if 'php' in benchmark_name:
46-
copy_file = '/libafl_fuzzbench/grammars/php_nautilus.json'
47-
elif 'ruby' in benchmark_name:
48-
copy_file = '/libafl_fuzzbench/grammars/ruby_nautilus.json'
49-
elif 'js' in benchmark_name or 'javascript' in benchmark_name:
50-
copy_file = '/libafl_fuzzbench/grammars/js_nautilus.json'
51-
else:
52-
raise RuntimeError('Unsupported benchmark, unavailable grammar')
53-
dest = os.path.join(os.environ['OUT'], 'grammar.json')
54-
shutil.copy(copy_file, dest)
55-
5644
os.environ['CC'] = '/libafl_fuzzbench/target/release/grimoire_cc'
5745
os.environ['CXX'] = '/libafl_fuzzbench/target/release/grimoire_cxx'
5846

@@ -74,9 +62,6 @@ def fuzz(input_corpus, output_corpus, target_binary):
7462
command = [target_binary]
7563
if dictionary_path:
7664
command += (['-x', dictionary_path])
77-
grammar = os.path.join(os.environ['OUT'], 'grammar.json')
78-
out = os.path.join(os.environ['OUT'], 'out')
79-
os.mkdir(out)
80-
command += (['-r', output_corpus, '-o', out, '-g', grammar])
65+
command += (['-i', input_corpus, '-o', output_corpus])
8166
print(command)
8267
subprocess.check_call(command, cwd=os.environ['OUT'])

0 commit comments

Comments
 (0)