about summary refs log tree commit diff
path: root/frida_mode/src/util.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-12-20 21:30:55 +0100
committerGitHub <noreply@github.com>2021-12-20 21:30:55 +0100
commit6106efa30165ace5d36da36c79778b52935f186f (patch)
treeabe5e84e618ba5ae0a926bdd9e3a37cf2c4af4c7 /frida_mode/src/util.c
parentdb19116ce692a7a317ee3e0f4a553f754465eb47 (diff)
parentd59a76261db02141dae06bf804fd0f84679f0d34 (diff)
downloadafl++-6106efa30165ace5d36da36c79778b52935f186f.tar.gz
Merge pull request #1223 from WorksButNotTested/frida
Improvements to debug output
Diffstat (limited to 'frida_mode/src/util.c')
-rw-r--r--frida_mode/src/util.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/frida_mode/src/util.c b/frida_mode/src/util.c
index 6f52b6cb..e4d2aaf2 100644
--- a/frida_mode/src/util.c
+++ b/frida_mode/src/util.c
@@ -1,5 +1,7 @@
 #include "util.h"
 
+gboolean util_verbose = FALSE;
+
 guint64 util_read_address(char *key, guint64 default_value) {
 
   char *value_str = getenv(key);
@@ -87,12 +89,13 @@ guint64 util_read_num(char *key, guint64 default_value) {
 gboolean util_output_enabled(void) {
 
   static gboolean initialized = FALSE;
-  static gboolean enabled = TRUE;
+  static gboolean enabled = FALSE;
 
   if (!initialized) {
 
     initialized = TRUE;
-    if (getenv("AFL_DEBUG_CHILD") == NULL) { enabled = FALSE; }
+    if (getenv("AFL_DEBUG_CHILD") != NULL) { enabled = TRUE; }
+    if (util_verbose_enabled()) { enabled = TRUE; }
 
   }
 
@@ -100,6 +103,21 @@ gboolean util_output_enabled(void) {
 
 }
 
+gboolean util_verbose_enabled(void) {
+
+  static gboolean initialized = FALSE;
+
+  if (!initialized) {
+
+    initialized = TRUE;
+    if (getenv("AFL_FRIDA_VERBOSE") != NULL) { util_verbose = TRUE; }
+
+  }
+
+  return util_verbose;
+
+}
+
 gsize util_rotate(gsize val, gsize shift, gsize size) {
 
   if (shift == 0) { return val; }