diff --git a/SMP-analyze.sh b/SMP-analyze.sh index f829463a05b2b4eca39f14cba846d30c0b001f15..92c270674cae17339ba55c4852b241a3ef8f9663 100755 --- a/SMP-analyze.sh +++ b/SMP-analyze.sh @@ -46,6 +46,7 @@ if [ ! -f ${IDAROOT}/libida.so ]; then echo IDAROOT is set poorly, please fix.; # remove tmp files rm -f $1.id? $1.{nam,til,log,syms} `basename $1 .ncexe`.id? +rm -f ${IDALOG} old_stty=`stty -g` || true @@ -85,7 +86,7 @@ if [ $TVHEADLESS"X" != "X" ]; then ;; *idapro6* | *idaproCur*) echo "Trying TVHEADLESS IDA" - TVHEADLESS=1 yes | LD_PRELOAD=$OVERRIDE_PLUGIN time ${IDAROOT}/$myidal -A -SSMP.idc $1 > $1.idaoutput 2>&1 + TVHEADLESS=1 yes | LD_PRELOAD=$OVERRIDE_PLUGIN time ${IDAROOT}/$myidal -A -SSMP.idc -L${IDALOG} $1 > $1.idaoutput 2>&1 echo "Finished TVHEADLESS IDA" ;; diff --git a/scripts/SMP.idc b/scripts/SMP.idc index aa4d9f74ceed9557763856de0461ba21220baa9d..0f36cf54342d5707fae519d981f05c7af4fbc100 100644 --- a/scripts/SMP.idc +++ b/scripts/SMP.idc @@ -36,6 +36,12 @@ static main() Wait(); file = GetInputFile(); + Message("INFO: Input file name %s \n", file); + auto DebugFile = "stubtest.idaoutput"; + auto fd = fopen(DebugFile, "w"); + fprintf(fd, "Input file name: %s \n", file); + fclose(fd); + file = substr(file,0,strstr(file,".")) + ".asm"; WriteTxt(file, 0, BADADDR); // create the assembler file diff --git a/src/drivers/idapro/SMPStaticAnalyzer.cpp b/src/drivers/idapro/SMPStaticAnalyzer.cpp index 62e8b3df5c876c296010a45014ca028b8973f99e..1ae717184ca47bca7e09816820fb9bdf7f7c1708 100644 --- a/src/drivers/idapro/SMPStaticAnalyzer.cpp +++ b/src/drivers/idapro/SMPStaticAnalyzer.cpp @@ -41,6 +41,7 @@ #include <pro.h> #include <ida.hpp> +#include <idp.hpp> #include <ua.hpp> #include <bytes.hpp> #include <loader.hpp> diff --git a/src/interfaces/idapro/STARSIDAProgram.cpp b/src/interfaces/idapro/STARSIDAProgram.cpp index 7de5845fccb9d4ab61991ce3ce2d1b095bdf5ba7..19412aadae6e19810cc0e710a4059b4a6031a226 100644 --- a/src/interfaces/idapro/STARSIDAProgram.cpp +++ b/src/interfaces/idapro/STARSIDAProgram.cpp @@ -112,6 +112,13 @@ void STARS_IDA_Program_t::DetermineRootFileName(void) { #else TempRootName[STARS_MAXSTR - 1] = '\0'; STARS_ssize_t FileLen = ::get_root_filename(TempRootName, sizeof(TempRootName) - 1); + if (0 >= FileLen) { + SMP_msg("FATAL ERROR on get_root_filename\n"); + FileLen = ::get_input_file_path(TempRootName, sizeof(TempRootName) - 1); + if (0 < FileLen) { + SMP_msg("INFO: get_input_file_path returned %s\n", TempRootName); + } + } assert(0 < FileLen); #endif string TempRootString(TempRootName);