diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..4fb812f --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,13 @@ +FROM ubuntu:xenial + +RUN apt update +RUN apt install -y git clang-4.0 clang-4.0-dev cmake cmake-data libz-dev libcapstone3 libcapstone-dev libedit-dev libstdc++6-4.7-dev llvm-4.0 llvm-4.0-dev python-dev \ + && git clone https://github.com/zneak/fcd \ + && mkdir fcd/build && cd fcd/build \ + && CXX="clang++-4.0" CC="clang-4.0" cmake .. \ + && make -j4 + +# install it into PATH +RUN cp /fcd/build/fcd /usr/bin/ + +CMD fcd --help \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000..b78c500 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,17 @@ +# fcd-docker + +a dockerfile for the FCD decompiler (https://github.com/zneak/fcd) + +## Usage + +It takes a while to build! Took about 5 minutes on my laptop. + +```sh +# build the container +docker bulid -t fcd . + +# you can just use the start.sh wrapper script +./start.sh /path/to/binary +``` + +and it will spit out the decompiled code! diff --git a/docker/start.sh b/docker/start.sh new file mode 100755 index 0000000..82ad4ed --- /dev/null +++ b/docker/start.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +if (( $# < 1 )); then + echo "Usage: $0 [fcd options]" + exit 1 +fi + +BINARY=$1 +OPTS=${@:1:$#-1} +# do not change /workspace +docker run --rm -v $(dirname $(realpath $BINARY)):/workspace fcd fcd $OPTS /workspace/$(basename $BINARY) \ No newline at end of file