-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch default backend to Ghidra (#128)
- Loading branch information
Showing
13 changed files
with
145 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
0.5-dev | ||
==== | ||
|
||
- Switched default backend to Ghidra (PR #128) | ||
|
||
0.4 (2021-01) | ||
==== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,42 @@ | ||
FROM fkiecad/cwe_checker_travis_docker_image:bap | ||
FROM rust:1.49 AS builder | ||
|
||
COPY . /home/cwe/cwe_checker/ | ||
WORKDIR /cwe_checker | ||
|
||
RUN sudo chown -R cwe:cwe /home/cwe/cwe_checker \ | ||
&& cd /home/cwe/cwe_checker \ | ||
&& make all \ | ||
&& cargo clean \ | ||
&& dune clean | ||
COPY . . | ||
RUN cargo build --release | ||
|
||
WORKDIR /home/cwe/cwe_checker | ||
FROM phusion/baseimage:18.04-1.0.0 as runtime | ||
|
||
ENTRYPOINT ["opam", "config", "exec", "--"] | ||
CMD cwe_checker /tmp/input | ||
RUN apt-get -y update \ | ||
&& install_clean sudo \ | ||
&& useradd -m cwe \ | ||
&& echo "cwe:cwe" | chpasswd \ | ||
&& adduser cwe sudo \ | ||
&& sed -i.bkp -e 's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers | ||
USER cwe | ||
|
||
WORKDIR /home/cwe | ||
|
||
ENV PATH="/home/cwe/.cargo/bin/:${PATH}" | ||
ENV GHIDRA_VERSION="9.2.1_PUBLIC" | ||
|
||
# Install Ghidra | ||
RUN sudo apt-get -y update \ | ||
&& sudo install_clean \ | ||
curl \ | ||
unzip \ | ||
openjdk-11-jdk \ | ||
&& curl -fSL https://www.ghidra-sre.org/ghidra_9.2.1_PUBLIC_20201215.zip -o ghidra.zip \ | ||
&& unzip -q ghidra.zip \ | ||
&& sudo mv ghidra_${GHIDRA_VERSION} /opt/ghidra \ | ||
&& rm ghidra.zip | ||
|
||
# Install all necessary files from the builder stage | ||
COPY --from=builder /cwe_checker/target/release/cwe_checker /home/cwe/cwe_checker | ||
COPY --from=builder /cwe_checker/src/config.json /home/cwe/.config/cwe_checker/config.json | ||
COPY --from=builder /cwe_checker/ghidra/p_code_extractor /home/cwe/.local/share/cwe_checker/ghidra/p_code_extractor | ||
RUN echo "{ \"ghidra_path\": \"/opt/ghidra\" }" | sudo tee /home/cwe/.config/cwe_checker/ghidra.json | ||
|
||
WORKDIR / | ||
|
||
ENTRYPOINT ["/home/cwe/cwe_checker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
FROM fkiecad/cwe_checker_travis_docker_image:ghidra | ||
FROM fkiecad/cwe_checker_travis_docker_image:bap | ||
|
||
COPY . /home/cwe/cwe_checker/ | ||
|
||
RUN sudo chown -R cwe:cwe /home/cwe/cwe_checker \ | ||
&& cd /home/cwe/cwe_checker \ | ||
&& make all GHIDRA_PATH=/home/cwe/ghidra \ | ||
&& cargo clean | ||
&& make with_bap_backend \ | ||
&& cargo clean \ | ||
&& dune clean | ||
|
||
WORKDIR /home/cwe/cwe_checker | ||
|
||
# ENTRYPOINT ["/bin/sh", "-c"] | ||
ENTRYPOINT ["opam", "config", "exec", "--"] | ||
CMD cwe_checker /tmp/input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "cwe_checker" | ||
version = "0.4.0" | ||
version = "0.5.0-dev" | ||
authors = ["Enkelmann <[email protected]>"] | ||
edition = "2018" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "cwe_checker_rs" | ||
version = "0.4.0" | ||
version = "0.5.0-dev" | ||
authors = ["Nils-Edvin Enkelmann <[email protected]>"] | ||
edition = "2018" | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.