clippy fixes, x86_64 warnings
This commit is contained in:
parent
1d7baffea9
commit
f96ae30059
@ -10,11 +10,9 @@ use libafl_targets::drcov::{DrCovBasicBlock, DrCovWriter};
|
|||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
use capstone::arch::{
|
use capstone::arch::{
|
||||||
|
arch::{self, BuildsCapstone},
|
||||||
arm64::{Arm64Extender, Arm64OperandType, Arm64Shift},
|
arm64::{Arm64Extender, Arm64OperandType, Arm64Shift},
|
||||||
ArchOperand::Arm64Operand,
|
ArchOperand::Arm64Operand,
|
||||||
};
|
|
||||||
use capstone::{
|
|
||||||
arch::{self, BuildsCapstone},
|
|
||||||
Capstone, Insn,
|
Capstone, Insn,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -29,6 +27,7 @@ use frida_gum::{
|
|||||||
CpuContext,
|
CpuContext,
|
||||||
};
|
};
|
||||||
use frida_gum::{Gum, Module, PageProtection};
|
use frida_gum::{Gum, Module, PageProtection};
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
use num_traits::cast::FromPrimitive;
|
use num_traits::cast::FromPrimitive;
|
||||||
|
|
||||||
use rangemap::RangeMap;
|
use rangemap::RangeMap;
|
||||||
@ -58,9 +57,11 @@ pub struct FridaInstrumentationHelper<'a> {
|
|||||||
map: [u8; MAP_SIZE],
|
map: [u8; MAP_SIZE],
|
||||||
previous_pc: [u64; 1],
|
previous_pc: [u64; 1],
|
||||||
current_log_impl: u64,
|
current_log_impl: u64,
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
current_report_impl: u64,
|
current_report_impl: u64,
|
||||||
/// Transformer that has to be passed to FridaInProcessExecutor
|
/// Transformer that has to be passed to FridaInProcessExecutor
|
||||||
transformer: Option<Transformer<'a>>,
|
transformer: Option<Transformer<'a>>,
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
capstone: Capstone,
|
capstone: Capstone,
|
||||||
asan_runtime: Rc<RefCell<AsanRuntime>>,
|
asan_runtime: Rc<RefCell<AsanRuntime>>,
|
||||||
ranges: RangeMap<usize, (u16, &'a str)>,
|
ranges: RangeMap<usize, (u16, &'a str)>,
|
||||||
@ -196,6 +197,7 @@ fn get_pc(context: &CpuContext) -> usize {
|
|||||||
/// The implementation of the FridaInstrumentationHelper
|
/// The implementation of the FridaInstrumentationHelper
|
||||||
impl<'a> FridaInstrumentationHelper<'a> {
|
impl<'a> FridaInstrumentationHelper<'a> {
|
||||||
/// Constructor function to create a new FridaInstrumentationHelper, given a module_name.
|
/// Constructor function to create a new FridaInstrumentationHelper, given a module_name.
|
||||||
|
#[allow(clippy::clippy::too_many_lines)]
|
||||||
pub fn new(
|
pub fn new(
|
||||||
gum: &'a Gum,
|
gum: &'a Gum,
|
||||||
options: &'a FridaOptions,
|
options: &'a FridaOptions,
|
||||||
@ -206,8 +208,10 @@ impl<'a> FridaInstrumentationHelper<'a> {
|
|||||||
map: [0u8; MAP_SIZE],
|
map: [0u8; MAP_SIZE],
|
||||||
previous_pc: [0u64; 1],
|
previous_pc: [0u64; 1],
|
||||||
current_log_impl: 0,
|
current_log_impl: 0,
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
current_report_impl: 0,
|
current_report_impl: 0,
|
||||||
transformer: None,
|
transformer: None,
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
capstone: Capstone::new()
|
capstone: Capstone::new()
|
||||||
.arm64()
|
.arm64()
|
||||||
.mode(arch::arm64::ArchMode::Arm)
|
.mode(arch::arm64::ArchMode::Arm)
|
||||||
@ -216,7 +220,7 @@ impl<'a> FridaInstrumentationHelper<'a> {
|
|||||||
.expect("Failed to create Capstone object"),
|
.expect("Failed to create Capstone object"),
|
||||||
asan_runtime: AsanRuntime::new(options.clone()),
|
asan_runtime: AsanRuntime::new(options.clone()),
|
||||||
ranges: RangeMap::new(),
|
ranges: RangeMap::new(),
|
||||||
options: options,
|
options,
|
||||||
drcov_basic_blocks: vec![],
|
drcov_basic_blocks: vec![],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user