Fix to handling of persistent mode using JS
MODIFY
frida_mode/src/js/js_api.c
frida_mode/src/js/js_api.c
@@ -47,6 +47,14 @@ __attribute__((visibility("default"))) void js_api_set_persistent_address(
persistent_start = GPOINTER_TO_SIZE(address);
+ if (getenv("__AFL_PERSISTENT") == NULL) {
+
+ FATAL(
+ "You must set __AFL_PERSISTENT manually if using persistent mode "
+ "configured using JS");
+
+ }
+
}
__attribute__((visibility("default"))) void js_api_set_persistent_return(

MODIFY
frida_mode/test/png/persistent/hook/GNUmakefile
frida_mode/test/png/persistent/hook/GNUmakefile
@@ -144,6 +144,7 @@ frida_entry_slow: $(AFLPP_DRIVER_DUMMY_INPUT) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) | $
frida_js_load: $(AFLPP_DRIVER_DUMMY_INPUT) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) | $(BUILD_DIR)
AFL_PRELOAD=$(AFL_PRELOAD) \
+ __AFL_PERSISTENT=1 \
AFL_FRIDA_JS_SCRIPT=load.js \
$(ROOT)afl-fuzz \
-D \

Fix to handling of persistent mode using JS