Skip to content

Commit

Permalink
Initial Open-Sourcing
Browse files Browse the repository at this point in the history
Co-authored-by: Eva-Maria Behner <[email protected]>
Co-authored-by: Niklas Bergmann <[email protected]>
Co-authored-by: Steffen Enders <[email protected]>
Co-authored-by: Er Xue Hui <[email protected]>
Co-authored-by: Low Zheng Heng Henry <[email protected]>
Co-authored-by: Marvin Marks <[email protected]>
Co-authored-by: Felix Prahl-Kamps <[email protected]>
Co-authored-by: Mariia Rybalka <[email protected]>
Co-authored-by: Sim Wei Sheng Nicholas <[email protected]>
  • Loading branch information
10 people committed Dec 17, 2021
0 parents commit 426d1ad
Show file tree
Hide file tree
Showing 379 changed files with 74,666 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
!/tests/samples/
!/tests/samples/src
.vim/
.idea/
.vim/
.ropeproject/
.vscode/
*.c.orig
*.png
*.pyc
*.txt
/.venv/
/install_api.py
/tests/samples/*
BinaryNinja.zip
license.*
merge_mirror.sh
/.coverage*
/coverage.xml
/report.xml
tests/.pytest_cache/
tests/*.png
69 changes: 69 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
stages:
- build
- test
- coreutils

variables:
GIT_SUBMODULE_STRATEGY: recursive


image: docker:git

build-docker-container:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
stage: build
script:
- git submodule update --remote --recursive
- git checkout binja
- cp BinaryNinja.zip /tmp/BinaryNinja.zip
- git checkout $CI_COMMIT_REF_NAME
- cp /tmp/BinaryNinja.zip BinaryNinja.zip
- echo "$BINJA_LICENSE" > "$(pwd)/license.txt"
- docker build -t dream .

check-format:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
stage: test
script:
- git submodule update --remote --recursive
- docker run dream make check-format

run-tests:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
stage: test
script:
- git submodule update --remote --recursive
- docker run dream make

run-extended-tests:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
stage: test
script:
- git submodule update --remote --recursive
- docker run dream make extendedtests

coreutils:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
tags:
- coreutils
stage: coreutils
image: $COREUTILS_CONTAINER_REG/binja:stable
allow_failure: true
interruptible: true
script:
- apt update && apt install git astyle -y
- git submodule update --remote --recursive
- echo "$BINJA_LICENSE" > /root/.binaryninja/license.dat
- python3 -m pip install -r requirements.txt
- python3 -m pip install pytest-xdist
- pytest --coreutils -n $COREUTILS_TEST_THREADS tests/test_coreutils.py --junitxml=report.xml
artifacts:
when: always
reports:
junit: report.xml
21 changes: 21 additions & 0 deletions .gitlab/issue_templates/Bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Bug Summary:
---
(Shortly describe the bug)

How to Reproduce:
---
(Steps how to reproduce the bug)

Current Behaviour:
---
(What happens, what is the output of the program, which exceptions are raised etc.)

Expected Behaviour:
---
(Describe the behaviour you would typically expect)

How to Resolve:
---
(Describe how the bug should be solved, i.e. what steps are required)

/label ~Idea ~Bug
9 changes: 9 additions & 0 deletions .gitlab/issue_templates/Default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Problem Statement:
---
(Describe what currently goes wrong, what features should be added etc.)

Approach:
---
(Describe how the issue should be solved, i.e. what steps are required)

/label ~Idea
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "dewolf-compiler-idioms"]
path = dewolf-compiler-idioms
url = https://github.com/fkie-cad/dewolf-idioms.git
[submodule "dewolf-idioms"]
path = dewolf-idioms
url = https://github.com/fkie-cad/dewolf-idioms.git
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu:latest

ENV DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y upgrade && apt install -y --no-install-recommends \
build-essential \
gcc-multilib \
git \
# Binary Ninja deps https://docs.binary.ninja/guide/troubleshooting/index.html#headless-ubuntu
libgl1-mesa-glx \
libfontconfig1 \
libxrender1 \
libegl1-mesa \
libxi6 \
libnspr4 \
libsm6 \
libpython2.7 \
libdbus-1-3 \
libxkbcommon-x11-0 \
# others
virtualenv \
unzip \
astyle \
# plotting ascii graphs for debug purposes
libgraph-easy-perl \
z3

# set up binaryninja
COPY BinaryNinja.zip /tmp/BinaryNinja.zip
RUN unzip /tmp/BinaryNinja.zip -d /opt/ && rm /tmp/BinaryNinja.zip && mkdir -p /root/.binaryninja/
# set up binaryninja license
COPY license.txt /root/.binaryninja/license.dat

# set up pydec
RUN mkdir -p /opt/decompiler && test -f /opt/decompiler/install_api.py || ln -s /opt/binaryninja/scripts/install_api.py /opt/decompiler/install_api.py

# update binja and cache this docker image
COPY Makefile.venv requirements.txt update_binja.py /opt/decompiler/
COPY ./dewolf-idioms/requirements.txt /opt/decompiler/requirements-compiler-idioms.txt
RUN make -f /opt/decompiler/Makefile.venv venv VENV_PATH=/opt/decompiler/.venv PREFIX=/opt/decompiler

COPY . /opt/decompiler
RUN mkdir -p /root/.binaryninja/plugins/ && cp -r /opt/decompiler/dewolf-idioms/ /root/.binaryninja/plugins/
WORKDIR /opt/decompiler
Loading

0 comments on commit 426d1ad

Please sign in to comment.