2014-07-28 14:55:25 -07:00
|
|
|
#!/bin/bash -e
|
2014-07-02 18:19:26 -07:00
|
|
|
|
2019-03-24 14:25:23 -07:00
|
|
|
# install system deps
|
|
|
|
if [ $(which apt-get) ]; then
|
|
|
|
echo "installing deps for ubuntu"
|
|
|
|
sudo apt-get -y install git curl python python-virtualenv python-dev build-essential pkg-config zlib1g-dev libglib2.0-dev libpixman-1-dev
|
|
|
|
else
|
|
|
|
echo "*** You'll need to install Ubuntu or get a working build env for qemu and python yourself ***"
|
2014-07-31 11:47:11 -07:00
|
|
|
fi
|
2014-07-30 16:02:23 -07:00
|
|
|
|
2019-03-24 14:25:23 -07:00
|
|
|
# build qemu
|
2019-03-24 14:46:15 -07:00
|
|
|
if [[ "$(uname)" == 'Linux' ]]; then
|
|
|
|
if [ $(tracers/qemu/qira-i386 > /dev/null; echo $?) == 1 ]; then
|
|
|
|
echo "QIRA QEMU appears to run okay"
|
|
|
|
else
|
|
|
|
echo "building QEMU"
|
|
|
|
cd tracers
|
|
|
|
./qemu_build.sh
|
|
|
|
cd ../
|
|
|
|
fi
|
2019-03-24 14:09:51 -07:00
|
|
|
else
|
2019-03-24 14:46:15 -07:00
|
|
|
echo "QEMU user only works on Linux."
|
|
|
|
echo "While the rest of QIRA will run, you cannot run binaries."
|
|
|
|
echo "This is due to QEMU user forwarding the syscalls to the kernel."
|
|
|
|
echo "See other backends in qira/tracers, PIN may work on Windows and OS X"
|
2019-03-24 14:09:51 -07:00
|
|
|
fi
|
|
|
|
|
2019-03-24 14:25:23 -07:00
|
|
|
echo "building python venv"
|
2019-03-24 14:09:51 -07:00
|
|
|
virtualenv venv
|
2014-11-23 01:06:58 +00:00
|
|
|
source venv/bin/activate
|
2019-03-24 14:09:51 -07:00
|
|
|
pip install --upgrade pip
|
|
|
|
pip install --upgrade -r requirements.txt
|
2014-07-02 18:19:26 -07:00
|
|
|
|
2019-03-24 14:25:23 -07:00
|
|
|
echo "running tests"
|
|
|
|
./run_tests.sh
|
|
|
|
|
|
|
|
echo "making systemwide symlink"
|
2014-07-02 19:52:14 -07:00
|
|
|
sudo ln -sf $(pwd)/qira /usr/local/bin/qira
|
2014-08-18 11:26:33 -07:00
|
|
|
|
2014-08-21 11:01:50 -07:00
|
|
|
echo "***************************************"
|
|
|
|
echo " Thanks for installing QIRA"
|
|
|
|
echo " Check out README for more info"
|
|
|
|
echo " Or just dive in with 'qira /bin/ls'"
|
2014-11-23 01:43:08 +00:00
|
|
|
echo " And point Chrome to localhost:3002"
|
Add BAP as backend.
This PR introduces bap as a backend for QIRA.
The backend is made optional, but is enabled by default.
This backend allows one to disassemble instructions for all platforms,
supported by LLVM (at the time of writing it is about 25 targets).
Also, to some platforms BAP will provide BIL and/or target specific
instructions, lifted to first class python values, as opposed to
strings.
A new instruction class is introduces, that will use BIL if available to
infer destinations, as well as to infer registers touched or modified by
the instruction. Using, BIL allows us to determine instructions like
`pop {r0, pc}` as calls, that, as a consequence, allows us to build a
more correct CFG. As a drawback on ARM platform the built CFG is so big,
that it takes a considerable amount of time just to draw it.
Since BAP can provide a reasonable analysis for all platforms, including
those that at the time of writing still doesn't have a BIL support, the
static analysis in QIRA will be always turned on.
BAP is installed using opam, and BAP Python bindings a downloaded
directly from the git repository using pip.
As a free bonus, this PR will also fix Travis CI issue.
2015-01-13 14:00:40 -05:00
|
|
|
echo " ~geohot"
|
2019-03-24 14:25:23 -07:00
|
|
|
|