diff options
author | vanhauser-thc <vh@thc.org> | 2024-02-08 14:54:10 +0100 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2024-02-08 14:54:10 +0100 |
commit | eaf4a29930fb5a397716cb34db71f1f14530923a (patch) | |
tree | 6f09dc1d21983e3a04da5b0e5c96e84414386208 | |
parent | 48070e0148699fbd96dc9f4e5950565498d4ad43 (diff) | |
download | afl++-eaf4a29930fb5a397716cb34db71f1f14530923a.tar.gz |
make redqueen hashmap not default
-rw-r--r-- | src/afl-fuzz-redqueen.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/afl-fuzz-redqueen.c b/src/afl-fuzz-redqueen.c index 03a25903..3342445a 100644 --- a/src/afl-fuzz-redqueen.c +++ b/src/afl-fuzz-redqueen.c @@ -29,6 +29,7 @@ #include "cmplog.h" // #define _DEBUG +// #define USE_HASHMAP // #define CMPLOG_INTROSPECTION // CMP attribute enum @@ -87,10 +88,12 @@ static u32 hshape; static u64 screen_update; static u64 last_update; +#ifdef USE_HASHMAP // hashmap functions void hashmap_reset(); bool hashmap_search_and_add(uint8_t type, uint64_t key); bool hashmap_search_and_add_ptr(uint8_t type, u8 *key); +#endif static struct range *add_range(struct range *ranges, u32 start, u32 end) { @@ -1954,6 +1957,7 @@ static u8 cmp_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u8 *cbuf, } +#ifdef USE_HASHMAP // TODO: add attribute? not sure if (hshape <= 8 && hashmap_search_and_add(hshape - 1, o->v0) && hashmap_search_and_add(hshape - 1, orig_o->v0) && @@ -1963,6 +1967,7 @@ static u8 cmp_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u8 *cbuf, continue; } +#endif #ifdef _DEBUG fprintf(stderr, "Handling: %llx->%llx vs %llx->%llx attr=%u shape=%u\n", @@ -2775,6 +2780,7 @@ static u8 rtn_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u8 *cbuf, fprintf(stderr, "\n"); #endif +#ifdef USE_HASHMAP if (hshape <= 8 && hashmap_search_and_add_ptr(hshape - 1, o->v0) && hashmap_search_and_add_ptr(hshape - 1, orig_o->v0) && hashmap_search_and_add_ptr(hshape - 1, o->v1) && @@ -2783,6 +2789,7 @@ static u8 rtn_fuzz(afl_state_t *afl, u32 key, u8 *orig_buf, u8 *buf, u8 *cbuf, continue; } +#endif t = taint; while (t->next) { @@ -3050,7 +3057,9 @@ u8 input_to_state_stage(afl_state_t *afl, u8 *orig_buf, u8 *buf, u32 len) { // Start insertion loop +#ifdef USE_HASHMAP hashmap_reset(); +#endif u64 orig_hit_cnt, new_hit_cnt; u64 orig_execs = afl->fsrv.total_execs; |