This commit is contained in:
van Hauser 2020-12-20 16:38:44 +01:00
parent b26da86525
commit e2342a2bbb
2 changed files with 6 additions and 23 deletions

View File

@ -83,7 +83,7 @@ where
let attr = attributes?;
if attr.is_file() && attr.len() > 0 {
println!("Load file {:?}", &path);
println!("Loading file {:?} ...", &path);
let bytes = std::fs::read(&path)?;
let input = BytesInput::new(bytes);
let fitness = self.evaluate_input(&input, engine.executor_mut())?;
@ -118,7 +118,7 @@ where
}
manager.log(
0,
format!("Loaded {} initial testcases", in_dirs.len()), // get corpus count
format!("Loaded {} initial testcases.", corpus.count()), // get corpus count
)?;
manager.process(self, corpus)?;
Ok(())

View File

@ -104,25 +104,14 @@ pub extern "C" fn afl_libfuzzer_main() {
println!("Information: the first process started is the broker and only processes the \'-p PORT\' option if present.");
}
// debug prints
println!("workdir: {:?}", workdir);
match dictionary {
Some(x) => for file in x {
println!("dic: {:?}", file);
},
None => (),
}
// original code
println!("Workdir: {:?}", workdir);
let mut rand = StdRand::new(0);
let mut corpus = InMemoryCorpus::new();
let mut generator = RandPrintablesGenerator::new(32);
let stats = SimpleStats::new(|s| println!("{}", s));
let mut mgr = LlmpEventManager::new_on_port(broker_port, stats).unwrap();
if mgr.is_broker() {
println!("Doing broker things.");
mgr.broker_loop().unwrap();
@ -148,15 +137,9 @@ pub extern "C" fn afl_libfuzzer_main() {
}
match input {
Some(x) => {
for indir in &x {
println!("in: {:?}", indir);
};
state
Some(x) => state
.load_initial_inputs(&mut corpus, &mut generator, &mut engine, &mut mgr, &x)
.expect("Failed to load initial corpus")
},
.expect("Failed to load initial corpus"),
None => (),
}