(
&mut self,
fuzzer: &mut Fuzzer,
stats: &mut crate::monitor::LocalStats,
)
| 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)] |
no test coverage detected