onefuzz/docs/custom-analysis.md
bmc-msft 198d765cb4
Add generic_analysis example that performs coverage analysis (#1072)
This adds an example script and tool that enables LLVM source-based coverage using the `generic_analysis` task.

This provides:
1. sample python script that launches the template and then the analysis task
1. sample `analysis_exe` wrapper script that launches the LLVM coverage tools
1. sample libfuzzer target for the example
1. walk through submitting the jobs and inspecting the results
2021-07-21 17:12:24 +00:00

30 lines
932 B
Markdown

# Custom Analysis Tasks
OneFuzz supports the ability to create user-defined analysis tasks, enabling
custom triage of crashes.
## Example use case
Users can automatically record the output of
[!analyze](https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/using-the--analyze-extension)
for crash using a `generic_generator` task with analyzer_exe of `cdb`, and the
`analyzer_options` of
```
[
"-c", "!analyze;q", "-logo", "{output_dir}\\{input_file_name_no_ext}.report",
"{target_exe}", "{target_options}"
]
```
For a crash named `mycrash.txt`, this will create `mycrash.report` in the
`analysis` container.
This can be seen in the [radamsa](../src/cli/onefuzz/templates/radamsa.py)
template for any Windows targets.
See also:
* [Command Replacements](command-replacements.md)
* [Example to collect LLVM Source-Based Coverage using custom analysis](../src/cli/examples/llvm-source-coverage/README.md)