Skip to content
Snippets Groups Projects
SMP-analyze.sh 1.05 KiB
Newer Older
jdh8d's avatar
jdh8d committed
#!/bin/sh
# Make terminal ansi so we don't get an extraneous error.
export TVOPT=ansi
# Fix screwed-up LD environment on power machines.
export LD_LIBRARY_PATH=/uf1/jdh8d/RA/NICECAP/idapro_lib/

# Set IDA path.
export IDADIR=$IDAROOT
# Make sure that the idal executable can be reached from PATH.
export PATH=$PATH:$IDAROOT
export IDALOG=$1.log
export IDALOG_SILENT=1

if [ "${IDAROOT}"X = "X"  ];  then echo Please set IDAROOT; exit 1; fi
if [ ! -f ${IDAROOT}/libida.so ]; then echo IDAROOT is set poorly, please fix.; exit 1; fi


# remove tmp files
rm -f $1.id? $1.{nam,til,log,syms} `basename $1 .ncexe`.id?

old_stty=`stty -g`

ls


# Run the linux IDA Pro with the SMPStaticAnalyzer plugin.
# jdh - added -B for batch mode, avoids any prompts.
# jdh - note:  can't use -B, as the plugin doesn't run!
#time ${IDAROOT}/idal  -A -Telf -OSMPStaticAnalyzer:run $1 2>&1 >/dev/null
time ${IDAROOT}/idal  -A -SSMP.idc $1 

# SMP seems to mess up the terminal, using this to fix it.
/usr/bin/reset 
stty $old_stty

# Get the output file SMP.syms into $1.syms.
mv SMP.annot $1.annot