diff --git a/fuzzers/full_system/qemu_intel_pt_bootloader/src/boot.s b/fuzzers/full_system/qemu_intel_pt_bootloader/src/boot.s index 15710b9a8e..397d331020 100644 --- a/fuzzers/full_system/qemu_intel_pt_bootloader/src/boot.s +++ b/fuzzers/full_system/qemu_intel_pt_bootloader/src/boot.s @@ -1,5 +1,5 @@ -[bits 16] ; use 16 bits -[org 0x7c00] ; sets the start address +[bits 16] ; use 16 bits +[org 0x7c00] ; sets the start address %macro print_string 1 ; %1: Pointer to the string (null-terminated) mov si, %1 ; Load the pointer to the string diff --git a/fuzzers/full_system/qemu_intel_pt_bootloader/src/main.rs b/fuzzers/full_system/qemu_intel_pt_bootloader/src/main.rs index 2c302eb4ca..77bb85ae67 100644 --- a/fuzzers/full_system/qemu_intel_pt_bootloader/src/main.rs +++ b/fuzzers/full_system/qemu_intel_pt_bootloader/src/main.rs @@ -71,6 +71,7 @@ fn main() { .unwrap()]) .accelerator(Accelerator::Kvm) //.snapshot(true) todo: doesnt work + .default_devices(false) .bios("/home/marco/code/qemu-libafl-bridge/build/qemu-bundle/usr/local/share/qemu/") .start_cpu(false); diff --git a/libafl_qemu/src/modules/systemmode/intel_pt.rs b/libafl_qemu/src/modules/systemmode/intel_pt.rs index 31bfa1d1bc..47a4b3a86c 100644 --- a/libafl_qemu/src/modules/systemmode/intel_pt.rs +++ b/libafl_qemu/src/modules/systemmode/intel_pt.rs @@ -1,7 +1,6 @@ use std::{ fmt::Debug, ops::{Range, RangeInclusive}, - ptr::slice_from_raw_parts_mut, }; use libafl::{inputs::UsesInput, observers::ObserversTuple, Error, HasMetadata}; diff --git a/libafl_qemu/src/qemu/config.rs b/libafl_qemu/src/qemu/config.rs index 69f898555b..3725d70227 100644 --- a/libafl_qemu/src/qemu/config.rs +++ b/libafl_qemu/src/qemu/config.rs @@ -300,6 +300,26 @@ impl From for VgaPci { } } +#[cfg(feature = "systemmode")] +#[derive(Debug, Clone, strum_macros::Display)] +pub enum DefaultDevices { + #[strum(serialize = "")] + ENABLE, + #[strum(serialize = "-nodefaults")] + DISABLE, +} + +#[cfg(feature = "systemmode")] +impl From for DefaultDevices { + fn from(default_devices: bool) -> Self { + if default_devices { + DefaultDevices::ENABLE + } else { + DefaultDevices::DISABLE + } + } +} + #[cfg(feature = "usermode")] #[derive(Debug, Clone)] pub struct Program { @@ -363,6 +383,9 @@ pub struct QemuConfig { vga_pci: Option, #[builder(default, setter(strip_option, into))] start_cpu: Option, + #[cfg(feature = "systemmode")] + #[builder(default, setter(strip_option, into))] + default_devices: Option, #[cfg(feature = "usermode")] #[builder(setter(into))] program: Program,