Skip to content

Commit

Permalink
no default devices
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcondiro committed Jan 2, 2025
1 parent 1a9b4a1 commit 4a696c0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fuzzers/full_system/qemu_intel_pt_bootloader/src/boot.s
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions fuzzers/full_system/qemu_intel_pt_bootloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion libafl_qemu/src/modules/systemmode/intel_pt.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
23 changes: 23 additions & 0 deletions libafl_qemu/src/qemu/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,26 @@ impl From<bool> 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<bool> 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 {
Expand Down Expand Up @@ -363,6 +383,9 @@ pub struct QemuConfig {
vga_pci: Option<VgaPci>,
#[builder(default, setter(strip_option, into))]
start_cpu: Option<StartCPU>,
#[cfg(feature = "systemmode")]
#[builder(default, setter(strip_option, into))]
default_devices: Option<DefaultDevices>,
#[cfg(feature = "usermode")]
#[builder(setter(into))]
program: Program,
Expand Down

0 comments on commit 4a696c0

Please sign in to comment.