Compare commits

...

6 Commits

Author SHA1 Message Date
302adcb0d5 upd 2024-07-20 08:08:25 +02:00
99b7aea821 upd 2024-07-20 08:05:21 +02:00
1ddc3df325 v1 2024-07-19 16:50:01 +02:00
32ebe44453 fix 2024-07-19 16:48:07 +02:00
9f5de4c8ca alternative weight power 2024-07-19 13:53:17 +02:00
ae0d8b8d90 weight power 2024-07-19 13:52:22 +02:00
3 changed files with 33 additions and 9 deletions

View File

@ -338,15 +338,16 @@ enum {
enum {
/* 00 */ EXPLORE, /* AFL default, Exploration-based constant schedule */
/* 01 */ MMOPT, /* Modified MOPT schedule */
/* 02 */ EXPLOIT, /* AFL's exploitation-based const. */
/* 03 */ FAST, /* Exponential schedule */
/* 04 */ COE, /* Cut-Off Exponential schedule */
/* 05 */ LIN, /* Linear schedule */
/* 06 */ QUAD, /* Quadratic schedule */
/* 07 */ RARE, /* Rare edges */
/* 08 */ SEEK, /* EXPLORE that ignores timings */
/* 00 */ EXPLORE, /* AFL default, exploration-based constant schedule */
/* 01 */ EXPLOIT, /* AFL's exploitation-based const. */
/* 02 */ WEIGHT, /* Based on seed weighting algorithm */
/* 03 */ MMOPT, /* Modified MOPT schedule */
/* 04 */ FAST, /* Exponential schedule */
/* 05 */ COE, /* Cut-Off Exponential schedule */
/* 06 */ LIN, /* Linear schedule */
/* 07 */ QUAD, /* Quadratic schedule */
/* 08 */ RARE, /* Rare edges */
/* 09 */ SEEK, /* EXPLORE that ignores timings */
POWER_SCHEDULES_NUM

View File

@ -1020,6 +1020,22 @@ void cull_queue(afl_state_t *afl) {
u32 calculate_score(afl_state_t *afl, struct queue_entry *q) {
if (likely(afl->schedule == WEIGHT)) {
u32 val = 250;
double mul = 1.0 + ((q->weight - 1.0) * 2.0);
if (unlikely(mul < 0.01)) { return 10; }
u32 ret = val * mul;
if (unlikely(ret < 10)) { return 10; }
return ret;
}
u32 cal_cycles = afl->total_cal_cycles;
u32 bitmap_entries = afl->total_bitmap_entries;

View File

@ -745,6 +745,10 @@ int main(int argc, char **argv_orig, char **envp) {
afl->schedule = EXPLOIT;
} else if (!stricmp(optarg, "weight")) {
afl->schedule = WEIGHT;
} else if (!stricmp(optarg, "lin")) {
afl->schedule = LIN;
@ -1692,6 +1696,9 @@ int main(int argc, char **argv_orig, char **envp) {
case EXPLORE:
OKF("Using exploration-based constant power schedule (EXPLORE)");
break;
case WEIGHT:
OKF("Using weight-based power schedule (WEIGHT)");
break;
default:
FATAL("Unknown power schedule");
break;