2014-08-21 20:54:14 +04:00
|
|
|
#!/bin/bash -e
|
2014-06-26 21:16:45 +04:00
|
|
|
|
2016-01-30 13:48:44 +03:00
|
|
|
SDKROOT=$IDA_SDK
|
2014-07-05 10:29:22 +04:00
|
|
|
unamestr=$(uname)
|
|
|
|
if [[ "$unamestr" == 'Linux' ]]; then
|
2016-01-30 13:48:44 +03:00
|
|
|
IDAROOT=$IDA_DIR
|
2014-07-05 10:40:46 +04:00
|
|
|
OUTPUT="qira.plx"
|
2014-07-19 03:02:51 +04:00
|
|
|
OUTPUT64="qira.plx64"
|
2014-07-29 08:29:07 +04:00
|
|
|
ln -sf libs/linux_libwebsockets.a libwebsockets.a
|
2014-07-05 10:29:22 +04:00
|
|
|
elif [[ "$unamestr" == 'Darwin' ]]; then
|
2015-09-28 20:11:57 +03:00
|
|
|
IDAROOT="/Applications/IDA Pro 6.7/idaq.app/Contents/MacOS/"
|
2014-07-05 10:40:46 +04:00
|
|
|
OUTPUT="qira.pmc"
|
2014-07-20 13:41:18 +04:00
|
|
|
OUTPUT64="qira.pmc64"
|
2014-07-29 08:29:07 +04:00
|
|
|
ln -sf libs/mac_libwebsockets.a libwebsockets.a
|
2014-07-05 10:29:22 +04:00
|
|
|
fi
|
2014-06-26 21:16:45 +04:00
|
|
|
|
2014-07-19 03:02:51 +04:00
|
|
|
# build 32
|
2014-07-05 10:29:22 +04:00
|
|
|
g++ template.cpp -m32 -fPIC -D__IDP__ -D__PLUGIN__ -c -D__LINUX__ -I . -I$SDKROOT/include
|
2014-07-05 10:40:46 +04:00
|
|
|
g++ -m32 --shared template.o "-L$IDAROOT" -lida -o $OUTPUT libwebsockets.a -lcrypto -lz -lssl -lpthread
|
2014-07-20 13:41:18 +04:00
|
|
|
echo "built 32"
|
2014-07-05 10:40:46 +04:00
|
|
|
|
2014-07-19 03:02:51 +04:00
|
|
|
# build 64
|
|
|
|
g++ template.cpp -D__EA64__=1 -m32 -fPIC -D__IDP__ -D__PLUGIN__ -c -D__LINUX__ -I . -I$SDKROOT/include
|
|
|
|
g++ -m32 --shared template.o "-L$IDAROOT" -lida64 -o $OUTPUT64 libwebsockets.a -lcrypto -lz -lssl -lpthread
|
2014-07-20 13:41:18 +04:00
|
|
|
echo "built 64"
|
2014-07-19 03:02:51 +04:00
|
|
|
|
2014-07-20 13:41:18 +04:00
|
|
|
if [[ "$unamestr" == 'Linux' ]]; then
|
|
|
|
strip $OUTPUT
|
|
|
|
strip $OUTPUT64
|
|
|
|
fi
|
2014-07-19 03:02:51 +04:00
|
|
|
|
|
|
|
sha1sum $OUTPUT $OUTPUT64
|
|
|
|
echo "installing plugin"
|
|
|
|
cp $OUTPUT "$IDAROOT/plugins"
|
|
|
|
cp $OUTPUT64 "$IDAROOT/plugins"
|
2014-06-26 21:16:45 +04:00
|
|
|
|
2014-07-15 02:50:10 +04:00
|
|
|
if [[ "$unamestr" == 'Linux' ]]; then
|
2016-02-05 06:13:50 +03:00
|
|
|
cp $OUTPUT bin/qira_ida_linux.plx
|
|
|
|
cp $OUTPUT64 bin/qira_ida_linux.plx64
|
2014-07-15 02:50:10 +04:00
|
|
|
elif [[ "$unamestr" == 'Darwin' ]]; then
|
2016-02-05 06:13:50 +03:00
|
|
|
cp $OUTPUT bin/qira_ida_mac.pmc
|
|
|
|
cp $OUTPUT64 bin/qira_ida_mac.pmc64
|
2014-07-15 02:50:10 +04:00
|
|
|
fi
|
|
|
|
|