Skip to content

Commit

Permalink
Fix usage
Browse files Browse the repository at this point in the history
  • Loading branch information
headshog committed Mar 19, 2024
1 parent 47b376d commit e52fc58
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 30 deletions.
2 changes: 1 addition & 1 deletion casr/src/bin/casr-libfuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn main() -> Result<()> {
let mut argv: Vec<&str> = if let Some(argvs) = matches.get_many::<String>("ARGS") {
argvs.map(|v| v.as_str()).collect()
} else {
Vec::new()
bail!("Invalid fuzz target arguments");
};

// Get gdb args.
Expand Down
49 changes: 20 additions & 29 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ Create CASR reports (.casrep) from C# reports

Options:
-o, --output <REPORT> Path to save report. Path can be a directory, then report name
is generated
is generated
--stdout Print CASR report to stdout
--stdin <FILE> Stdin file for program
-t, --timeout <SECONDS> Timeout (in seconds) for target execution, 0 value means that
timeout is disabled [default: 0]
timeout is disabled [default: 0]
--ignore <FILE> File with regular expressions for functions and file paths that
should be ignored
should be ignored
-h, --help Print help
-V, --version Print version

Expand Down Expand Up @@ -440,33 +440,24 @@ Triage crashes found by AFL++ (Sharpfuzz)

Arguments:
[ARGS]... Add "-- ./gdb_fuzz_target <arguments>" to generate additional crash reports
with casr-gdb (for compiled binaries, e.g., test whether program crashes
without sanitizers), "-- dotnet <arguments>" or "-- mono <arguments>" to
triage C# crashes with additional options
with casr-gdb (for compiled binaries, e.g., test whether program crashes
without sanitizers), "-- dotnet <arguments>" or "-- mono <arguments>" to
triage C# crashes with additional options

Options:
-l, --log-level <log-level>
Logging level [default: info] [possible values: info, debug]
-j, --jobs <jobs>
Number of parallel jobs for generating CASR reports [default: half of cpu cores]
-t, --timeout <SECONDS>
Timeout (in seconds) for target execution, 0 value means that timeout is
disabled [default: 0]
-i, --input <INPUT_DIR>
AFL++ work directory
-o, --output <OUTPUT_DIR>
Output directory with triaged reports
-f, --force-remove
Remove output project directory if it exists
--ignore-cmdline
Force <casr-gdb-args> usage to run target instead of searching for cmdline files
in AFL fuzzing directory
--no-cluster
Do not cluster CASR reports
-h, --help
Print help
-V, --version
Print version
-l, --log-level <log-level> Logging level [default: info] [possible values: info, debug]
-j, --jobs <jobs> Number of parallel jobs for generating CASR reports
[default: half of cpu cores]
-t, --timeout <SECONDS> Timeout (in seconds) for target execution, 0 value means
that timeout is disabled [default: 0]
-i, --input <INPUT_DIR> AFL++ work directory
-o, --output <OUTPUT_DIR> Output directory with triaged reports
-f, --force-remove Remove output project directory if it exists
--ignore-cmdline Force <casr-gdb-args> usage to run target instead of searching for cmdline files
in AFL fuzzing directory
--no-cluster Do not cluster CASR reports
-h, --help Print help
-V, --version Print version

`casr-afl` provides a straightforward CASR integration with AFL++. While walking through afl
instances, `casr-afl` generates crash reports depending on target binary. For
Expand Down Expand Up @@ -547,7 +538,7 @@ AFL++ Example (Ubuntu 20.04+):
You may also run `casr-afl` with additional report generation for uninstrumented
binary with `casr-gdb`:

$ casr-afl -i casr/tests/casr_tests/casrep/afl-out-xlnt -o casr/tests/tmp_tests_casr/casr_afl_out --casr-gdb-args /tmp/load_sydr @@
$ casr-afl -i casr/tests/casr_tests/casrep/afl-out-xlnt -o casr/tests/tmp_tests_casr/casr_afl_out -- /tmp/load_sydr @@

Thus, `casr-afl` will generate GDB crash report for each unique ASAN crash. So,
you can estimate crash severity for program built without sanitizers.
Expand Down

0 comments on commit e52fc58

Please sign in to comment.