Skip to content

Commit

Permalink
Update Dockerfile and README.md. (KeenSecurityLab#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewShao authored and zyq8709 committed Apr 28, 2022
1 parent 76d6852 commit e46ced6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN echo 'debconf debconf/frontend select Noninteractive' > /debconf-seed.txt &&
RUN sed -i "s/archive.ubuntu.com/${UBUNTU_MIRROR}/g" /etc/apt/sources.list

RUN apt-get update -qq && apt-get install -y \
wget unzip make cmake build-essential python3-distutils
wget unzip make cmake build-essential

# Ghidra installation

Expand All @@ -34,7 +34,7 @@ RUN wget https://github.com/NationalSecurityAgency/ghidra/releases/download/${GH
ENV PATH="/opt/ghidra:/opt/ghidra/support:${PATH}"
ENV GHIDRA_INSTALL_DIR="/opt/ghidra"

ARG Z3_VERSION="4.8.14"
ARG Z3_VERSION="4.8.15"
RUN mkdir /opt/z3 && cd /opt/z3 \
&& wget -qO- https://github.com/Z3Prover/z3/archive/z3-${Z3_VERSION}.tar.gz | tar xz --strip-components=1 \
&& mkdir build && cd build && cmake \
Expand All @@ -44,20 +44,20 @@ RUN mkdir /opt/z3 && cd /opt/z3 \
&& make -j8 && make install \
&& cp /opt/z3/build/*.so /lib64

RUN mkdir -p /data/workspace
COPY BinAbsInspector /data/workspace/BinAbsInspector
COPY ghidra_scripts /data/workspace/BinAbsInspector/ghidra_scripts
COPY lib /data/workspace/BinAbsInspector/lib
COPY src /data/workspace/BinAbsInspector/src
COPY build.gradle extension.properties Module.manifest /data/workspace/BinAbsInspector/

WORKDIR /data/workspace
WORKDIR /data/workspace/BinAbsInspector

# Build extension
RUN cd BinAbsInspector \
&& gradle compileJava --warning-mode all \
RUN gradle compileJava --warning-mode all \
&& gradle buildExtension --warning-mode all

# Install extension
RUN mkdir -p "${HOME}/.ghidra/.${GHIDRA_VERSION}/Extensions" && \
cp BinAbsInspector/dist/*.zip "${HOME}/.ghidra/.${GHIDRA_VERSION}/Extensions" && \
cd "${HOME}/.ghidra/.${GHIDRA_VERSION}/Extensions" && unzip *.zip
RUN cp dist/*.zip "${GHIDRA_INSTALL_DIR}/Ghidra/Extensions" && \
cd "${GHIDRA_INSTALL_DIR}/Ghidra/Extensions" && unzip *.zip

# Provide an easy way to run the plugin
ENTRYPOINT ["analyzeHeadless", "~", "tmp", "-deleteProject", "-overwrite", "-postScript", "BinAbsInspector.java"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $GHIDRA_INSTALL_DIR/support/analyzeHeadless <projectPath> <projectName> -import

```shell
git clone [email protected]:KeenSecurityLab/BinAbsInspector.git
cp BinAbsInspector/Dockerfile ./
cd BinAbsInspector
docker build . -t bai
docker run -v $(pwd):/data/workspace bai "@@<script parameters>" -import <file>
```
Expand Down

0 comments on commit e46ced6

Please sign in to comment.