mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-15 11:28:08 +00:00
Add __afl_set_persistent_mode
This commit is contained in:
@ -11,6 +11,10 @@
|
|||||||
#include "stats.h"
|
#include "stats.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
typedef uint8_t u8;
|
||||||
|
|
||||||
|
extern void __afl_set_persistent_mode(u8 mode);
|
||||||
|
|
||||||
__attribute__((visibility("default"))) void js_api_done() {
|
__attribute__((visibility("default"))) void js_api_done() {
|
||||||
|
|
||||||
js_done = TRUE;
|
js_done = TRUE;
|
||||||
@ -47,13 +51,7 @@ __attribute__((visibility("default"))) void js_api_set_persistent_address(
|
|||||||
|
|
||||||
persistent_start = GPOINTER_TO_SIZE(address);
|
persistent_start = GPOINTER_TO_SIZE(address);
|
||||||
|
|
||||||
if (getenv("__AFL_PERSISTENT") == NULL) {
|
__afl_set_persistent_mode(1);
|
||||||
|
|
||||||
FATAL(
|
|
||||||
"You must set __AFL_PERSISTENT manually if using persistent mode "
|
|
||||||
"configured using JS");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,6 @@ 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)
|
frida_js_load: $(AFLPP_DRIVER_DUMMY_INPUT) $(AFLPP_FRIDA_DRIVER_HOOK_OBJ) | $(BUILD_DIR)
|
||||||
AFL_PRELOAD=$(AFL_PRELOAD) \
|
AFL_PRELOAD=$(AFL_PRELOAD) \
|
||||||
__AFL_PERSISTENT=1 \
|
|
||||||
AFL_FRIDA_JS_SCRIPT=load.js \
|
AFL_FRIDA_JS_SCRIPT=load.js \
|
||||||
$(ROOT)afl-fuzz \
|
$(ROOT)afl-fuzz \
|
||||||
-D \
|
-D \
|
||||||
|
@ -1904,8 +1904,7 @@ void __cmplog_rtn_hook_n(u8 *ptr1, u8 *ptr2, u64 len) {
|
|||||||
if (unlikely(!len)) return;
|
if (unlikely(!len)) return;
|
||||||
int l = MIN(31, len);
|
int l = MIN(31, len);
|
||||||
|
|
||||||
if ((l = area_is_valid(ptr1, l)) <= 0 ||
|
if ((l = area_is_valid(ptr1, l)) <= 0 || (l = area_is_valid(ptr2, l)) <= 0)
|
||||||
(l = area_is_valid(ptr2, l)) <= 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// fprintf(stderr, "RTN2 %u\n", l);
|
// fprintf(stderr, "RTN2 %u\n", l);
|
||||||
@ -2247,5 +2246,11 @@ void __afl_coverage_interesting(u8 val, u32 id) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void __afl_set_persistent_mode(u8 mode) {
|
||||||
|
|
||||||
|
is_persistent = mode;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#undef write_error
|
#undef write_error
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user