Skip to content

Commit

Permalink
add docker so you can start at home, and capstone isn't needed today
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Mar 23, 2019
1 parent 1dc5f51 commit 60e51a4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
15 changes: 15 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu:16.04

# prepare packages in env
RUN apt-get update && apt-get -y install build-essential debootstrap debian-archive-keyring libjpeg-dev zlib1g-dev unzip wget graphviz curl python-dev python-pip python-virtualenv git wget flex bison libtool automake autoconf autotools-dev pkg-config libglib2.0-dev
RUN pip install --upgrade pip

# fetch qira
RUN git clone https://github.com/geohot/qira.git
WORKDIR /qira

# install python, build qemu, and link qira
RUN pip install --upgrade -r requirements.txt
RUN cd tracers && ./qemu_build.sh
RUN ln -sf /qira/middleware/qira.py /usr/local/bin/qira

2 changes: 2 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker build -t qira -f Dockerfile .
5 changes: 5 additions & 0 deletions docker/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# simple loop test
docker run -p 3002:3002 --rm qira qira qira_tests/bin/loop

19 changes: 0 additions & 19 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ else
PIP="pip"
fi

LIBCAPSTONE64_SHA256="a7bf1cb814c6e712a314659b074bc4c00d2e0006cac67d055d3130d4ecdd525d"
LIBCAPSTONE32_SHA256="4ffb4630829b9b4e8c713ae8336a8259b180194233f248170bfe0d1577257fb2"

unamestr=$(uname)
arch=$(uname -p)

Expand All @@ -23,22 +20,6 @@ if [[ "$unamestr" == 'Linux' ]]; then
sudo apt-get -qq -y install build-essential debootstrap debian-archive-keyring libjpeg-dev zlib1g-dev unzip wget graphviz curl
echo "install python packages"
sudo apt-get -qq -y install python-dev python-pip python-virtualenv

# install capstone
if [ "$arch" == 'i686' ]; then
curl -o /tmp/libcapstone3.deb http://www.capstone-engine.org/download/3.0.4/ubuntu-14.04/libcapstone3_3.0.4-0.1ubuntu1_i386.deb
else
curl -o /tmp/libcapstone3.deb http://www.capstone-engine.org/download/3.0.4/ubuntu-14.04/libcapstone3_3.0.4-0.1ubuntu1_amd64.deb
fi

HASH=`sha256sum /tmp/libcapstone3.deb 2>/dev/null | cut -d' ' -f1`
if [ "$HASH" != "$LIBCAPSTONE64_SHA256" ] && [ "$HASH" != "$LIBCAPSTONE32_SHA256" ]; then
echo "Error: libcapstone3.deb has an invalid checksum."
exit 1
fi
sudo dpkg -i /tmp/libcapstone3.deb

echo "installing pip"
elif [ $(which pacman) ]; then
sudo pacman -S --needed --noconfirm base-devel python2-pip python2-virtualenv
PIP="pip2"
Expand Down

0 comments on commit 60e51a4

Please sign in to comment.