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

New version

Former-commit-id: ff770d5e45a7b3f382dc89b57b11786776615c13
parent a0bcdbcb
No related branches found
No related tags found
No related merge requests found
......@@ -4,16 +4,15 @@
#
# inputs
ORIGINAL_BINARY=$1 # a.ncexe
ANNOTATION_FILE=$2 # a.ncexe.annot
EXECUTED_ADDRESS_FILE=$3 # from GrACE, list of executed addresses
FILTER_FILE=$4 # list of known functions to blacklist, e.g. libc
ORIGINAL_BINARY=$1 # a.ncexe
ANNOTATION_FILE=$2 # a.ncexe.annot
EXECUTED_ADDRESS_FILE=$3 # list of executed addresses (e.g. Grace or manual)
FILTER_FILE=$4 # list of known functions to blacklist, e.g. libc
# outputs
OUTPUT_COVERAGE_FILE=$5 # output file with coverage info per function
OUTPUT_BLACKLIST_FILE=$6 # output file with list of functions to blacklist
OUTPUT_COVERAGE_FILE=$5 # output file with coverage info per function
OUTPUT_BLACKLIST_FILE=$6 # output file with list of functions to blacklist
# other
CANDIDATE_FNS_PRE_LIBC=`dirname $6`/p1.candidates.prelibc
#
......
#!/bin/sh
#!/bin/bash
#
# do_p1transform.sh <originalBinary> <MEDS annotationFile> <cloneId> <BED_script>
#
......@@ -10,8 +10,7 @@ CLONE_ID=$1
ORIGINAL_BINARY=$2
MEDS_ANNOTATION_FILE=$3
BED_SCRIPT=$4
echo "P1: transforming binary: cloneid=$CLONE_ID bed_script=$BED_SCRIPT"
TIMEOUT_VALUE=$5
# configuration variables
P1_DIR=p1.xform
......@@ -22,9 +21,21 @@ LIBC_FILTER=$PEASOUP_HOME/tools/libc_functions.txt
BLACK_LIST=$P1_DIR/p1.filtered_out # list of functions to blacklist
COVERAGE_FILE=$P1_DIR/p1.coverage
PN_BINARY=$SECURITY_TRANSFORMS_HOME/tools/transforms/p1transform.exe
echo "P1: transforming binary: cloneid=$CLONE_ID bed_script=$BED_SCRIPT timeout_value=$TIMEOUT_VALUE"
execute_pn()
{
echo "P1: issuing command: $SECURITY_TRANSFORMS_HOME/tools/transforms/p1transform.exe $1 $2 $3 with timeout value=$TIMEOUT_VALUE"
# On timeout send SIGUSR1
timeout -10 $TIMEOUT_VALUE $PN_BINARY $1 $2 $3
}
mkdir $P1_DIR
# generate coverage info for manually-specified tests
# generate coverage info for manually-specified tests (if any)
$PEASOUP_HOME/tools/do_manual_cover.sh
# merge all execution traces
......@@ -36,14 +47,13 @@ $PEASOUP_HOME/tools/cover.sh $ORIGINAL_BINARY $MEDS_ANNOTATION_FILE $EXECUTED_AD
if [ $? -eq 0 ]; then
if [ -f $COVERAGE_FILE ]; then
echo "P1: issuing command: $SECURITY_TRANSFORMS_HOME/tools/transforms/p1transform.exe $cloneid $BLACK_LIST"
$SECURITY_TRANSFORMS_HOME/tools/transforms/p1transform.exe $CLONE_ID $BED_SCRIPT $BLACK_LIST
execute_pn $CLONE_ID $BED_SCRIPT $BLACK_LIST $TIMEOUT_VALUE
else
echo "No coverage file -- do not attempt P1 transform" > p1transform.out
exit 1
fi
else
$SECURITY_TRANSFORMS_HOME/tools/transforms/p1transform.exe $CLONE_ID $BED_SCRIPT $LIBC_FILTER
execute_pn $CLONE_ID $BED_SCRIPT $LIBC_FILTER $TIMEOUT_VALUE
fi
exit 0
......@@ -5,7 +5,7 @@
# Run this script from top-level directory created by the peasoup script
#
CURRENT_DIR=`pwd`
TOP_LEVEL=`pwd`
variantid=$1
aspri=$2
......@@ -20,13 +20,13 @@ $SECURITY_TRANSFORMS_HOME/tools/spasm/spasm $aspri $bspri $P1_DIR/stratafier.o.e
# remove any candidate functions not covered
# this will go away once GrACE gives us the instruction coverage information
#
CONCOLIC=concolic.files_a.stratafied_0001
CONCOLIC=$TOP_LEVEL/concolic.files_a.stratafied_0001
echo "====================================================="
echo "P1: Validating transformed binary..."
echo "====================================================="
if [ -f $bspri ]; then
$PEASOUP_HOME/tools/ps_validate.sh ./a.stratafied $bspri $CONCOLIC > ps_validate.out 2> ps_validate.err
$PEASOUP_HOME/tools/ps_validate.sh ${TOP_LEVEL}/a.stratafied $bspri $CONCOLIC > ps_validate.out 2> ps_validate.err
if [ $? -eq 0 ]; then
echo "Successfully validated p1-transformed functions against inputs"
exit 0;
......
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