Skip to content

Commit

Permalink
readd function and fix macos
Browse files Browse the repository at this point in the history
  • Loading branch information
meowjesty committed Jul 22, 2024
1 parent 0268e4c commit 578a3a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mirrord/layer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ fn enable_hooks(state: &LayerSetup) {

#[cfg(target_os = "macos")]
{
use crate::exec_utils::enable_macos_hooks;

let patch_binaries = state.sip_binaries();
unsafe { enable_macos_hooks(&mut hook_manager, patch_binaries) };

Expand Down
9 changes: 9 additions & 0 deletions mirrord/layer/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ impl LayerSetup {
.unwrap_or(true)
}

#[cfg(target_os = "macos")]
pub fn sip_binaries(&self) -> Vec<String> {
self.config
.sip_binaries
.as_deref()
.map(<[_]>::to_vec)
.unwrap_or_default()
}

pub fn is_debugger_port(&self, addr: &SocketAddr) -> bool {
self.debugger_ports.contains(addr)
}
Expand Down

0 comments on commit 578a3a3

Please sign in to comment.