Skip to content

Commit c5b7c7c

Browse files
WorksButNotTestedYour Name
andauthored
Add SnapshotModule to qemu_coverage tool (#2885)
Co-authored-by: Your Name <[email protected]>
1 parent e844290 commit c5b7c7c

File tree

1 file changed

+12
-7
lines changed
  • fuzzers/binary_only/qemu_coverage/src

1 file changed

+12
-7
lines changed

fuzzers/binary_only/qemu_coverage/src/fuzzer.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ use libafl_bolts::{
2828
AsSlice,
2929
};
3030
use libafl_qemu::{
31-
elf::EasyElf, modules::drcov::DrCovModule, ArchExtras, CallingConvention, Emulator, GuestAddr,
32-
GuestReg, MmapPerms, Qemu, QemuExecutor, QemuExitReason, QemuRWError, QemuShutdownCause, Regs,
31+
elf::EasyElf,
32+
modules::{drcov::DrCovModule, SnapshotModule},
33+
ArchExtras, CallingConvention, Emulator, GuestAddr, GuestReg, MmapPerms, Qemu, QemuExecutor,
34+
QemuExitReason, QemuRWError, QemuShutdownCause, Regs,
3335
};
3436

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

135-
let emulator_modules = tuple_list!(DrCovModule::builder()
136-
.filename(cov_path.clone())
137-
.full_trace(false)
138-
.build());
137+
let emulator_modules = tuple_list!(
138+
DrCovModule::builder()
139+
.filename(cov_path.clone())
140+
.full_trace(false)
141+
.build(),
142+
SnapshotModule::new()
143+
);
139144

140145
let emulator = Emulator::empty()
141146
.qemu_parameters(options.args.clone())
@@ -200,7 +205,7 @@ pub fn fuzz() {
200205
};
201206

202207
let mut harness =
203-
|emulator: &mut Emulator<_, _, _, _, _, _, _>, state: &mut _, input: &BytesInput| {
208+
|emulator: &mut Emulator<_, _, _, _, _, _, _>, _state: &mut _, input: &BytesInput| {
204209
let qemu = emulator.qemu();
205210

206211
let target = input.target_bytes();

0 commit comments

Comments
 (0)