Skip to content

Commit

Permalink
Add SnapshotModule to qemu_coverage tool (#2885)
Browse files Browse the repository at this point in the history
Co-authored-by: Your Name <[email protected]>
  • Loading branch information
WorksButNotTested and Your Name authored Jan 23, 2025
1 parent e844290 commit c5b7c7c
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions fuzzers/binary_only/qemu_coverage/src/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ use libafl_bolts::{
AsSlice,
};
use libafl_qemu::{
elf::EasyElf, modules::drcov::DrCovModule, ArchExtras, CallingConvention, Emulator, GuestAddr,
GuestReg, MmapPerms, Qemu, QemuExecutor, QemuExitReason, QemuRWError, QemuShutdownCause, Regs,
elf::EasyElf,
modules::{drcov::DrCovModule, SnapshotModule},
ArchExtras, CallingConvention, Emulator, GuestAddr, GuestReg, MmapPerms, Qemu, QemuExecutor,
QemuExitReason, QemuRWError, QemuShutdownCause, Regs,
};

#[derive(Default)]
Expand Down Expand Up @@ -132,10 +134,13 @@ pub fn fuzz() {
let core = core_id.0;
cov_path.set_file_name(format!("{coverage_name}-{core:03}.{coverage_extension}"));

let emulator_modules = tuple_list!(DrCovModule::builder()
.filename(cov_path.clone())
.full_trace(false)
.build());
let emulator_modules = tuple_list!(
DrCovModule::builder()
.filename(cov_path.clone())
.full_trace(false)
.build(),
SnapshotModule::new()
);

let emulator = Emulator::empty()
.qemu_parameters(options.args.clone())
Expand Down Expand Up @@ -200,7 +205,7 @@ pub fn fuzz() {
};

let mut harness =
|emulator: &mut Emulator<_, _, _, _, _, _, _>, state: &mut _, input: &BytesInput| {
|emulator: &mut Emulator<_, _, _, _, _, _, _>, _state: &mut _, input: &BytesInput| {
let qemu = emulator.qemu();

let target = input.target_bytes();
Expand Down

0 comments on commit c5b7c7c

Please sign in to comment.