Skip to content

Commit

Permalink
fix: compilation on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Apr 2, 2024
1 parent 389b214 commit d43de2b
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 12 deletions.
6 changes: 5 additions & 1 deletion frida-gum/src/instruction_writer/aarch64/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ use {
gum_sys::GumArgument,
};

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::vec::Vec;

/// The Aarch64 instruction writer.
Expand Down
6 changes: 5 additions & 1 deletion frida-gum/src/instruction_writer/x86_64/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ use {
gum_sys::{gssize, GumArgument, GumBranchHint},
};

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::vec::Vec;

/// The x86/x86_64 instruction writer.
Expand Down
12 changes: 10 additions & 2 deletions frida-gum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
#![allow(clippy::needless_doctest_main)]
#![allow(clippy::missing_safety_doc)]

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
extern crate alloc;

extern crate num;
Expand All @@ -71,7 +75,11 @@ use core::{
fmt::{Debug, Display, Formatter, LowerHex, UpperHex},
};

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::string::String;

pub mod stalker;
Expand Down
6 changes: 5 additions & 1 deletion frida-gum/src/memory_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ use core::{
ops::Range,
};

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::vec::Vec;

pub struct MatchPattern {
Expand Down
6 changes: 5 additions & 1 deletion frida-gum/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ use {
frida_gum_sys::{gboolean, gpointer, GumExportDetails, GumModuleDetails, GumSymbolDetails},
};

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::{boxed::Box, string::String, vec, vec::Vec};

extern "C" fn enumerate_ranges_callout(
Expand Down
6 changes: 5 additions & 1 deletion frida-gum/src/module_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ use {
frida_gum_sys as gum_sys,
};

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::{
boxed::Box,
string::{String, ToString},
Expand Down
9 changes: 6 additions & 3 deletions frida-gum/src/range_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,19 @@
extern crate alloc;
use {
crate::MemoryRange,
alloc::string::String,
core::{
ffi::{c_void, CStr},
marker::PhantomData,
},
frida_gum_sys as gum_sys,
};

#[cfg(not(feature = "module-names"))]
use alloc::boxed::Box;
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::{boxed::Box, string::String};

/// The memory protection of an unassociated page.
#[derive(Clone, FromPrimitive)]
Expand Down
6 changes: 5 additions & 1 deletion frida-gum/src/stalker/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ use {
core::{ffi::c_void, marker::PhantomData},
};

#[cfg(not(feature = "module-names"))]
#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
use alloc::boxed::Box;

pub struct StalkerIterator<'a> {
Expand Down
1 change: 0 additions & 1 deletion frida/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

use frida_sys::{FridaSpawnOptions, _FridaProcess};
use std::convert::TryInto;
use std::ffi::{CStr, CString};
use std::marker::PhantomData;

Expand Down

0 comments on commit d43de2b

Please sign in to comment.