Git Product home page Git Product logo

safetorch's Introduction

SAFEtorch

Pytorch implemenation of the SAFE neural network.

SAFE can be used to produce dense representations (i.e., embeddings) for arbitrary binary functions. It works for both the X86 and ARM architectures.

See our paper on arXiv: https://arxiv.org/abs/1811.05296

If you use this code, please cite:

@inproceedings{massarelli2018safe,
  title={SAFE: Self-Attentive Function Embeddings for Binary Similarity},
  author={Massarelli, Luca and Di Luna, Giuseppe Antonio and Petroni, Fabio and Querzoni, Leonardo and Baldoni, Roberto},
  booktitle={Proceedings of 16th Conference on Detection of Intrusions and Malware & Vulnerability Assessment (DIMVA)},
  year={2019}
}

Quickstart

1. Create conda environment and install requirements

(optional) It might be a good idea to use a separate conda environment. It can be created by running:

conda create -n safe37 -y python=3.7 && conda activate safe37
pip install -r requirements.txt

2. Download the model

Download the model weights from http://dl.fbaipublicfiles.com/SAFEtorch/model.tar.gz

wget http://dl.fbaipublicfiles.com/SAFEtorch/model.tar.gz
tar -xzvf model.tar.gz
rm model.tar.gz

3. Use SAFE

Please refer to this notebook test.ipynb

Or try out this script test.py to get all the function embeddings of the input binary.

python test.py <binary_path>

Acknowledgements

Licence

SAFEtorch is licensed under the MIT license. The text of the license can be found here.

safetorch's People

Contributors

fabiopetroni avatar ss8651twtw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

safetorch's Issues

Only x86 64-bit vs 32-bit

Thanks for the code and release of the trained model.
Seems the current model only supports x86 64-bit and 32-bit, does it support ARM as described in the paper?

Also, does the generated embeddings from the trained model (in http://dl.fbaipublicfiles.com/SAFEtorch/model.tar.gz) support cross-32-64 search? For example, does the same source code compiled to 32-bit and 64-bit will have similar embeddings generated from your model?

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.