Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from fennecdjay/UnionTmpl
Some cleanup
- Loading branch information
Showing
6 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
: "${AFL_PREFIX:=afl-}" | ||
: "${AFL_CC:=afl-gcc}" | ||
: "${RESULT_DIR:=${AFL_PREFIX}result}" | ||
|
||
clean_lib() { | ||
echo "🛀 cleaning $1" | ||
cd "$1" && make clean all && cd .. | ||
} | ||
|
||
compile() { | ||
export CC="$AFL_CC" | ||
clean_lib util | ||
clean_lib ast | ||
clean_lib "$PWD" | ||
} | ||
|
||
prepare() { | ||
CRASH_DIR=${AFL_PREFIX}crash | ||
if [ -d "$CRASH_DIR" ] | ||
then echo "✋ $CRASH_DIR already contains at risk data" | ||
else mkdir "$CRASH_DIR" | ||
fi | ||
for file in "$RESULT_DIR"/*/crashes/id* | ||
do | ||
NEW_NAME="$(basename "$file" | sed 's/id:0*\([0-9]*\),.*/\1.gw/')" | ||
cp "$file" "$NEW_NAME" | ||
done | ||
} | ||
|
||
#compile | ||
prepare |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/sh | ||
: "${PRG:=./gwion}" | ||
|
||
pahole -s ${PRG} | while read name size gap | ||
do [ $size -gt 64 ] && echo $name $size | ||
[ $gap -gt 0 ] && echo "$name has a gap" | ||
pahole -s ${PRG} | while read -r name size gap | ||
do [ "$size" -gt 64 ] && echo "$name $size" | ||
[ "$gap" -gt 0 ] && echo "$name has a gap" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters