2014-07-29 01:55:25 +04:00
|
|
|
#!/bin/bash -e
|
2014-07-03 05:19:26 +04:00
|
|
|
|
2014-07-29 01:48:14 +04:00
|
|
|
# default is just pip, but on things like arch where python 3 is default, it's pip2
|
|
|
|
PIP="pip"
|
2014-07-15 03:56:30 +04:00
|
|
|
|
2014-09-07 09:39:40 +04:00
|
|
|
unamestr=$(uname)
|
|
|
|
if [[ "$unamestr" == 'Linux' ]]; then
|
|
|
|
# we need pip to install python stuff
|
|
|
|
# build for building qiradb and stuff for flask like gevent
|
|
|
|
if [ $(which apt-get) ]; then
|
|
|
|
echo "installing apt packages"
|
2014-09-13 17:00:09 +04:00
|
|
|
sudo apt-get install build-essential python-dev python-pip debootstrap libjpeg-dev zlib1g-dev unzip wget
|
|
|
|
if [ ! -f /usr/lib/libcapstone.so ]; then
|
|
|
|
# now we need capstone so the user can see assembly
|
|
|
|
wget -O /tmp/cs.deb http://www.capstone-engine.org/download/2.1.2/capstone-2.1.2_amd64.deb
|
|
|
|
sudo dpkg -i /tmp/cs.deb
|
|
|
|
rm /tmp/cs.deb
|
|
|
|
fi
|
2014-09-07 09:39:40 +04:00
|
|
|
elif [ $(which pacman) ]; then
|
|
|
|
echo "installing pip"
|
|
|
|
sudo pacman -S base-devel python2-pip
|
|
|
|
PIP="pip2"
|
|
|
|
elif [ $(which yum) ]; then
|
|
|
|
sudo yum install python-pip python-devel gcc gcc-c++
|
|
|
|
fi
|
2014-07-03 05:19:26 +04:00
|
|
|
|
2014-09-07 09:39:40 +04:00
|
|
|
if [ $(qemu/qira-i386 > /dev/null; echo $?) == 1 ]; then
|
|
|
|
echo "QIRA QEMU appears to run okay"
|
|
|
|
else
|
|
|
|
echo "building QEMU"
|
|
|
|
./qemu_build.sh
|
|
|
|
fi
|
2014-07-31 22:47:11 +04:00
|
|
|
fi
|
2014-07-31 03:02:23 +04:00
|
|
|
|
2014-07-15 03:56:30 +04:00
|
|
|
echo "installing pip packages"
|
2014-08-03 07:30:55 +04:00
|
|
|
# we install more than we strictly need here, because pip is so easy
|
2014-09-10 11:04:19 +04:00
|
|
|
sudo $PIP install --upgrade six html flask-socketio pillow pyelftools socketIO-client pydot ipaddr capstone ./qiradb
|
2014-07-03 05:19:26 +04:00
|
|
|
|
2014-07-29 01:55:25 +04:00
|
|
|
echo "making symlink"
|
2014-07-03 06:52:14 +04:00
|
|
|
sudo ln -sf $(pwd)/qira /usr/local/bin/qira
|
2014-08-18 22:26:33 +04:00
|
|
|
|
2014-08-21 22:01:50 +04:00
|
|
|
echo "***************************************"
|
|
|
|
echo " Thanks for installing QIRA"
|
|
|
|
echo " Check out README for more info"
|
|
|
|
echo " Or just dive in with 'qira /bin/ls'"
|
|
|
|
echo " And point chrome to localhost:3002"
|
|
|
|
echo " ~geohot"
|
|
|
|
|