mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-18 04:38:08 +00:00
cmplog random replacement code formatting
This commit is contained in:
@ -168,10 +168,14 @@ static u8 get_exec_checksum(afl_state_t *afl, u8 *buf, u32 len, u64 *cksum) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* replace everything with different values */
|
/* replace everything with different values */
|
||||||
static void random_replace(afl_state_t *afl, u8 *buf, u32 len){
|
static void random_replace(afl_state_t *afl, u8 *buf, u32 len) {
|
||||||
for(u32 i=0; i < len; i++){
|
|
||||||
|
for (u32 i = 0; i < len; i++) {
|
||||||
|
|
||||||
buf[i] = rand_below(afl, 256);
|
buf[i] = rand_below(afl, 256);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* replace everything with different values but stay in the same type */
|
/* replace everything with different values but stay in the same type */
|
||||||
@ -301,9 +305,13 @@ static u8 colorization(afl_state_t *afl, u8 *buf, u32 len,
|
|||||||
memcpy(backup, buf, len);
|
memcpy(backup, buf, len);
|
||||||
memcpy(changed, buf, len);
|
memcpy(changed, buf, len);
|
||||||
if (afl->cmplog_random_colorization) {
|
if (afl->cmplog_random_colorization) {
|
||||||
|
|
||||||
random_replace(afl, changed, len);
|
random_replace(afl, changed, len);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
type_replace(afl, changed, len);
|
type_replace(afl, changed, len);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((rng = pop_biggest_range(&ranges)) != NULL &&
|
while ((rng = pop_biggest_range(&ranges)) != NULL &&
|
||||||
|
Reference in New Issue
Block a user