diff --git a/README.md b/README.md index fbd978891..998a06593 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ ___ Before we start, please make sure you have the following dependencies installed and available on your computer: - At least [Python 3.8](https://www.python.org/) -- Latest stable release of [Binary Ninja (>=2.4)](https://binary.ninja/) +- Latest stable release of [Binary Ninja (>=3.0)](https://binary.ninja/) - [astyle](https://code.tools/man/1/astyle/) for proper indentation of the decompiled code - [libgraph-easy-perl](https://packages.ubuntu.com/source/focal/libgraph-easy-perl) only required for printing ASCII graphs @@ -39,24 +39,24 @@ Under **Windows**, please make sure the **astyle**-binary has been added to the Follow the steps below to setup dewolf as a GUI plugin for Binary Ninja. Afterwards, you will be able to inspect decompiled code from a Binary Ninja dock. -#### Step 1: +#### Step 1: Clone the dewolf repository into the Binary Ninja plugin folder which is located in one of the following paths corresponding to your operating system: -**Linux:** `~/.binaryninja/plugins` -**MacOS:** `~/Library/Application Support/Binary Ninja` -**Windows:** `%APPDATA%\Binary Ninja` +**Linux:** `~/.binaryninja/plugins` +**MacOS:** `~/Library/Application Support/Binary Ninja` +**Windows:** `%APPDATA%\Binary Ninja` **Attention:** If you want to use a python virtual environment, make sure it is enabled for the next steps and also when starting Binary Ninja. -#### Step 2: +#### Step 2: Install dewolf's python dependencies with: ```bash pip install -r requirements.txt ``` -#### Step 3: +#### Step 3: Install Binary Ninja python API with: ```bash @@ -69,7 +69,7 @@ python /scripts/install_api.py [-v if using virtualenv] ___ ## Usage -The dewolf decompiler can be used from both the command line and within Binary Ninja. +The dewolf decompiler can be used from both the command line and within Binary Ninja. ### GUI After enabling the dewolf decompilation dock widget via **View > Other Docks > Show Dewolf**, the decompiled code for the currently active symbol will be displayed. @@ -102,7 +102,7 @@ Please use the `--help` flag for more information. ___ ## Configuration -dewolf has multiple configuration options of which some are configurable via the GUI. +dewolf has multiple configuration options of which some are configurable via the GUI. ### via GUI You can configure dewolf from the Binary Ninja GUI by navigating to **Edit > Preferences > Settings** or by pressing Ctrl + ,. diff --git a/plugin.json b/plugin.json new file mode 100644 index 000000000..ef2bc387f --- /dev/null +++ b/plugin.json @@ -0,0 +1,33 @@ +{ + "pluginmetadataversion": 1, + "name": "dewolf Decompiler", + "type": ["helper","ui"], + "api": ["python3"], + "description": "Research Decompiler to generate a C-like function representation", + "longdescription": "# dewolf\n\n\n\ndewolf is a research decompiler we developed during a research cooperation from 2019 to 2021 between Germany (Fraunhofer FKIE) and Singapore (DSO National Laboratories).\n\nThe restructuring of dewolf is based on the former DREAM/DREAM++ approach [Yakdan et al. NDSS 2015, IEEE (SP) 2016].\n\nThe decompiler dewolf is implemented as a plugin for Binary Ninja and uses their Medium-Level intermediate language as the starting point.\nAlthough we consider dewolf to be pretty stable, it is still a research prototype and not extensively optimized for production use.\nConsequently, you will likely observe a few bugs or even decompilation failures when applying dewolf on real-world binaries.\n\n**If you encounter any bugs, please report them to us so that we can further improve dewolf. :)**\n\n## Usage\n\nAfter enabling the dewolf decompilation dock widget via **View > Other Docks > Show Dewolf**, the decompiled code for the currently active symbol will be displayed.\nIn the dewolf dock, it is possible to navigate through functions by double-clicking them.\n\n![Widget Menu](https://user-images.githubusercontent.com/12004321/145460440-be4b7dfd-bf7e-497f-a7af-1911bf3efc50.png)\n\nThe automatic decompilation of selected functions can be toggled with the *follow* button.\nDecompiled code is cached and can be generated again with the *decompile* button, e.g. after patching instructions in the binary view.\n\n![Widget](https://user-images.githubusercontent.com/12004321/145460476-f869e5cc-d585-4f53-8920-6ecfa4b346d5.png)\n\n## Configuration\ndewolf has multiple configuration options of which some are configurable via the GUI.\n\nYou can configure dewolf from the Binary Ninja GUI by navigating to **Edit > Preferences > Settings** or by pressing Ctrl + ,.\nSearch for **dewolf** in the search bar and all dewolf related settings will be displayed.\n\n## Support\n\nIf you have any suggestions, or bug reports, please create an issue in the [Issue Tracker](https://github.com/fkie-cad/dewolf/issues).\n\nIn case you have any questions or other problems, feel free to send an email to:\n\n[dewolf@fkie.fraunhofer.de](mailto:dewolf@fkie.fraunhofer.de).", + "license": { + "name": "LGPL-2.1", + "text": "This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.\n\nThis library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" + }, + "platforms": ["Windows", "Linux", "Darwin"], + "installinstructions": { + "Windows": "## Install Dependencies\nPlease make sure you have the following dependencies installed and available on your computer:\n\n- At least [Python 3.8](https://www.python.org/)\n- Latest stable release of [Binary Ninja (>=3.0)](https://binary.ninja/)\n- [astyle](https://code.tools/man/1/astyle/) for proper indentation of the decompiled code\n\nUnder **Windows**, please make sure the **astyle**-binary has been added to the environment Path.", + "Linux": "## Install Dependencies\nPlease make sure you have the following dependencies installed and available on your computer:\n\n- At least [Python 3.8](https://www.python.org/)\n- Latest stable release of [Binary Ninja (>=3.0)](https://binary.ninja/)\n- [astyle](https://code.tools/man/1/astyle/) for proper indentation of the decompiled code\n\nUnder **Linux** (Ubuntu / Debian), you can use the following command to install **astyle**:\n\n```bash\nsudo apt install astyle\n```", + "Darwin": "## Install Dependencies\nPlease make sure you have the following dependencies installed and available on your computer:\n\n- At least [Python 3.8](https://www.python.org/)\n- Latest stable release of [Binary Ninja (>=3.0)](https://binary.ninja/)\n- [astyle](https://code.tools/man/1/astyle/) for proper indentation of the decompiled code\n\nUnder **Darwin** (macOS), you can use the following command to install **astyle**:\n\n```bash\nbrew install astyle\n```" + }, + "dependencies": { + "pip": [ + "-r requirements.txt" + ], + "apt": [ + "astyle" + ], + "installers": [ + "https://sourceforge.net/projects/astyle/files/latest/download" + ], + "other": [] + }, + "version": "0.1", + "author": "fkie-cad", + "minimumbinaryninjaversion": 3233 +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 3978a5bbc..411c03998 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,8 +4,5 @@ isort networkx pydot pygments -sympy == 1.4 -numpy -scipy pytest !=5.3.4 z3-solver == 4.8.10