Skip to content

Commit

Permalink
clippy + fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jejuisland87654 committed Dec 22, 2024
1 parent 3bbf85b commit 17af335
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions fuzzers/binary_only/frida_libpng/src/fuzzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ use libafl_frida::{
cmplog_rt::CmpLogRuntime,
coverage_rt::{CoverageRuntime, MAP_SIZE},
executor::FridaInProcessExecutor,
helper::FridaInstrumentationHelper,
helper::FridaRuntimeVec,
helper::{FridaInstrumentationHelper, FridaRuntimeVec},
};
use libafl_targets::cmplog::CmpLogObserver;
use mimalloc::MiMalloc;
Expand Down
12 changes: 6 additions & 6 deletions libafl_frida/src/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pub struct FridaRuntimeVec(pub Vec<Box<dyn FridaRuntime>>);

impl MatchFirstType for FridaRuntimeVec {
fn match_first_type<T: 'static>(&self) -> Option<&T> {
for member in (&self.0).iter() {
for member in &self.0 {
if TypeId::of::<T>() == member.type_id() {
let raw = std::ptr::from_ref::<dyn FridaRuntime>(&**member) as *const T;
return unsafe { raw.as_ref() };
Expand All @@ -138,7 +138,7 @@ impl MatchFirstType for FridaRuntimeVec {
}

fn match_first_type_mut<T: 'static>(&mut self) -> Option<&mut T> {
for member in (&mut self.0).iter_mut() {
for member in &mut self.0 {
if TypeId::of::<T>() == member.type_id() {
let raw = std::ptr::from_mut::<dyn FridaRuntime>(&mut **member) as *mut T;
return unsafe { raw.as_mut() };
Expand All @@ -156,26 +156,26 @@ impl FridaRuntimeTuple for FridaRuntimeVec {
ranges: &RangeMap<u64, (u16, String)>,
module_map: &Rc<ModuleMap>,
) {
for runtime in (&mut self.0).iter_mut() {
for runtime in &mut self.0 {
runtime.init(gum, ranges, module_map);
}
}

fn deinit_all(&mut self, gum: &Gum) {
for runtime in (&mut self.0).iter_mut() {
for runtime in &mut self.0 {
runtime.deinit(gum);
}
}

fn pre_exec_all(&mut self, input_bytes: &[u8]) -> Result<(), Error> {
for runtime in (&mut self.0).iter_mut() {
for runtime in &mut self.0 {
runtime.pre_exec(input_bytes)?;
}
Ok(())
}

fn post_exec_all(&mut self, input_bytes: &[u8]) -> Result<(), Error> {
for runtime in (&mut self.0).iter_mut() {
for runtime in &mut self.0 {
runtime.post_exec(input_bytes)?;
}
Ok(())
Expand Down

0 comments on commit 17af335

Please sign in to comment.