aboutsummaryrefslogtreecommitdiff
path: root/frida_mode/src/interceptor.c
diff options
context:
space:
mode:
authorhexcoder <hexcoder-@users.noreply.github.com>2021-05-31 19:18:24 +0200
committerGitHub <noreply@github.com>2021-05-31 19:18:24 +0200
commit97a1f89881878db9bd6b4cd666b3447a63818dcf (patch)
tree46e844356f7cf88c08f9f9907caa11656a24f416 /frida_mode/src/interceptor.c
parentb246de789105750558f3d6f884ba61e54cb98441 (diff)
parent1a2da67ed0505c9ac0aa1048ba3d607f3c1aa639 (diff)
downloadafl++-97a1f89881878db9bd6b4cd666b3447a63818dcf.tar.gz
Merge branch 'dev' into going_atomic
Diffstat (limited to 'frida_mode/src/interceptor.c')
-rw-r--r--frida_mode/src/interceptor.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/frida_mode/src/interceptor.c b/frida_mode/src/interceptor.c
index ba05a80a..d2802752 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"
@@ -9,8 +10,26 @@ void intercept(void *address, gpointer replacement, gpointer user_data) {
gum_interceptor_begin_transaction(interceptor);
GumReplaceReturn ret =
gum_interceptor_replace(interceptor, address, replacement, user_data);
- if (ret != GUM_ATTACH_OK) { FATAL("gum_interceptor_attach: %d", ret); }
+ if (ret != GUM_REPLACE_OK) { FATAL("gum_interceptor_attach: %d", ret); }
gum_interceptor_end_transaction(interceptor);
}
+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);
+
+}
+