googleprojectzero / winafl

A fork of AFL for fuzzing Windows binaries
Apache License 2.0
2.36k stars 533 forks source link

tmin: Proposing del_len option for improved speed #431

Closed gnbon closed 8 months ago

gnbon commented 8 months ago

Issue

Block deletion in the tmin stage is a time-consuming task that scales with the size of the file.

Background

https://github.com/googleprojectzero/winafl/blob/25d5840799b628c8ef7750cd07ef2e30b299b156/afl-tmin.c#L911-L923 As del_len, the unit for reducing unnecessary blocks, decreases by powers of two, the operation takes longer. However, there are instances where speed is more critical than achieving minimal minimization.

https://github.com/googleprojectzero/winafl/blob/25d5840799b628c8ef7750cd07ef2e30b299b156/afl-tmin.c#L968-L971 Currently, the minimum value of del_len is 1. However, increasing the minimum value would result in faster speeds.

proposal

Therefore, I propose allowing del_len to be specified as an option.

Alternatively, a method could be implemented to terminate the process if there is no reduction of even 1 byte, or if the reduction is less than n bytes, in a given cycle.

ifratric commented 8 months ago

Hi, if this is something you'd like to fix, please go ahead and and submit a pull request.

gnbon commented 8 months ago

Okey. I implemented the feature and submitted the pull request. How does it look?