mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-24 22:53:24 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
302adcb0d5 | |||
99b7aea821 | |||
1ddc3df325 | |||
32ebe44453 | |||
9f5de4c8ca | |||
ae0d8b8d90 |
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user