Skip to content

babyge/bento-autobentifier

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autobentifier Tool

This is the home of the bento-autobentifier, a tool for automatically partitioning existing binaries into bento-boxes while minimizing the overhead of box switching.

!! Note: This project is an expirement with no promise of support. Use at your own risk. !!

What are Bento-boxes?

Bento-boxes are independently-linked, memory-isolated pieces of code that are designed to work together. You can think of them as a light-weight alternative to processes for microcontrollers.

For more information on this idea, see the bento-linker.

This tool is an experiment in taking an existing binary, and generating those code boundaries automatically. Effectively allowing you to augment an existing program with Bento-box's memory isolation runtimes without additional programmer intervention.

Python Requirements

pip install -r requirements.txt

Separately install Networkx-METIS: https://github.com/networkx/networkx-metis/ If you are building on MacOS there is a workaround to install via conda. conda install -c conda-forge networkx-metis

Retdec Build and Installation

This section describes a local build and installation of RetDec. Instructions for Docker are given in the next section.

Requirements

Linux

On Debian-based distributions (e.g. Ubuntu), the required packages can be installed with apt-get:

sudo apt-get install build-essential cmake git perl python3 autoconf automake libtool pkg-config m4 zlib1g-dev upx doxygen graphviz

On RPM-based distributions (e.g. Fedora), the required packages can be installed with dnf:

sudo dnf install gcc gcc-c++ cmake make git perl python3 autoconf automake libtool pkg-config m4 zlib-devel upx doxygen graphviz

On Arch Linux, the required packages can be installed with pacman:

sudo pacman --needed -S base-devel cmake git perl python3 autoconf automake libtool pkg-config m4 zlib upx doxygen graphviz

Windows

  • Microsoft Visual C++ (version >= Visual Studio 2017 version 15.7)
  • CMake (version >= 3.6)
  • Git
  • Active Perl. It needs to be the first Perl in PATH, or it has to be provided to CMake using CMAKE_PROGRAM_PATH variable, e.g. -DCMAKE_PROGRAM_PATH=/c/perl/bin. Does NOT work with Strawberry Perl or MSYS2 Perl (you would have to install a pre-built version of OpenSSL, see below).
  • Python (version >= 3.4)
  • Optional: Doxygen and Graphviz for generating API documentation

macOS

Packages should be preferably installed via Homebrew.

Process

We opt to install retdec locally and pass this to PYTHONPATH later

  • Clone the repository as a submodule:
    • git submodule init
    • git submodule update
  • Linux:
    • mkdir build && cd build
    • cmake ../external/retdec -DCMAKE_INSTALL_PREFIX=../bin
    • make -jN (N is the number of processes to use for parallel build, typically number of cores + 1 gives fastest compilation time)
    • make install
  • Windows:
    • Open a command prompt (e.g. cmd.exe)
    • mkdir build && cd build
    • cmake ../external/retdec -DCMAKE_INSTALL_PREFIX=../bin -G<generator>
    • cmake --build . --config Release -- -m
    • cmake --build . --config Release --target install
    • Alternatively, you can open retdec.sln generated by cmake in Visual Studio IDE
  • macOS:
    • mkdir build && cd build
    • cmake ../external/retdec -DCMAKE_INSTALL_PREFIX=../bin
    • make -jN (N is the number of processes to use for parallel build, typically number of cores + 1 gives fastest compilation time)
    • make install

About

Automatic partitioning of memory spaces for microcontroller binaries

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%