os x support for ida_get_cfg....with a dirty hack :-x

This commit is contained in:
Ryan Stortz
2015-11-28 21:19:18 -05:00
committed by Peter Goodman
parent 621458ef10
commit c2f04b5329
2 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -16,6 +16,7 @@ GENERATED_DIR = os.path.join(MCSEMA_DIR, "generated")
CFG_DIR = os.path.join(GENERATED_DIR, "CFG")
sys.path.append('/usr/lib/python2.7/dist-packages')
sys.path.append('/usr/local/lib/python2.7/site-packages/protobuf-2.6.1-py2.7.egg')
sys.path.append(CFG_DIR)
import CFG_pb2
@@ -506,4 +507,4 @@ if "__main__" == __name__:
default=None,
help="The output control flow graph recovered from this file")
main(parser.parse_args(args=idc.ARGV[1:]))
main(parser.parse_args(args=idc.ARGV[1:]))
+10 -3
View File
@@ -2,8 +2,15 @@
# Directory in which this script resides (i.e. McSema scripts dir).
SCRIPTS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
IDA=`locate idal64`
BIN=`mktemp --tmpdir=/tmp mcsema2_XXXXXXXXXX`
if [[ "$OSTYPE" == "linux-gnu" ]]; then
IDA=`locate idal64`
BIN=`mktemp --tmpdir=/tmp mcsema2_XXXXXXXXXX`
elif [[ "$OSTYPE" == "darwin"* ]]; then
IDA="/Applications/IDA Pro 6.8/IDA binaries/idal64"
BIN=`mktemp -t mcsema2_XXXXXXXXXX`
fi
cp $1 $BIN
$IDA -B -S"${SCRIPTS_DIR}/ida_get_cfg.py --output=${BIN}.cfg" $BIN
"$IDA" -B -S"${SCRIPTS_DIR}/ida_get_cfg.py --output=${BIN}.cfg" $BIN
echo "Saved CFG to ${BIN}.cfg"