Skip to content

Use fuzz_target! to generate #[test] for LLM representation alignment

Notifications You must be signed in to change notification settings

SecurityLab-UCD/rust-fuzzer-gen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

rust-fuzzer-gen

Convert libFuzzer fuzz_target! files to Unit Tests #[test] for Rust.

Setup

  • Rust nightly

    rustup install nightly
    rustup default nightly
  • cargo-fuzz

    cargo install cargo-fuzz

Usage

NOTE The process is subject to change as the project matures.

Getting Repo

mkdir -p data && cd data
git clone https://github.com/marshallpierce/rust-base64
cd ..

Transforming Fuzzers

cargo run data/rust-base64

This step does two things data/rust-base64

  1. modify fuzzer files in \fuzz and copy a backup \fuzz-bak
  2. generate unit tests \tests-gen based on \fuzz

To restore to previous stage, use rm fuzz tests-gen -rf && mv fuzz-bak fuzz.

Fuzzing with data recorded

cd data/rust-base64
cargo fuzz run roundtrip > record.txt
head record.txt

Using as a package

cargo install --git https://github.com/SecurityLab-UCD/rust-fuzzer-gen.git
rust-fuzzer-gen <patht to a target repo>

About

Use fuzz_target! to generate #[test] for LLM representation alignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages