Skip to content

Commit

Permalink
Going to test with a Capstone Debian package on my fork, Capstone tea…
Browse files Browse the repository at this point in the history
…m should have their own release very soon
  • Loading branch information
AndrewQuijano committed Jan 3, 2025
1 parent 1e1dce8 commit 7824817
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
12 changes: 7 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG BASE_IMAGE="ubuntu:20.04"
ARG TARGET_LIST="x86_64-softmmu,i386-softmmu,arm-softmmu,aarch64-softmmu,ppc-softmmu,mips-softmmu,mipsel-softmmu,mips64-softmmu,mips64el-softmmu"
ARG LIBOSI_VERSION="v0.1.7"
ARG CAPSTONE_VERSION="6.0.0-Alpha5"

### BASE IMAGE
FROM $BASE_IMAGE as base
Expand All @@ -24,6 +25,7 @@ FROM base AS builder
ARG BASE_IMAGE
ARG TARGET_LIST
ARG LIBOSI_VERSION
ARG CAPSTONE_VERSION

RUN [ -e /tmp/build_dep.txt ] && \
apt-get -qq update && \
Expand All @@ -34,11 +36,11 @@ RUN [ -e /tmp/build_dep.txt ] && \
python3 -m pip install --upgrade --no-cache-dir "capstone" && \
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal

# Then install capstone from source
# Then install capstone debian package
RUN cd /tmp && \
git clone https://github.com/capstone-engine/capstone/ -b v5 && \
cd capstone/ && ./make.sh && make install && cd /tmp && \
rm -rf /tmp/capstone && ldconfig
curl -LJO https://github.com/AndrewQuijano/capstone/releases/download/${CAPSTONE_VERSION}/libcapstone-dev_${CAPSTONE_VERSION}_amd64.deb && \
apt-get install /tmp/libcapstone-dev_${CAPSTONE_VERSION}_amd64.deb && \
rm -rf /tmp/libcapstone-dev_${CAPSTONE_VERSION}_amd64.deb

ENV PATH="/root/.cargo/bin:${PATH}"

Expand Down Expand Up @@ -125,7 +127,7 @@ COPY --from=base /tmp/build_dep.txt /tmp

# Copy panda + libcapstone.so* + libosi libraries
COPY --from=cleanup /usr/local /usr/local
COPY --from=cleanup /usr/lib/libcapstone* /usr/lib/
COPY --from=cleanup /usr/lib/x86_64-linux-gnu/libcapstone.so* /usr/lib/
COPY --from=cleanup /lib/libosi.so /lib/libiohal.so /lib/liboffset.so /lib/

# Workaround issue #901 - ensure LD_LIBRARY_PATH contains the panda plugins directories
Expand Down
10 changes: 5 additions & 5 deletions panda/scripts/install_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ git --help &>/dev/null || $SUDO apt-get -qq update && $SUDO apt-get -qq install
# some globals
LIBOSI_VERSION="0.1.7"
UBUNTU_VERSION=$(lsb_release -r | awk '{print $2}')
CAPSTONE_VERSION="6.0.0-Alpha5"
PANDA_GIT="https://github.com/panda-re/panda.git"

# system information
Expand Down Expand Up @@ -109,11 +110,10 @@ fi
# Install libcapstone v5 release if it's not present
if [[ !$(ldconfig -p | grep -q libcapstone.so.5) ]]; then
echo "Installing libcapstone v5"
pushd /tmp && \
git clone https://github.com/capstone-engine/capstone/ -b v5 && \
cd capstone/ && MAKE_JOBS=$(nproc) ./make.sh && $SUDO make install && cd /tmp && \
rm -rf /tmp/capstone
$SUDO ldconfig
pushd /tmp
curl -LJO https://github.com/AndrewQuijano/capstone/releases/download/${CAPSTONE_VERSION}/libcapstone-dev_${CAPSTONE_VERSION}_amd64.deb
$SUDO apt-get install /tmp/libcapstone-dev_${CAPSTONE_VERSION}_amd64.deb
rm -rf /tmp/libcapstone-dev_${CAPSTONE_VERSION}_amd64.deb
popd
fi

Expand Down

0 comments on commit 7824817

Please sign in to comment.