Giter VIP home page Giter VIP logo

dnd's Introduction

DnD: A Cross-Architecture Deep Neural Network Decompiler

DND is a deep neural network (DNN) decompiler capable of reverse engineering DNN models from compiled binaries.

Environment

  1. Create a Python virtual environment
  2. pip install -r ./angr_env/requirements.txt
  3. Move ./angr_env/base.py to overwrite the counterpart in the virtual environment claripy (usually in $USERNAME/.virtualenvs/$VIRTUALENVNAME/lib/python$VERSION/site-packages/claripy/ast/base.py)

Docker container

We provide a docker container. To use it, just run:

docker build . -t dnd
docker run -it dnd

Usage

  • Run python decompiler.py <model_binary> <model_onnx> to decompile a binary sample (<model_binary>) and export it into an ONNX file (<model_onnx>).For instance:
python ./decompiler.py binary_samples/evkbimxrt1050_glow_lenet_mnist_release.axf onnx_models/mnist.onnx
python ./decompiler.py binary_samples/evkbimxrt1050_glow_cifar10.axf onnx_models/resnet.onnx
  • Two samples are provided:
    ./binary_samples/evkbimxrt1050_glow_lenet_mnist_release.axf: a MNIST binary on NXP imrt1050-evk board
    ./binary_samples/evkbimxrt1050_glow_cifar10.axf: a Resnet binary on NXP imrt1050-evk board

  • The folder onnx_models containes ONNX models exported by DND for the binaries in binary_samples.

  • The folder patches showcases how to patch binaries implementing DNNs.

  • Please check decompiler.py for more details.

Citing this work

  title={$\{$DnD$\}$: A $\{$Cross-Architecture$\}$ deep neural network decompiler},
  author={Wu, Ruoyu and Kim, Taegyu and Tian, Dave Jing and Bianchi, Antonio and Xu, Dongyan},
  booktitle={31st USENIX Security Symposium (USENIX Security 22)},
  pages={2135--2152},
  year={2022}
}

dnd's People

Contributors

wuruoyu avatar antoniobianchi333 avatar dennydai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.