@@ -10,11 +10,9 @@ use libafl_targets::drcov::{DrCovBasicBlock, DrCovWriter};
10
10
11
11
#[ cfg( target_arch = "aarch64" ) ]
12
12
use capstone:: arch:: {
13
+ arch:: { self , BuildsCapstone } ,
13
14
arm64:: { Arm64Extender , Arm64OperandType , Arm64Shift } ,
14
15
ArchOperand :: Arm64Operand ,
15
- } ;
16
- use capstone:: {
17
- arch:: { self , BuildsCapstone } ,
18
16
Capstone , Insn ,
19
17
} ;
20
18
@@ -29,6 +27,7 @@ use frida_gum::{
29
27
CpuContext ,
30
28
} ;
31
29
use frida_gum:: { Gum , Module , PageProtection } ;
30
+ #[ cfg( target_arch = "aarch64" ) ]
32
31
use num_traits:: cast:: FromPrimitive ;
33
32
34
33
use rangemap:: RangeMap ;
@@ -58,9 +57,11 @@ pub struct FridaInstrumentationHelper<'a> {
58
57
map : [ u8 ; MAP_SIZE ] ,
59
58
previous_pc : [ u64 ; 1 ] ,
60
59
current_log_impl : u64 ,
60
+ #[ cfg( target_arch = "aarch64" ) ]
61
61
current_report_impl : u64 ,
62
62
/// Transformer that has to be passed to FridaInProcessExecutor
63
63
transformer : Option < Transformer < ' a > > ,
64
+ #[ cfg( target_arch = "aarch64" ) ]
64
65
capstone : Capstone ,
65
66
asan_runtime : Rc < RefCell < AsanRuntime > > ,
66
67
ranges : RangeMap < usize , ( u16 , & ' a str ) > ,
@@ -196,6 +197,7 @@ fn get_pc(context: &CpuContext) -> usize {
196
197
/// The implementation of the FridaInstrumentationHelper
197
198
impl < ' a > FridaInstrumentationHelper < ' a > {
198
199
/// Constructor function to create a new FridaInstrumentationHelper, given a module_name.
200
+ #[ allow( clippy:: clippy:: too_many_lines) ]
199
201
pub fn new (
200
202
gum : & ' a Gum ,
201
203
options : & ' a FridaOptions ,
@@ -206,8 +208,10 @@ impl<'a> FridaInstrumentationHelper<'a> {
206
208
map : [ 0u8 ; MAP_SIZE ] ,
207
209
previous_pc : [ 0u64 ; 1 ] ,
208
210
current_log_impl : 0 ,
211
+ #[ cfg( target_arch = "aarch64" ) ]
209
212
current_report_impl : 0 ,
210
213
transformer : None ,
214
+ #[ cfg( target_arch = "aarch64" ) ]
211
215
capstone : Capstone :: new ( )
212
216
. arm64 ( )
213
217
. mode ( arch:: arm64:: ArchMode :: Arm )
@@ -216,7 +220,7 @@ impl<'a> FridaInstrumentationHelper<'a> {
216
220
. expect ( "Failed to create Capstone object" ) ,
217
221
asan_runtime : AsanRuntime :: new ( options. clone ( ) ) ,
218
222
ranges : RangeMap :: new ( ) ,
219
- options : options ,
223
+ options,
220
224
drcov_basic_blocks : vec ! [ ] ,
221
225
} ;
222
226
0 commit comments