@@ -75,18 +75,15 @@ Re-compile the application by running the build script.
7575
7676## Obtain a Corpus
7777
78- The fuzzer will take input from the `corpus` directory in the project directory, so
79- we'll create that directory and add some sample certificate files in DER format as
80- our input corpus.
81-
82- ```sh
83- mkdir corpus
84- curl -L -o corpus/0 https://github.com/dvyukov/go-fuzz-corpus/raw/master/x509/certificate/corpus/0
85- curl -L -o corpus/1 https://github.com/dvyukov/go-fuzz-corpus/raw/master/x509/certificate/corpus/1
86- curl -L -o corpus/2 https://github.com/dvyukov/go-fuzz-corpus/raw/master/x509/certificate/corpus/2
87- curl -L -o corpus/3 https://github.com/dvyukov/go-fuzz-corpus/raw/master/x509/certificate/corpus/3
78+ The fuzzer will take input from the `corpus` directory located under `edk2-uefi`:
79+
80+ ```python
81+ @tsffs.corpus_directory = SIM_lookup_file("%simics%/../corpus")
8882```
8983
84+ In ` build.sh ` we have already created that directory and added some sample
85+ certificate files in DER format as our input corpus.
86+
9087## Configuring the Fuzzer
9188
9289Even though we loaded the fuzzer module, it didn't run previously because we did not
@@ -126,13 +123,17 @@ hangs, and CPU exceptions. we'll enable exceptions 13 for general protection fau
126123@tsffs.exceptions = [13, 14]
127124```
128125
129- We'll tell the fuzzer where to take its corpus and save its solutions. The fuzzer will
130- take its corpus from the ` corpus ` directory and save solutions to the ` solutions `
131- directory in the project by default, so this call can be skipped in real usage unless
132- you want to change the defaults.
126+ By default, TSFFS expects the ` corpus ` and ` solutions ` directories to be located within
127+ the Simics project directory.
128+
129+ However, Since our fuzzer is configured to read its corpus from the ` ../corpus `
130+ directory (relative to the ` project ` directory), we must explicitly specify the
131+ correct path using the following configuration:
133132
134133``` python
135- @tsffs.corpus_directory = SIM_lookup_file("%simics%/corpus")
134+ # project/../corpus
135+ @tsffs.corpus_directory = SIM_lookup_file("%simics%/../corpus")
136+ # set solutions directory (default location, explicitly defined for clarity)
136137@tsffs.solutions_directory = SIM_lookup_file("%simics%/solutions")
137138```
138139
0 commit comments