about summary refs log tree commit diff
path: root/frida_mode/src/util.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2022-01-11 12:20:35 +0100
committerGitHub <noreply@github.com>2022-01-11 12:20:35 +0100
commit10dae419d6e3ebc38f53840c5abfe98e9c901217 (patch)
tree352576e19c8a504c40ea58dbb141056762901a69 /frida_mode/src/util.c
parent74a8f145e09d0361d8f576eb3f2e8881b6116f18 (diff)
parentd2715336a54635bb6e617a2e739c0ad5fe51d28d (diff)
downloadafl++-10dae419d6e3ebc38f53840c5abfe98e9c901217.tar.gz
Merge pull request #1236 from AFLplusplus/dev
push to stable
Diffstat (limited to 'frida_mode/src/util.c')
-rw-r--r--frida_mode/src/util.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/frida_mode/src/util.c b/frida_mode/src/util.c
index 6f52b6cb..90c10917 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);
@@ -66,7 +68,7 @@ guint64 util_read_num(char *key, guint64 default_value) {
 
   errno = 0;
 
-  guint64 value = g_ascii_strtoull(value_str, NULL, 10);
+  guint64 value = g_ascii_strtoull(value_str, &end_ptr, 10);
 
   if (errno != 0) {
 
@@ -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; }