Skip to content

Commit

Permalink
Merge branch 'main' into taplo-fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
s1341 authored Sep 11, 2024
2 parents de9a2b0 + e367336 commit 7bb8b09
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 46 deletions.
8 changes: 5 additions & 3 deletions frida-gum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ description.workspace = true

[features]
auto-download = ["frida-gum-sys/auto-download"]
backtrace = ["libc"]
backtrace = ["libc", "std"]
event-sink = ["frida-gum-sys/event-sink"]
invocation-listener = ["frida-gum-sys/invocation-listener"]
memory-access-monitor = []
module-names = []
memory-access-monitor = ["std"]
module-names = ["std"]
stalker-observer = ["frida-gum-sys/stalker-observer"]
stalker-params = ["frida-gum-sys/stalker-params"]
std = []

[dependencies]
cstr_core = { version = "0.2.6", default-features = false, features = [
Expand All @@ -40,4 +41,5 @@ features = [
"invocation-listener",
"stalker-observer",
"stalker-params",
"std"
]
21 changes: 3 additions & 18 deletions frida-gum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,12 @@
//! }
//! ```
#![cfg_attr(
not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)),
no_std
)]
#![cfg_attr(not(feature = "std"), no_std)]
#![deny(warnings)]
#![allow(clippy::needless_doctest_main)]
#![allow(clippy::missing_safety_doc)]

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

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

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

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

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

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

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

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

#[cfg(not(any(
feature = "module-names",
feature = "backtrace",
feature = "memory-access-monitor"
)))]
#[cfg(not(feature = "std"))]
use alloc::{
boxed::Box,
string::{String, ToString},
Expand Down
6 changes: 1 addition & 5 deletions frida-gum/src/range_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ use {
frida_gum_sys as gum_sys,
};

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

/// The memory protection of an unassociated page.
Expand Down
6 changes: 1 addition & 5 deletions frida-gum/src/stalker/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ use {
core::{ffi::c_void, marker::PhantomData},
};

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

pub struct StalkerIterator<'a> {
Expand Down

0 comments on commit 7bb8b09

Please sign in to comment.