about summary refs log tree commit diff
path: root/frida_mode/src/interceptor.c
diff options
context:
space:
mode:
Diffstat (limited to 'frida_mode/src/interceptor.c')
-rw-r--r--frida_mode/src/interceptor.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/frida_mode/src/interceptor.c b/frida_mode/src/interceptor.c
index ba05a80a..8d41b075 100644
--- a/frida_mode/src/interceptor.c
+++ b/frida_mode/src/interceptor.c
@@ -1,4 +1,5 @@
 #include "frida-gum.h"
+
 #include "debug.h"
 
 #include "interceptor.h"
@@ -14,3 +15,21 @@ void intercept(void *address, gpointer replacement, gpointer user_data) {
 
 }
 
+void unintercept(void *address) {
+
+  GumInterceptor *interceptor = gum_interceptor_obtain();
+
+  gum_interceptor_begin_transaction(interceptor);
+  gum_interceptor_revert(interceptor, address);
+  gum_interceptor_end_transaction(interceptor);
+  gum_interceptor_flush(interceptor);
+
+}
+
+void unintercept_self(void) {
+
+  GumInvocationContext *ctx = gum_interceptor_get_current_invocation();
+  unintercept(ctx->function);
+
+}
+