summaryrefslogtreecommitdiff
path: root/components/net/lwip/lwip-2.2.1/test/fuzz/output_to_pcap.sh
blob: c999ff0392939d145f6d4c3fa2968c7c2175145a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash

if [ -z "$1" ]
then
	echo "This script will make pcap files from the afl-fuzz crash/hang files"
	echo "It needs hexdump and text2pcap"
	echo "Please give output directory as argument"
	exit 2
fi

for i in `ls $1/crashes/id*`
do
	PCAPNAME=`echo $i | grep pcap`
	if [ -z "$PCAPNAME" ]; then
		hexdump -C $i > $1/$$.tmp
		text2pcap $1/$$.tmp ${i}.pcap
	fi
done
for i in `ls $1/hangs/id*`
do
	PCAPNAME=`echo $i | grep pcap`
	if [ -z "$PCAPNAME" ]; then
		hexdump -C $i > $1/$$.tmp
		text2pcap $1/$$.tmp ${i}.pcap
	fi
done
rm -f $1/$$.tmp

echo
echo "Created pcap files:"
ls $1/*/*.pcap