From 245f4244578db66dadea03fe133e28c80a4b2e07 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Sun, 20 Dec 2020 01:15:10 +0100 Subject: [PATCH] less noisy --- afl/src/events/mod.rs | 24 ++++++++++++++++++++++++ fuzzers/libfuzzer/src/lib.rs | 3 +-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/afl/src/events/mod.rs b/afl/src/events/mod.rs index 6049bb86a1..86bd20f63d 100644 --- a/afl/src/events/mod.rs +++ b/afl/src/events/mod.rs @@ -7,6 +7,7 @@ use core::time::Duration; use core::{marker::PhantomData, time}; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; +use shmem::AflShmem; #[cfg(feature = "std")] use self::{ @@ -725,6 +726,29 @@ where phantom: PhantomData<(C, E, OT, FT, I, R)>, } +impl LlmpEventManager +where + C: Corpus, + E: Executor, + OT: ObserversTuple, + FT: FeedbacksTuple, + I: Input, + R: Rand, + ST: Stats, +{ + #[cfg(feature = "std")] + /// Create llmp on a port + /// If the port is not yet bound, it will act as broker + /// Else, it will act as client. + pub fn new_on_port_std(stats: ST) -> Result { + Ok(Self { + llmp: llmp::LlmpConnection::on_port(port)?, + stats: stats, + phantom: PhantomData, + }) + } +} + impl LlmpEventManager where C: Corpus, diff --git a/fuzzers/libfuzzer/src/lib.rs b/fuzzers/libfuzzer/src/lib.rs index 4f088a7356..ff80a8f9e6 100644 --- a/fuzzers/libfuzzer/src/lib.rs +++ b/fuzzers/libfuzzer/src/lib.rs @@ -47,8 +47,7 @@ pub extern "C" fn afl_libfuzzer_main() { let stats = SimpleStats::new(|s| println!("{}", s)); - let mut mgr = - LlmpEventManager::<_, _, _, _, _, _, AflShmem, _>::new_on_port(1337, stats).unwrap(); + let mut mgr = LlmpEventManager::new_on_port_std(1337, stats).unwrap(); if mgr.is_broker() { println!("Doing broker things. Run this tool again to start fuzzing in a client."); mgr.broker_loop().unwrap();