Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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!
11 changes: 11 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

if (( $# < 1 )); then
echo "Usage: $0 <file to decompile> [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)