Skip to content
Snippets Groups Projects
Commit 10a24488 authored by an7s's avatar an7s
Browse files

Update the p1 xform to filter out (some) libc functions

parent c4900e63
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
#
# This is the main driver script for the P1 transform
# Run this script from top-level directory created by the peasoup script
#
......@@ -21,9 +22,6 @@ echo "=========================================="
$PEASOUP_HOME/tools/p1xform.genspri.sh $P1_DIR a.ncexe a.ncexe.annot > $P1_DIR/genspri.out 2> $P1_DIR/genspri.err
# NOT NEEDED ANYMORE????
#$PEASOUP_HOME/tools/generate_io_baseline.sh $CURRENT_DIR a.ncexe concolic.files_a.stratafied_0001 > gen_baseline.out 2> gen_baseline.err
#
# remove any candidate functions not covered
# this will go away once GrACE gives us the instruction coverage information
......@@ -36,15 +34,19 @@ FILTERED_OUT=$P1_DIR/p1.fn_coverage.filtered_out
KEEPS=$P1_DIR/p1.keep
FINAL_XFORM_FNS=$P1_DIR/p1.final
EXECUTED_ADDRESS_FILE=$CONCOLIC/executed_address_list.txt
LIBC_FILTER=$PEASOUP_HOME/tools/p1xform.filter.libc.txt
#grep "^0x" $CONCOLIC/trace_manager.run_*.log | cut -f2 -d":" | sort | uniq > tmp.$$
#$SECURITY_TRANSFORMS_HOME/tools/cover/cover a.ncexe a.ncexe.annot tmp.$$ $COVERAGE_FNS
#
# Prune out functions that do not have sufficient coverage
# Any function whose coverage metric starts with 0.0, e.g. 0.09, 0.0123, is pruned out
# We effectively prune out any functions whose coverage is not at least 10%
#
$SECURITY_TRANSFORMS_HOME/tools/cover/cover a.ncexe a.ncexe.annot $EXECUTED_ADDRESS_FILE $COVERAGE_FNS
grep -v "0\.0" $COVERAGE_FNS | cut -f1 -d" " > $CANDIDATE_FNS
grep "0\.0" $COVERAGE_FNS | cut -f1 -d" " > $FILTERED_OUT
#rm tmp.$$
cp $CANDIDATE_FNS $KEEPS
$PEASOUP_HOME/tools/p1xform.filter.sh $CANDIDATE_FNS $LIBC_FILTER > $KEEPS
echo "====================================================="
echo "Run BED"
......
......@@ -82,16 +82,30 @@ echo Done.
# Uncomment this part to test the P1 xform
#
#-----------------------------------------
# Start P1 transform
#-----------------------------------------
#
# P1 transform
#
#echo Starting the P1 transform
#date
#$PEASOUP_HOME/tools/p1xform.sh $newdir > p1xform.out 2> p1xform.err
#
#echo $current_dir/$newdir/p1.xform/p1.final
#
#if [ -f $current_dir/p1.xform/p1.final ]; then
# echo List of functions transformed:
# cat $current_dir/p1.xform/p1.final
#else
# echo P1 was unable to transform the subject program
#fi
#
#date
#echo Done with the P1 transform
#-----------------------------------------
# End P1 transform
#-----------------------------------------
# go back to original directory
cd - > /dev/null 2>&1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment