Minimize corpus
This commit is contained in:
parent
ba3393f792
commit
7c4aebc9d8
|
|
@ -166,6 +166,24 @@ runs:
|
|||
fi
|
||||
echo "Fuzz binary: ${FUZZ_BIN}"
|
||||
|
||||
# ── Minimize corpus ──
|
||||
SEED_COUNT=$(find "${SEEDS}" -maxdepth 1 -type f | wc -l)
|
||||
if [ "${SEED_COUNT}" -gt 1 ]; then
|
||||
echo "Minimizing corpus (${SEED_COUNT} inputs)..."
|
||||
MINIMIZED="afl-cmin-${TARGET_NUM}"
|
||||
rm -rf "${MINIMIZED}"
|
||||
mkdir -p "${MINIMIZED}"
|
||||
if afl-cmin -i "${SEEDS}" -o "${MINIMIZED}" -- "${FUZZ_BIN}" >/dev/null 2>&1; then
|
||||
MINIMIZED_COUNT=$(find "${MINIMIZED}" -maxdepth 1 -type f | wc -l)
|
||||
echo "Corpus minimized: ${SEED_COUNT} -> ${MINIMIZED_COUNT} inputs"
|
||||
rm -rf "${SEEDS}"
|
||||
mv "${MINIMIZED}" "${SEEDS}"
|
||||
else
|
||||
echo "afl-cmin failed, using unminimized corpus"
|
||||
rm -rf "${MINIMIZED}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── Run AFL++ ──
|
||||
FINDINGS="findings-${TARGET_NUM}"
|
||||
rm -rf "${FINDINGS}"
|
||||
|
|
|
|||
Loading…
Reference in New Issue