Hey,
> After getting slightly frustrated with afl-tmin and trying to build a
> smarter strategy to minimize test cases, I just wanted to confirm my
> method/assumptions:
I think you are generally correct, although if you're using
afl-showmap -e, it's only fair to compare it to afl-tmin -e.
The algorithm used by afl-tmin is fairly simple and yeah, relies on
removing continuous blocks. If you need to remove non-continuous
blocks (e.g., both an opening and a closing HTML tag in different
parts of the file), or if you need to also adjust length fields, it
won't do well.
It's probably difficult to support such strategies without making the
tool a lot slower for simple cases, so that's why it doesn't go there.
An interesting alternative would be to use afl-fuzz itself for
non-deterministic trimming, but it's not supported right now.
> 1. If I have 2 input files (A and B, A is larger than B) and I run
> afl-showmap (-e, so no hit counts) on them, I can assume that B is at least
> as good an input as A if all numbers that are present in the output of
> afl-showmap when processing A are also present in the output of afl-showmap
> after processing B.
afl-tmin does not make this assumption, since while the new test case
*may* be better for some intents and purposes, it's also now
functionally different. The extra code may not necessarily be
desirable. For example, perhaps the program now exits with an error.
Anyway, the trimming tool selects only for inputs that exhibit the
same measured behavior. That said, I can add support for such a mode.
It may be interesting to some folks.
/mz