google / atheris

Apache License 2.0
1.35k stars 111 forks source link

User exit callback feature? #69

Open abol-karimi opened 10 months ago

abol-karimi commented 10 months ago

Is it possible to give a callback that will be run at exit? I'm using custom mutators and crossovers, and I want to save their (random-number generators') state before Atheris exits. My goal is to be able to resume fuzzing from the saved state.

jvoisin commented 10 months ago

It's not possible, but since you have the input of the fuzzer, you should be able to reconstruct all the states, shouldn't you?

abol-karimi commented 10 months ago

Not sure what you mean by 'reconstruct'.

I run atheris with the max_total_time option, so I don't even know how many iterations will be run. I can wrap the callback functions (fuzz target, custom mutator, custom crossover) in callable objects which keep track of their state but then I have to save the state after each call of the fuzz target since I wouldn't know which iteration is the last one.