forked from googleprojectzero/functionsimsearch
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
64 lines (53 loc) · 3.83 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM bitnami/minideb:buster as builder
RUN chmod 777 /tmp
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y git wget cmake sudo gcc-7 g++-7 python3-pip zlib1g-dev googletest
RUN apt-get install -y libgtest-dev libgflags-dev libz-dev libelf-dev g++ python3-pip libboost-system-dev libboost-thread-dev libboost-date-time-dev
RUN mkdir /code
# build functionsimsearch
RUN cd /code && \
git clone https://github.com/thomasdullien/functionsimsearch.git && \
cd functionsimsearch && \
chmod +x ./build_dependencies.sh && \
./build_dependencies.sh && \
make -j 15
RUN mkdir -p /code/training-data
RUN cd /code/functionsimsearch/testdata/ && ./generate_training_data.py --work_directory=/code/training-data --unseen_training_samples=50000 --max_seen_training_samples=50000
# Do not strip the debug symbols.
#RUN strip /code/functionsimsearch/bin/*
#RUN cd /code && strip $(find -iname \*.so)
FROM bitnami/minideb:buster
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/stackwalk/libstackwalk.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/common/libcommon.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/parseAPI/libparseAPI.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/symlite/libsymLite.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/symtabAPI/libsymtabAPI.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/elf/libdynElf.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/dwarf/libdynDwarf.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/proccontrol/libpcontrol.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/instructionAPI/libinstructionAPI.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/dynC_API/libdynC_API.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/libdwarf/lib/libdwarf.so /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/patchAPI/libpatchAPI.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/dyninstAPI_RT/libdyninstAPI_RT.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/dyninstAPI/libdyninstAPI.so.9.3.2 /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/boost/src/boost/stage/lib/libboost_date_time-mt.so* /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/boost/src/boost/stage/lib/libboost_thread-mt.so* /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/dyninst-9.3.2/boost/src/boost/stage/lib/libboost_system-mt.so* /usr/local/lib/
COPY --from=builder /code/functionsimsearch/third_party/spii/lib/libspii.so* /usr/local/lib/
RUN mkdir -p /code/functionsimsearch
COPY --from=builder /code/functionsimsearch/bin /code/functionsimsearch/bin
COPY --from=builder /code/functionsimsearch/entrypoint.sh /code/functionsimsearch/
# Copy the training data
COPY --from=builder /code/training-data /code/training-data
RUN ldconfig
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y libelf-dev libgflags-dev libz-dev libboost-system1.67.0 libboost-thread1.67.0 libboost-date-time1.67.0 libboost-filesystem1.67.0 libgomp1
# dispatch via entrypoint script
# recommend mapping the /pwd volume, probably like (for ELF file):
#
# docker run -it --rm -v $(pwd):/pwd functionsimsearch disassemble ELF /pwd/someexe
VOLUME /pwd
WORKDIR /code/functionsimsearch
RUN chmod +x /code/functionsimsearch/entrypoint.sh
ENTRYPOINT ["/code/functionsimsearch/entrypoint.sh"]