Skip to content

Commit cc3d533

Browse files
committed
Add readme
1 parent 0ddf7a3 commit cc3d533

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Barebones wrapper around libFuzzer runtime library.
2+
3+
The CPP parts are extracted from llvm git repository with `git filter-branch`.
4+
5+
# How to use
6+
7+
“Manual” usage of this library looks like this:
8+
9+
```
10+
$ cargo new --bin fuzzed
11+
$ cd fuzzed
12+
13+
$ tail Cargo.toml -n2 # add libfuzzer-sys dependency
14+
[dependencies]
15+
fuzzer-sys = { path = "../libfuzzer-sys" } # or something
16+
17+
$ cat src/main.rs
18+
#![no_main]
19+
extern crate fuzzer_sys;
20+
21+
#[export_name="LLVMFuzzerTestOneInput"]
22+
pub fn go(data: *const u8, size: isize) -> i32 {
23+
// fuzzed code goes here
24+
0
25+
}
26+
27+
$ cargo rustc -- -C passes='sancov' -C llvm-args='-sanitizer-coverage-level=3' -Z sanitizer=address -Cpanic=abort
28+
$ ./target/debug/fuzzed # runs fuzzing
29+
```
30+
31+
Nice wrappers incoming soon

0 commit comments

Comments
 (0)