Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
Zipr Toolchain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
Zipr Toolchain
Commits
ffe19391
Commit
ffe19391
authored
13 years ago
by
an7s
Browse files
Options
Downloads
Patches
Plain Diff
New version
Former-commit-id: ff770d5e45a7b3f382dc89b57b11786776615c13
parent
a0bcdbcb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tools/cover.sh
+6
-7
6 additions, 7 deletions
tools/cover.sh
tools/do_p1transform.sh
+17
-7
17 additions, 7 deletions
tools/do_p1transform.sh
tools/p1xform_v2.sh
+3
-3
3 additions, 3 deletions
tools/p1xform_v2.sh
with
26 additions
and
17 deletions
tools/cover.sh
+
6
−
7
View file @
ffe19391
...
...
@@ -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
#
...
...
This diff is collapsed.
Click to expand it.
tools/do_p1transform.sh
+
17
−
7
View file @
ffe19391
#!/bin/sh
#!/bin/
ba
sh
#
# 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
This diff is collapsed.
Click to expand it.
tools/p1xform_v2.sh
+
3
−
3
View file @
ffe19391
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment