File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -254,6 +254,9 @@ namespace Frida.Agent {
254254 string [] tokens = agent_parameters. split (" |" );
255255 unowned string transport_uri = tokens[0 ];
256256 bool enable_exceptor = true ;
257+ #if DARWIN
258+ enable_exceptor = ! Gum . Darwin . query_hardened ();
259+ #endif
257260 bool enable_exit_monitor = true ;
258261 bool enable_thread_suspend_monitor = true ;
259262 foreach (unowned string option in tokens[1 : ]) {
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ extra_link_args = []
1414if host_os_family != ' windows'
1515 extra_vala_args += [' --pkg=posix' ]
1616endif
17+ if host_os_family == ' darwin'
18+ extra_vala_args += [' --pkg=frida-gum-darwin-1.0' ]
19+ endif
1720
1821if host_os_family == ' darwin'
1922 extra_link_args += [' -Wl,-exported_symbol,_frida_agent_main' ]
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ namespace Frida {
3030 }
3131
3232 private FileDescriptorTablePadder () {
33+ #if DARWIN
34+ if (Gum . Darwin . query_hardened ())
35+ return ;
36+ #endif
37+
3338 open_needed_descriptors ();
3439 }
3540
@@ -44,6 +49,11 @@ namespace Frida {
4449 }
4550
4651 public void move_descriptor_if_needed (ref int fd ) {
52+ #if DARWIN
53+ if (Gum . Darwin . query_hardened ())
54+ return ;
55+ #endif
56+
4757 if (fd >= MIN_TABLE_SIZE )
4858 return ;
4959
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ extra_vala_args = []
2929if host_os_family != ' windows'
3030 extra_vala_args += [' --pkg=posix' ]
3131endif
32+ if host_os_family == ' darwin'
33+ extra_vala_args += [' --pkg=frida-gum-darwin-1.0' ]
34+ endif
3235if host_os_family == ' linux'
3336 extra_vala_args += [' --pkg=linux' ]
3437endif
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ if host_os_family == 'windows'
1212 ]
1313elif host_os in [' macos' , ' ios' ]
1414 pipe_sources += [' pipe-darwin.c' ]
15+
16+ system_deps += [gio_unix_dep]
17+ vala_args += [' --pkg=frida-gum-darwin-1.0' , ' --pkg=posix' ]
1518else
1619 pipe_sources += [' pipe-unix.c' ]
1720
Original file line number Diff line number Diff line change @@ -118,14 +118,21 @@ namespace Frida {
118118 }
119119#elif MACOS || IOS
120120 namespace DarwinPipe {
121- public static Future<SocketConnection > open (string address , Cancellable ? cancellable ) {
122- var promise = new Promise<SocketConnection > ();
121+ public static Future<IOStream > open (string address , Cancellable ? cancellable ) {
122+ var promise = new Promise<IOStream > ();
123123
124124 try {
125125 var fd = _consume_stashed_file_descriptor (address);
126- var socket = new Socket .from_fd (fd);
127- var connection = SocketConnection . factory_create_connection (socket);
128- promise. resolve (connection);
126+ IOStream stream;
127+ if (Gum . Darwin . query_hardened ()) {
128+ var input = new UnixInputStream (fd, true );
129+ var output = new UnixOutputStream (fd, false );
130+ stream = new SimpleIOStream (input, output);
131+ } else {
132+ var socket = new Socket .from_fd (fd);
133+ stream = SocketConnection . factory_create_connection (socket);
134+ }
135+ promise. resolve (stream);
129136 } catch (GLib . Error e) {
130137 promise. reject (e);
131138 }
You can’t perform that action at this time.
0 commit comments