Revert "Companion patch to qemu-libafl-bridge #46 (#1830)" (#1865)

This reverts commit b999b4aac591818d4342773ff48e98f2896f141e.
This commit is contained in:
Dominik Maier 2024-02-16 20:50:18 +01:00 committed by GitHub
parent 50892ddc75
commit 578a22a3d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 8 deletions

View File

@ -8,7 +8,7 @@ use which::which;
const QEMU_URL: &str = "https://github.com/AFLplusplus/qemu-libafl-bridge"; const QEMU_URL: &str = "https://github.com/AFLplusplus/qemu-libafl-bridge";
const QEMU_DIRNAME: &str = "qemu-libafl-bridge"; const QEMU_DIRNAME: &str = "qemu-libafl-bridge";
const QEMU_REVISION: &str = "194b3a987c751f98c0db0f3537fa789b43b4e663"; const QEMU_REVISION: &str = "75d15d54f4417a4766d2dcb493982d9df0e8eac4";
pub struct BuildResult { pub struct BuildResult {
pub qemu_path: PathBuf, pub qemu_path: PathBuf,

View File

@ -390,7 +390,7 @@ extern_c_checked! {
fn read_self_maps() -> *const c_void; fn read_self_maps() -> *const c_void;
fn free_self_maps(map_info: *const c_void); fn free_self_maps(map_info: *const c_void);
fn libafl_maps_next(map_info: *const c_void, ret: *mut MapInfo, is_root: bool) -> *const c_void; fn libafl_maps_next(map_info: *const c_void, ret: *mut MapInfo) -> *const c_void;
static exec_path: *const u8; static exec_path: *const u8;
static guest_base: usize; static guest_base: usize;
@ -461,7 +461,6 @@ extern_c_checked! {
pub struct GuestMaps { pub struct GuestMaps {
orig_c_iter: *const c_void, orig_c_iter: *const c_void,
c_iter: *const c_void, c_iter: *const c_void,
first_iter: bool,
} }
// Consider a private new only for Emulator // Consider a private new only for Emulator
@ -474,7 +473,6 @@ impl GuestMaps {
Self { Self {
orig_c_iter: maps, orig_c_iter: maps,
c_iter: maps, c_iter: maps,
first_iter: true,
} }
} }
} }
@ -491,10 +489,7 @@ impl Iterator for GuestMaps {
} }
unsafe { unsafe {
let mut ret = MaybeUninit::uninit(); let mut ret = MaybeUninit::uninit();
self.c_iter = libafl_maps_next(self.c_iter, ret.as_mut_ptr(), self.first_iter); self.c_iter = libafl_maps_next(self.c_iter, ret.as_mut_ptr());
self.first_iter = false;
if self.c_iter.is_null() { if self.c_iter.is_null() {
None None
} else { } else {