MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / try_exec

Method try_exec

hail-fuzz/src/i2s/replacement.rs:328–359  ·  view source on GitHub ↗
(
        &mut self,
        fuzzer: &mut Fuzzer,
        stats: &mut crate::monitor::LocalStats,
    )

Source from the content-addressed store, hash-verified

326 }
327
328 fn try_exec(
329 &mut self,
330 fuzzer: &mut Fuzzer,
331 stats: &mut crate::monitor::LocalStats,
332 ) -> anyhow::Result<bool> {
333 fuzzer.reset_input_cursor().unwrap();
334 fuzzer.write_input_to_target().unwrap();
335 let Some(exit) = fuzzer.execute()
336 else {
337 return Ok(false);
338 };
339 fuzzer.auto_trim_input().unwrap();
340 self.total_execs += 1;
341
342 let path_changed = fuzzer.vm.cpu.icount() != self.end_icount;
343 // If we executed a different amount of instructions then the replacement we just made had
344 // an impact, so store it in the dictionary for future mutations.
345 if path_changed && fuzzer.features.auto_dict {
346 let item_to_add = self.replacement.get_value_for_dictionary();
347 let key = self.replacement.stream_key;
348 let dict = fuzzer.dict.entry(key).or_default();
349 let sizes = fuzzer.state.input.streams[&key].sizes;
350 if dict.add_item(item_to_add, sizes as u8) {
351 fuzzer.dict_items += 1;
352 }
353 }
354
355 fuzzer.check_exit_state(exit)?;
356 fuzzer.update_stats(stats);
357
358 Ok(true)
359 }
360}
361
362#[derive(Debug)]

Callers 1

runMethod · 0.80

Calls 8

reset_input_cursorMethod · 0.80
write_input_to_targetMethod · 0.80
executeMethod · 0.80
auto_trim_inputMethod · 0.80
add_itemMethod · 0.80
check_exit_stateMethod · 0.80
update_statsMethod · 0.80

Tested by

no test coverage detected