FROM ubuntu:22.04

RUN apt-get update --fix-missing
RUN apt-get install -y --no-install-recommends python3-minimal python3-pip build-essential
RUN pip install lief==0.14.1

COPY tridea flag.png.enc make_libtridea.py solution.cpp /opt/
WORKDIR /opt

RUN python3 make_libtridea.py tridea -o libtridea.so
RUN g++ -O3 -fopenmp -o tridea-attack solution.cpp -L. -ltridea
CMD  ["/bin/bash", "-c", "time LD_LIBRARY_PATH=. ./tridea-attack flag.png.enc /opt/result/flag.decrypted.png"]
