Skip to content
Snippets Groups Projects
Commit 68ebbe7d authored by jdh8d's avatar jdh8d
Browse files

updated to use ida7 by default. includes build and script changes for ida and...

updated to use ida7 by default.  includes build and script changes for ida and externals changes for the umbrella

Former-commit-id: 5e62ffc91ddcb1561b005b6bd9bd877283366734
parent b928b27b
No related branches found
No related tags found
No related merge requests found
import os import os
import sys
argenv=Environment() argenv=Environment()
# command line options # command line options
...@@ -8,8 +9,8 @@ argenv.Replace(debugopt2=ARGUMENTS.get("debugopt2",0)) ...@@ -8,8 +9,8 @@ argenv.Replace(debugopt2=ARGUMENTS.get("debugopt2",0))
argenv.Replace(debugmem=ARGUMENTS.get("debugmem",0)) argenv.Replace(debugmem=ARGUMENTS.get("debugmem",0))
argenv.Replace(do_64bit_analysis=ARGUMENTS.get("do_64bit_analysis",1)) argenv.Replace(do_64bit_analysis=ARGUMENTS.get("do_64bit_analysis",1))
argenv.Replace(do_64bit_build=ARGUMENTS.get("do_64bit_build",2)) argenv.Replace(do_64bit_build=ARGUMENTS.get("do_64bit_build",2))
argenv.Replace(build_ida=ARGUMENTS.get("build_ida",1)) argenv.Replace(build_ida=ARGUMENTS.get("build_ida",-1))
argenv.Replace(build_ida7=ARGUMENTS.get("build_ida7",0)) argenv.Replace(build_ida7=ARGUMENTS.get("build_ida7",-1))
argenv.Replace(build_irdb=ARGUMENTS.get("build_irdb",1)) argenv.Replace(build_irdb=ARGUMENTS.get("build_irdb",1))
argenv.Replace(build_irdb_driver=ARGUMENTS.get("build_irdb_driver",0)) argenv.Replace(build_irdb_driver=ARGUMENTS.get("build_irdb_driver",0))
argenv.Replace(install=ARGUMENTS.get("install",1)) argenv.Replace(install=ARGUMENTS.get("install",1))
...@@ -55,6 +56,46 @@ else: ...@@ -55,6 +56,46 @@ else:
STARS_LDFLAGS="" STARS_LDFLAGS=""
STARS_LDPREFIX="" STARS_LDPREFIX=""
# sanity check default values for build_ida and build_ida7
# -1 means "default" 0 means off, 1 means on.
# defaults are build_ida7=1, build_ida=0.
# build_ida=1 causes default build_ida7=0
# cannot both be on.
# can both be off.
# check both on for error`
if int(argenv['build_ida7']) == 1 and int(argenv['build_ida']) == 1:
print "Cannot set both build_ida7 and build_ida at the same time."
sys.exit(0)
#check both default
elif int(argenv['build_ida7']) == -1 and int(argenv['build_ida']) == -1:
argenv.Replace(build_ida7=ARGUMENTS.get("build_ida",0))
argenv.Replace(build_ida7=ARGUMENTS.get("build_ida7",1))
#check one off, one default
elif int(argenv['build_ida7']) == -1 and int(argenv['build_ida']) == 0:
argenv.Replace(build_ida7=ARGUMENTS.get("build_ida7",1))
elif int(argenv['build_ida7']) == 0 and int(argenv['build_ida']) == -1:
argenv.Replace(build_ida7=ARGUMENTS.get("build_ida",0))
# check one on, one default
elif int(argenv['build_ida7']) == -1 and int(argenv['build_ida']) == 1:
argenv.Replace(build_ida7=ARGUMENTS.get("build_ida7",0))
elif int(argenv['build_ida7']) == 1 and int(argenv['build_ida']) == -1:
argenv.Replace(build_ida7=ARGUMENTS.get("build_ida",0))
# check one on, one explicitly off
elif int(argenv['build_ida7']) == 0 and int(argenv['build_ida']) == 1:
''' okay, nothing to do.'''
elif int(argenv['build_ida7']) == 1 and int(argenv['build_ida']) == 0:
''' okay, nothing to do.'''
# check both explicitly off
elif int(argenv['build_ida7']) == 0 and int(argenv['build_ida']) == 0:
''' okay, nothing to do.'''
# how can it be none of these?
else:
print "build_ida/build_ida7 set wildly. values are 0, 1 or left unset. (or, possibly internal error in build?)"
sys.exit(0)
# STARS_LDFLAGS=" -lasan LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/5/libasan.so" # STARS_LDFLAGS=" -lasan LD_PRELOAD=/usr/lib/gcc/x86_64-linux-gnu/5/libasan.so"
if int(argenv['do_64bit_analysis']) == 1: if int(argenv['do_64bit_analysis']) == 1:
...@@ -68,7 +109,7 @@ if int(argenv['numeric_error_annots']) == 1: ...@@ -68,7 +109,7 @@ if int(argenv['numeric_error_annots']) == 1:
Export('argenv', 'STARS_CCFLAGS', 'STARS_LDFLAGS', 'STARS_LDPREFIX') Export('argenv', 'STARS_CCFLAGS', 'STARS_LDFLAGS', 'STARS_LDPREFIX')
if int(argenv['build_ida']) == 1: if int(argenv['build_ida']) == 1 or int(argenv['build_ida7']) == 1:
if argenv['IDASDK'] is None: if argenv['IDASDK'] is None:
print 'Cannot proceed without IDASDK set.' print 'Cannot proceed without IDASDK set.'
exit(1) exit(1)
...@@ -77,16 +118,6 @@ if int(argenv['build_ida']) == 1: ...@@ -77,16 +118,6 @@ if int(argenv['build_ida']) == 1:
print 'Cannot proceed without IDAROOT set.' print 'Cannot proceed without IDAROOT set.'
exit(1) exit(1)
print "Build IDA Plugin"
lib=SConscript('SConscript.ida', variant_dir='build_ida')
print "Done build IDA Plugin"
test=argenv.Command(target="./test.log", source=lib, action="IDAROOT=$IDAROOT SMPSA_HOME=$SMPSA_HOME $SMPSA_HOME/tests/scripts/make_baseline.sh 2>&1 |tee ./test.log")
argenv.Depends(test,lib)
ab=argenv.AlwaysBuild(test)
argenv.Default(ab)
if int(argenv['build_ida7']) == 1:
if argenv['IDASDK'] is None: if argenv['IDASDK'] is None:
print 'Cannot proceed without IDASDK set.' print 'Cannot proceed without IDASDK set.'
exit(1) exit(1)
...@@ -95,8 +126,12 @@ if int(argenv['build_ida7']) == 1: ...@@ -95,8 +126,12 @@ if int(argenv['build_ida7']) == 1:
print 'Cannot proceed without IDAROOT set.' print 'Cannot proceed without IDAROOT set.'
exit(1) exit(1)
print "Build IDA 7.0+ Plugin" if int(argenv['build_ida']) == 1:
lib=SConscript('SConscript.ida7', variant_dir='build_ida') print "Build IDA Plugin"
lib=SConscript('SConscript.ida', variant_dir='build_ida')
elif int(argenv['build_ida7']) == 1:
print "Build IDA 7.0+ Plugin"
lib=SConscript('SConscript.ida7', variant_dir='build_ida')
print "Done build IDA Plugin" print "Done build IDA Plugin"
test=argenv.Command(target="./test.log", source=lib, action="IDAROOT=$IDAROOT SMPSA_HOME=$SMPSA_HOME $SMPSA_HOME/tests/scripts/make_baseline.sh 2>&1 |tee ./test.log") test=argenv.Command(target="./test.log", source=lib, action="IDAROOT=$IDAROOT SMPSA_HOME=$SMPSA_HOME $SMPSA_HOME/tests/scripts/make_baseline.sh 2>&1 |tee ./test.log")
argenv.Depends(test,lib) argenv.Depends(test,lib)
......
...@@ -40,7 +40,7 @@ export STARS_OPTIONS=$@ ...@@ -40,7 +40,7 @@ export STARS_OPTIONS=$@
# install plugin and IDC file in case the IDA distribitution isn't available # install plugin and IDC file in case the IDA distribitution isn't available
# at build time. # at build time.
for whole_file in $SMPSA_HOME/install/*plx* for whole_file in $(ls $SMPSA_HOME/install/*plx* $SMPSA_HOME/install/*so)
do do
file=$(basename $whole_file) file=$(basename $whole_file)
if [ ! -e $IDAROOT/plugins/$file -o $SMPSA_HOME/install/$file -nt $IDAROOT/plugins/$file ]; then if [ ! -e $IDAROOT/plugins/$file -o $SMPSA_HOME/install/$file -nt $IDAROOT/plugins/$file ]; then
...@@ -106,7 +106,7 @@ if [ $TVHEADLESS"X" != "X" ]; then ...@@ -106,7 +106,7 @@ if [ $TVHEADLESS"X" != "X" ]; then
$STRATA/tools/idaprod/idaprod_client $SMPSA_HOME $IDAROOT $PWD $STARS_ROOT_FILENAME `ulimit -t` $STRATA/tools/idaprod/idaprod_client $SMPSA_HOME $IDAROOT $PWD $STARS_ROOT_FILENAME `ulimit -t`
echo did server IDA echo did server IDA
;; ;;
*idapro6* | *idaproCur*) *idapro6*)
echo "Trying TVHEADLESS IDA" echo "Trying TVHEADLESS IDA"
TVHEADLESS=1 yes | LD_PRELOAD=$OVERRIDE_PLUGIN time ${IDAROOT}/$myidal -A -SSMP.idc -L${IDALOG} $STARS_OPTIONS $STARS_ROOT_FILENAME > $STARS_ROOT_FILENAME.idaoutput 2>&1 TVHEADLESS=1 yes | LD_PRELOAD=$OVERRIDE_PLUGIN time ${IDAROOT}/$myidal -A -SSMP.idc -L${IDALOG} $STARS_OPTIONS $STARS_ROOT_FILENAME > $STARS_ROOT_FILENAME.idaoutput 2>&1
echo "Finished TVHEADLESS IDA" echo "Finished TVHEADLESS IDA"
...@@ -120,6 +120,11 @@ if [ $TVHEADLESS"X" != "X" ]; then ...@@ -120,6 +120,11 @@ if [ $TVHEADLESS"X" != "X" ]; then
fi fi
;; ;;
*idapro7* | *idaproCur*)
myidal=idat64
echo "Trying TVHEADLESS IDA"
TVHEADLESS=1 LD_PRELOAD=$OVERRIDE_PLUGIN time ${IDAROOT}/$myidal -A -SSMP.idc -L${IDALOG} $STARS_OPTIONS -OSMPStaticAnalyzer:Reduced $STARS_ROOT_FILENAME > $STARS_ROOT_FILENAME.idaoutput 2>&1
;;
*) *)
echo Cannot determine idapro version: $IDAROOT echo Cannot determine idapro version: $IDAROOT
......
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