about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-10-03 12:16:56 +0200
committerGitHub <noreply@github.com>2021-10-03 12:16:56 +0200
commit5df7b12b757884c17168a4aece1e57b13d0b7f3f (patch)
tree0257f833801ac2b4f8b2e635d8790937b2d33856
parent1a79a36762ccb5cac6da8ce09fd681166d02352b (diff)
parentfc48a58e64b8c5abafa83b50ea68bf8e47d00552 (diff)
downloadafl++-5df7b12b757884c17168a4aece1e57b13d0b7f3f.tar.gz
Merge pull request #1096 from devnexen/frida_mode_macos_warning_fix
frida mode macOs warning fix, syscall being deprecated, using pthread…
-rw-r--r--frida_mode/src/instrument/instrument.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/frida_mode/src/instrument/instrument.c b/frida_mode/src/instrument/instrument.c
index fd0982f8..71d9bdf6 100644
--- a/frida_mode/src/instrument/instrument.c
+++ b/frida_mode/src/instrument/instrument.c
@@ -341,8 +341,14 @@ void instrument_init(void) {
      * parallel fuzzing. The seed itself, doesn't have to be random, it
      * just needs to be different for each instance.
      */
+    guint64 tid;
+#if defined(__APPLE__)
+    pthread_threadid_np(NULL, &tid);
+#else
+    tid = syscall(SYS_gettid);
+#endif
     instrument_hash_seed = g_get_monotonic_time() ^
-                           (((guint64)getpid()) << 32) ^ syscall(SYS_gettid);
+                           (((guint64)getpid()) << 32) ^ tid;
 
   }