parent
e41b76fe31
commit
3c4ec38d83
@ -45,9 +45,12 @@ use libafl::{
|
||||
};
|
||||
|
||||
use libafl_frida::{
|
||||
asan::asan_rt::AsanRuntime, coverage_rt::CoverageRuntime, coverage_rt::MAP_SIZE,
|
||||
executor::FridaInProcessExecutor, helper::FridaInstrumentationHelper, FridaOptions,
|
||||
coverage_rt::CoverageRuntime, coverage_rt::MAP_SIZE, executor::FridaInProcessExecutor,
|
||||
helper::FridaInstrumentationHelper, FridaOptions,
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
use libafl_frida::asan::asan_rt::AsanRuntime;
|
||||
use libafl_targets::cmplog::{CmpLogObserver, CMPLOG_MAP};
|
||||
|
||||
#[cfg(unix)]
|
||||
|
@ -57,11 +57,12 @@ use crate::{
|
||||
Error,
|
||||
};
|
||||
|
||||
#[cfg(all(feature = "std", unix))]
|
||||
use crate::bolts::os::unix_signals::{Handler, Signal};
|
||||
#[cfg(feature = "std")]
|
||||
use crate::executors::inprocess::bt_signal_handlers::{
|
||||
setup_bt_panic_hook, setup_child_panic_hook,
|
||||
use crate::executors::inprocess::bt_signal_handlers::setup_bt_panic_hook;
|
||||
#[cfg(all(feature = "std", unix))]
|
||||
use crate::{
|
||||
bolts::os::unix_signals::{Handler, Signal},
|
||||
executors::inprocess::bt_signal_handlers::setup_child_panic_hook,
|
||||
};
|
||||
|
||||
/// The inmem executor simply calls a target function, then returns afterwards.
|
||||
|
@ -159,13 +159,13 @@ where
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
impl<'a, 'b, 'c, FH, H, I, OT, S> HasInProcessHandlers
|
||||
for FridaInProcessExecutor<'a, 'b, 'c, FH, H, I, OT, S>
|
||||
impl<'a, 'b, 'c, H, I, OT, RT, S> HasInProcessHandlers
|
||||
for FridaInProcessExecutor<'a, 'b, 'c, H, I, OT, RT, S>
|
||||
where
|
||||
H: FnMut(&I) -> ExitKind,
|
||||
I: Input + HasTargetBytes,
|
||||
OT: ObserversTuple<I, S>,
|
||||
FH: FridaHelper<'b>,
|
||||
RT: FridaRuntimeTuple,
|
||||
{
|
||||
/// the timeout handler
|
||||
#[inline]
|
||||
|
@ -3,15 +3,17 @@ use libafl::{
|
||||
inputs::{HasTargetBytes, Input},
|
||||
Error,
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
use libafl_targets::drcov::DrCovBasicBlock;
|
||||
|
||||
#[cfg(all(feature = "cmplog", target_arch = "aarch64"))]
|
||||
use crate::cmplog_rt::CmpLogRuntime;
|
||||
use crate::coverage_rt::CoverageRuntime;
|
||||
#[cfg(windows)]
|
||||
use crate::FridaOptions;
|
||||
#[cfg(unix)]
|
||||
use crate::{asan::asan_rt::AsanRuntime, FridaOptions};
|
||||
use crate::{coverage_rt::CoverageRuntime, drcov_rt::DrCovRuntime};
|
||||
use crate::{asan::asan_rt::AsanRuntime, drcov_rt::DrCovRuntime, FridaOptions};
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
use capstone::{
|
||||
arch::{self, BuildsCapstone},
|
||||
@ -130,7 +132,6 @@ impl<RT> Debug for FridaInstrumentationHelper<'_, RT> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
|
||||
let mut dbg_me = f.debug_struct("FridaInstrumentationHelper");
|
||||
dbg_me
|
||||
.field("capstone", &self.capstone)
|
||||
.field("ranges", &self.ranges)
|
||||
.field("module_map", &"<ModuleMap>")
|
||||
.field("options", &self.options);
|
||||
@ -247,6 +248,7 @@ where
|
||||
let mut first = true;
|
||||
for instruction in basic_block {
|
||||
let instr = instruction.instr();
|
||||
#[cfg(unix)]
|
||||
let instr_size = instr.bytes().len();
|
||||
let address = instr.address();
|
||||
//println!("block @ {:x} transformed to {:x}", address, output.writer().pc());
|
||||
@ -266,6 +268,7 @@ where
|
||||
rt.emit_coverage_mapping(address, &output);
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
if let Some(rt) = helper.runtime_mut::<DrCovRuntime>() {
|
||||
instruction.put_callout(|context| {
|
||||
let real_address = rt.real_address_for_stalked(pc(&context));
|
||||
@ -279,6 +282,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
let res = if let Some(rt) = helper.runtime::<AsanRuntime>() {
|
||||
rt.asan_is_interesting_instruction(&helper.capstone, address, instr)
|
||||
} else {
|
||||
|
@ -81,6 +81,7 @@ pub mod drcov_rt;
|
||||
pub mod executor;
|
||||
|
||||
/// Utilities
|
||||
#[cfg(unix)]
|
||||
pub mod utils;
|
||||
|
||||
// for parsing asan and cmplog cores
|
||||
|
Loading…
x
Reference in New Issue
Block a user