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
ccec0a10
Commit
ccec0a10
authored
13 years ago
by
jdh8d
Browse files
Options
Downloads
Patches
Plain Diff
First working version of IRDB code integrated.
parent
6262a1b9
Branches
Branches containing commit
Tags
cfar-phase3-final
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
examples/Makefile
+1
-1
1 addition, 1 deletion
examples/Makefile
tools/db/drop_my_tables.sh
+13
-16
13 additions, 16 deletions
tools/db/drop_my_tables.sh
tools/ps_analyze.sh
+15
-14
15 additions, 14 deletions
tools/ps_analyze.sh
tools/ps_run.sh
+9
-12
9 additions, 12 deletions
tools/ps_run.sh
with
38 additions
and
43 deletions
examples/Makefile
+
1
−
1
View file @
ccec0a10
...
@@ -63,7 +63,7 @@ clean:
...
@@ -63,7 +63,7 @@ clean:
rm
-Rf
peasoup_executable_directory.
*
rm
-Rf
peasoup_executable_directory.
*
rm
-f
strata.log.
*
rm
-f
strata.log.
*
rm
-f
*
.sym
rm
-f
*
.sym
#
if [ ! "X" = "X"
${
PGUSER
}
]
;
then
sh ../tools/db/drop_my_tables.sh
;
sh ../tools/db/pdb_setup.sh
;
fi
if
[
!
"X"
=
"X"
${
PGUSER
}
]
;
then
sh ../tools/db/drop_my_tables.sh
;
sh ../tools/db/pdb_setup.sh
;
fi
concclean
:
concclean
:
rm
-Rf
concolic.files_
*
rm
-Rf
concolic.files_
*
...
...
This diff is collapsed.
Click to expand it.
tools/db/drop_my_tables.sh
+
13
−
16
View file @
ccec0a10
#!/bin/bash
#!/bin/bash
psql
<<
'
EOF
'
CREATE LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION drop_tables(username IN VARCHAR) RETURNS void AS
$$
DECLARE
statements CURSOR FOR
SELECT tablename FROM pg_tables
WHERE tableowner = username;
BEGIN
FOR stmt IN statements LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(stmt.tablename) || ' CASCADE;';
END LOOP;
END;
$$
LANGUAGE plpgsql;
EOF
psql
-c
"SELECT drop_tables('
$PGUSER
');"
functables
=
`
psql
-t
-q
-c
"select function_table_name from variant_info"
`
insntables
=
`
psql
-t
-q
-c
"select instruction_table_name from variant_info"
`
addrtables
=
`
psql
-t
-q
-c
"select address_table_name from variant_info"
`
othertables
=
"variant_dependency variant_info file_info doip"
for
i
in
$insntables
$addrtables
$functables
$othertables
do
echo
--------------------------------------------------------------------------
echo
-n
Dropping table
$i
...
" "
psql
-t
-q
-c
"drop table
$i
cascade;"
echo
Done.
echo
--------------------------------------------------------------------------
done
This diff is collapsed.
Click to expand it.
tools/ps_analyze.sh
+
15
−
14
View file @
ccec0a10
...
@@ -71,6 +71,16 @@ echo Running IDA Pro static analysis phase ...
...
@@ -71,6 +71,16 @@ echo Running IDA Pro static analysis phase ...
$SMPSA_HOME
/SMP-analyze.sh a.ncexe
$SMPSA_HOME
/SMP-analyze.sh a.ncexe
echo
Done.
echo
Done.
#
# Run concolic engine
#
echo
Running concolic testing to generate inputs ...
#$PEASOUP_HOME/tools/do_concolic.sh a --iterations 25 --logging tracer,instance_times,trace
$PEASOUP_HOME
/tools/do_concolic.sh a
--iterations
25
--logging
tracer,trace,inputs
# 2>&1 |egrep -e "INPUT VECTOR:" -e "1: argc ="
# >/dev/null 2>&1
echo
Done.
#
#
# Populate IR Database
# Populate IR Database
...
@@ -99,7 +109,8 @@ if [ ! "X" = "X"$PGUSER ]; then
...
@@ -99,7 +109,8 @@ if [ ! "X" = "X"$PGUSER ]; then
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/fill_in_cfg.exe
$cloneid
# finish the initial IR
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/fill_in_cfg.exe
$cloneid
# finish the initial IR
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/fix_calls.exe
$cloneid
# fix call insns so they are OK for spri emitting
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/fix_calls.exe
$cloneid
# fix call insns so they are OK for spri emitting
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/ilr.exe
$cloneid
# perform ILR
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/ilr.exe
$cloneid
# perform ILR
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/generate_spri.exe
$cloneid
a.ncexe.aspri
# generate the spri code
$SECURITY_TRANSFORMS_HOME
/libIRDB/test/generate_spri.exe
$cloneid
a.irdb.aspri
# generate the aspri code
$SECURITY_TRANSFORMS_HOME
/tools/spasm/spasm a.irdb.aspri a.irdb.bspri
# generate the bspri code
fi
fi
fi
fi
echo
-------------------------------------------------------------------------------
echo
-------------------------------------------------------------------------------
...
@@ -111,16 +122,6 @@ if [ ! "X" = "X"$PGUSER ]; then
...
@@ -111,16 +122,6 @@ if [ ! "X" = "X"$PGUSER ]; then
fi
fi
#
# Run concolic engine
#
echo
Running concolic testing to generate inputs ...
#$PEASOUP_HOME/tools/do_concolic.sh a --iterations 25 --logging tracer,instance_times,trace
$PEASOUP_HOME
/tools/do_concolic.sh a
--iterations
25
--logging
tracer,trace,inputs
# 2>&1 |egrep -e "INPUT VECTOR:" -e "1: argc ="
# >/dev/null 2>&1
echo
Done.
#
#
# Uncomment this part to test the P1 xform
# Uncomment this part to test the P1 xform
...
@@ -132,16 +133,16 @@ echo Done.
...
@@ -132,16 +133,16 @@ echo Done.
#echo Starting the P1 transform
#echo Starting the P1 transform
#date
#date
#$PEASOUP_HOME/tools/p1xform.sh $newdir > p1xform.out 2> p1xform.err
#$PEASOUP_HOME/tools/p1xform.sh $newdir > p1xform.out 2> p1xform.err
#
#echo $current_dir/$newdir/p1.xform/p1.final
#echo $current_dir/$newdir/p1.xform/p1.final
#
#if [ -f $current_dir/p1.xform/p1.final ]; then
#if [ -f $current_dir/p1.xform/p1.final ]; then
# echo List of functions transformed:
# echo List of functions transformed:
# cat $current_dir/p1.xform/p1.final
# cat $current_dir/p1.xform/p1.final
#else
#else
# echo P1 was unable to transform the subject program
# echo P1 was unable to transform the subject program
#fi
#fi
#
#date
#date
#echo Done with the P1 transform
#echo Done with the P1 transform
...
...
This diff is collapsed.
Click to expand it.
tools/ps_run.sh
+
9
−
12
View file @
ccec0a10
...
@@ -10,21 +10,19 @@ datapath=$1
...
@@ -10,21 +10,19 @@ datapath=$1
#
#
shift
;
shift
;
#
# Determine which SPRI file to use; first priorty goes to one generated from the IRDB.
#
if
[
-f
$datapath
/a.irdb.bspri
]
;
then
export
STRATA_SPRI_FILE
=
$datapath
/a.irdb.bspri
elif
[
-f
$datapath
/p1.xform/p1.final.bspri
]
;
then
export
STRATA_SPRI_FILE
=
$datapath
/p1.xform/p1.final.bspri
fi
#
#
# Run the program with the proper env. vars set., and the arguments to the program specified
# Run the program with the proper env. vars set., and the arguments to the program specified
#
#
if
[
-f
$datapath
/p1.xform/p1.final.bspri
]
;
then
STRATA_DOUBLE_FREE
=
1
\
STRATA_HEAPRAND
=
1
\
STRATA_PC_CONFINE
=
1
\
STRATA_PC_CONFINE_XOR
=
1
\
STRATA_PC_CONFINE_XOR_KEY_LENGTH
=
1024
\
STRATA_ANNOT_FILE
=
$datapath
/a.ncexe.annot
\
STRATA_SPRI_FILE
=
$datapath
/p1.xform/p1.final.bspri
\
$datapath
/a.stratafied
"
$@
"
else
STRATA_DOUBLE_FREE
=
1
\
STRATA_DOUBLE_FREE
=
1
\
STRATA_HEAPRAND
=
1
\
STRATA_HEAPRAND
=
1
\
STRATA_PC_CONFINE
=
1
\
STRATA_PC_CONFINE
=
1
\
...
@@ -32,6 +30,5 @@ STRATA_DOUBLE_FREE=1 \
...
@@ -32,6 +30,5 @@ STRATA_DOUBLE_FREE=1 \
STRATA_PC_CONFINE_XOR_KEY_LENGTH
=
1024
\
STRATA_PC_CONFINE_XOR_KEY_LENGTH
=
1024
\
STRATA_ANNOT_FILE
=
$datapath
/a.ncexe.annot
\
STRATA_ANNOT_FILE
=
$datapath
/a.ncexe.annot
\
$datapath
/a.stratafied
"
$@
"
$datapath
/a.stratafied
"
$@
"
fi
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