{"id":13419896,"url":"https://github.com/google/binexport","last_synced_at":"2025-05-14T17:03:51.515Z","repository":{"id":39627132,"uuid":"41831522","full_name":"google/binexport","owner":"google","description":"Export disassemblies into Protocol Buffers","archived":false,"fork":false,"pushed_at":"2025-04-08T15:47:32.000Z","size":290065,"stargazers_count":1093,"open_issues_count":37,"forks_count":213,"subscribers_count":54,"default_branch":"main","last_synced_at":"2025-04-13T01:58:46.093Z","etag":null,"topics":["binary-ninja","binary-ninja-plugin","bindiff","binexport","binnavi","c-plus-plus","database","ghidra","ghidra-extension","ghidra-plugin","ida-plugin","ida-pro","java","protobuf","reverse-engineering","vxsig"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-09-02T22:49:39.000Z","updated_at":"2025-04-08T15:47:36.000Z","dependencies_parsed_at":"2023-02-19T06:46:03.267Z","dependency_job_id":"faeec8ef-c668-4423-b911-35122dde06d6","html_url":"https://github.com/google/binexport","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fbinexport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fbinexport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fbinexport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fbinexport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/binexport/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190381,"owners_count":22029632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-ninja","binary-ninja-plugin","bindiff","binexport","binnavi","c-plus-plus","database","ghidra","ghidra-extension","ghidra-plugin","ida-plugin","ida-pro","java","protobuf","reverse-engineering","vxsig"],"created_at":"2024-07-30T22:01:22.473Z","updated_at":"2025-05-14T17:03:51.455Z","avatar_url":"https://github.com/google.png","language":"C++","readme":"# BinExport\n\nCopyright 2011-2024 Google LLC.\n\n[![Linux Build Status](https://github.com/google/binexport/workflows/linux-build/badge.svg)](https://github.com/google/binexport/actions?query=workflow%3Alinux-build)\n[![Coverity Scan Build Status](https://scan.coverity.com/projects/8977/badge.svg)](https://scan.coverity.com/projects/google-binexport)\n\nDisclaimer: This is not an official Google product (experimental or otherwise),\nit is just code that happens to be owned by Google.\n\n# Table of Contents\n\n*   [Introduction](#introduction)\n*   [Installation](#installation)\n    *   [IDA Pro](#ida-pro)\n    *   [Binary Ninja](#binary-ninja)\n    *   [Ghidra](#ghidra)\n*   [Usage](#usage)\n*   [How to build](#how-to-build)\n    *   [Preparing the build environment](#preparing-the-build-environment)\n    *   [Linux](#linux)\n    *   [macOS](#macos)\n    *   [Windows](#windows)\n\n## Introduction\n\nBinExport is the exporter component of\n[BinDiff](https://www.zynamics.com/software.html). It is a plugin/extension for\nthe the disassemblers IDA Pro, Binary Ninja and Ghidra that exports disassembly\ndata into the Protocol Buffer format that BinDiff requires.\n\nAn experimental version for the open source software reverse engineering suite\nGhidra is available in the `java/BinExport` directory.\n\nThis repository contains the complete source code necessary to build BinExport\nplugin binaries for Linux, macOS and Windows.\n\n## Installation\n\n### IDA Pro\n\nDownload the binaries from the [releases](https://github.com/google/binexport/releases) page and copy them into the IDA Pro\nplugins directory. These are the default paths:\n\n| OS      | Plugin path                                 |\n| ------- | ------------------------------------------- |\n| Linux   | `/opt/idapro-8.2/plugins`                   |\n| macOS   | `/Applications/IDA Pro 8.2/idabin/plugins`  |\n| Windows | `%ProgramFiles%\\IDA 8.2\\plugins`            |\n\nTo install just for the current user, copy the files into one of these\ndirectories instead:\n\n| OS          | Plugin                |\n| ----------- | ------------------------------------ |\n| Linux/macOS | `~/.idapro/plugins`                  |\n| Windows     | `%AppData%\\Hex-Rays\\IDA Pro\\plugins` |\n\n\n#### Verifying the installation version\n\n1.  In IDA, select `Help`|`About programm...`\n2.  Click `Addons...`\n3.  If installed correctly, the following dialog box appears:\n\n    ![IDA addons dialog](/doc/binexport10-ida-addons-dialog.png)\n\n\n### Binary Ninja\n\nDownload the binaries from the [releases](https://github.com/google/binexport/releases) page and copy them into the Binary Ninja\nplugins directory. These are the default paths for the current user:\n\n| OS      | Plugin path                                           |\n| ------- | ----------------------------------------------------- |\n| Linux   | `~/.binaryninja/plugins`                              |\n| macOS   | `~/Library/Application Support/Binary Ninja/plugins/` |\n| Windows | `%AppData%\\Binary Ninja\\plugins`                      |\n\n\n#### Verifying the installation version\n\n1.  Start Binary Ninja\n2.  Select the `Log` native dock. If this is not visible, enable it via\n    `View`|`Native Docks`|`Show Log`.\n3.  If installed correctly, the log window contains a line similar to this one:\n\n```\nBinExport 12 (@internal, Jan 3 2023), (c)2004-2011 zynamics GmbH, (c)2011-2024 Google LLC.\n```\n\n### Ghidra\n\n1.  Download the binaries from the [releases](https://github.com/google/binexport/releases) page.\n2.  Start Ghidra, select `File`|`Install Extensions...`\n3.  In the \"Install Extensions\" dialog, click the plus icon in the upper right to \"Add extension\".\n4.  In the \"Select extension\" dialog, enter the path to the `ghidra_BinExport.zip` you downloaded\n    in step 1 and click `OK`.\n5.  Click `OK` twice to close both the \"Install Extensions\" dialog and the notice to restart Ghidra.\n6.  Exit Ghidra.\n\n#### Verifying the installation version\n\n1.  Start Ghidra\n2.  Select `File`|`Install Extensions...`\n3.  If installed correctly, the \"Install Extensions\" dialog should list the \"BinExport\" extension\n    next to a selected checkbox.\n\n## Usage\n\nThe main use case is via [BinDiff](https://zynamics.com/bindiff.html). However,\nBinExport can also be used to export disassembly into different formats:\n\n*   Protocol Buffer based full export\n*   Statistics text file\n*   Text format for debugging\n\n### IDA Pro\n\n1.  Open an IDA Pro database\n2.  Select `Edit`|`Plugins`|`BinExport 12`\n3.  The following dialog box appears:\n\n    ![BinExport plugin dialog](/doc/binexport10-plugin-dialog.png)\n\n4.  Select the type of the file to be exported\n\n#### IDC Scripting\n\nThe BinExport plugin registers the IDC functions below.\n\n| IDC Function name   | Exports to           | Arguments  |\n| ------------------- | -------------------- | ---------- |\n| BinExportBinary     | Protocol Buffer      | filename   |\n| BinExportText       | Text file dump       | filename   |\n| BinExportStatistics | Statistics text file | filename   |\n\nAlternatively, the plugin can be invoked from IDC by calling its main function\ndirectly:\n\n```c\nstatic main() {\n  batch(0);\n  auto_wait();\n  load_and_run_plugin(\"binexport12_ida\", 2 /* kBinary */);\n  qexit(0);\n}\n```\n\nNote that this does provide any control over the output filename. BinExport\nwill always use the filename of the currently loaded database (without\nextension) and append \".BinExport\".\n\n#### IDAPython\n\nThe arguments are the same as for IDC (listed above).\n\nExample invocation of one of the registered IDC functions:\n\n```python\nimport idaapi\nidaapi.ida_expr.eval_idc_expr(None, ida_idaapi.BADADDR,\n  'BinExportBinary(\"exported.BinExport\");')\n```\n\n#### Plugin Options\n\nBinExport defines the following plugin options, that can be specified on IDA's\ncommand line:\n\n| Option                                 | Description                                                           |\n| -------------------------------------- | --------------------------------------------------------------------- |\n| `-OBinExportAutoAction:\u003cACTION\u003e`       | Invoke a BinExport IDC function and exit                              |\n| `-OBinExportModule:\u003cPARAM\u003e`            | Argument for `BinExportAutoAction`                                    |\n| `-OBinExportLogFile:\u003cFILE\u003e`            | Log messages to a file                                                |\n| `-OBinExportAlsoLogToStdErr:TRUE`      | If specified, also log to standard error                              |\n| `-OBinExportX86NoReturnHeuristic:TRUE` | Enable the X86-specific heuristic to identify non-returning functions |\n\nNote: These options must come before any files.\n\n### Binary Ninja\n\nThere is only minimal integration into the Binary Ninja UI at this time.\n\n1.  Open or create a new analysis database\n2.  Select `Tools`|`Plugins`|`BinExport`. This will start the export process.\n\nThe `.BinExport` file is placed next to the analysis database, in the same\ndirectory.\n\n### Ghidra\n\n1.  Open or create a project. For new projects, import a file first using `File`|`Import File...`\n2.  Right-click a file in the current project list and select `Export...` from the context menu.\n3.  In the \"Export\" dialog, under \"Format\", choose \"Binary Export (v2) for BinDiff\".\n4.  Under \"Output File\", enter the desired output file path. If the file extension is missing,\n    `.BinExport` will be appended automatically.\n5.  Optional: click \"Options...\" to set additional export options.\n6.  Click \"OK\", then click \"OK\" again to dismiss the \"Export Results Summary\" dialog.\n\n#### Scripting\n\nThe `BinExport.java` Ghidra script can be run in both headless and GUI mode. In GUI mode, it is available under the `BinExport` category in the Script Manager. For headless mode, a `BinExport.properties` file with the following content (or similar, depending on the options you want to use) can be used:\n\n```\nChoose export file Export = test.BinExport\nChoose options IDA Pro Compatibility = \"Subtract Imagebase;Remap mnemonics;Prepend Namespace to Function Names\"\n```\n\n##### Example usage in headless mode\n\nCreate a project, import and analyze a binary:\n\n```\n$ ./analyzeHeadless \u003cproject_location\u003e \u003cproject_name\u003e -import \u003cfile\u003e\n```\nRun `BinExport.java` which will generate the `.BinExport` file specified in `BinExport.properties`:\n\n```\n$ ./analyzeHeadless \u003cproject_location\u003e \u003cproject_name\u003e -process \u003cfile\u003e -propertiesPath \u003cpath\u003e -preScript BinExport.java -noanalysis\n```\n\nAlternatively, use command-line arguments instead of `BinExport.properties`:\n\n```\n$ ./analyzeHeadless \u003cproject_location\u003e \u003cproject_name\u003e -process \u003cfile\u003e -preScript BinExport.java test.BinExport \"Prepend Namespace to Function Names\" -noanalysis\n```\n\n## How to build\n\nBelow are build instructions for the native code plugins for IDA Pro and\nBinary Ninja. To build the Java-based extension for Ghidra, please refer\nto the [BinExport for Ghidra](/java) instructions.\n\n### Preparing the build environment\n\nThere are quite a few dependencies to satisfy:\n\n*   Boost 1.83.0 or higher (a partial copy of 1.83.0 ships in `boost_parts`)\n*   [CMake](https://cmake.org/download/) 3.14 or higher\n*   Suggested: [Ninja](https://ninja-build.org/) for speedy builds\n*   GCC 9 or a recent version of Clang on Linux/macOS. On Windows, use the\n    Visual Studio 2019 compiler and the Windows SDK for Windows 10.\n*   Git 1.8 or higher\n*   IDA Pro only: IDA SDK 8.2 or higher (unpack into `third_party/idasdk`)\n*   Dependencies that will be downloaded:\n    *   Abseil, GoogleTest and Protocol Buffers (25.2)\n    *   Binary Ninja SDK\n\n### Linux\n\n#### Prerequisites\n\nThe preferred build environment is Debian 11 (\"Bullseye\").\n\nThis should install all the necessary packages:\n\n```bash\nsudo apt update -qq\nsudo apt install -qq --no-install-recommends build-essential\n```\n\nInstall the latest stable version of CMake:\n\n```bash\nwget https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-linux-x86_64.sh\nmkdir ${HOME}/cmake\nsh cmake-3.25.1-linux-x86_64.sh --prefix=${HOME}/cmake --exclude-subdir\nexport PATH=${HOME}/cmake/bin:${PATH}\n```\n\nThe following sections assume that your current working directory is at the root\nof the cloned repository.\n\n#### IDA SDK\n\nUnzip the contents of the IDA SDK into `third_party/idasdk`. Shown commands are\nfor IDA Pro 8.2:\n\n```bash\nunzip PATH/TO/idasdk_pro82.zip -d third_party/idasdk\nmv third_party/idasdk/idasdk_pro82/* third_party/idasdk\nrmdir third_party/idasdk/idasdk_pro82\n```\n\n#### Build BinExport\n\nWith all prerequisites in place, configure and build BinExport and run\nits tests:\n\n```bash\nmkdir -p build_linux \u0026\u0026 cd build_linux\ncmake .. \\\n    -G Ninja \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    \"-DCMAKE_INSTALL_PREFIX=${PWD}\" \\\n    -DBINEXPORT_ENABLE_IDAPRO=ON \\\n    \"-DIdaSdk_ROOT_DIR=${PWD}/../third_party/idasdk\" \\\n    -DBINEXPORT_ENABLE_BINARYNINJA=ON \\\ncmake --build . --config Release\nctest --build-config Release --output-on-failure\ncmake --install . --config Release --strip\n```\n\nNote: If you don't want to use Ninja to perform the actual build, omit\nthe `-G Ninja` part.\n\nTo disable the IDA Pro build, set `-DBINEXPORT_ENABLE_IDAPRO=OFF`. Likewise, to\ndisable the Binary Ninja build, set `-DBINEXPORT_ENABLE_BINARYNINJA=OFF`.\n\nThis will download and build Abseil, GoogleTest, Protocol Buffers and the\nBinary Ninja API. If all went well, the `build_linux/binexport-prefix`\ndirectory should contain two the files `binexport12_ida.so` and\n`binexport12_ida64.so` (for use with `ida` and `ida64`, respectively) as well\nas `binexport12_binaryninja.so` (for Binary Ninja).\n\n\n### macOS\n\n#### Prerequisites\n\nThe preferred build environment is macOS 13 \"Ventura\" using Xcode\n15.1. Using macOS 12 \"Monterey\" should also work.\n\nAfter installing the Developer Tools, make sure to install the command-line\ntools as well:\n\n```bash\nsudo xcode-select --install\n```\n\nThe following sections assume that your current working directory is at the root\nof the cloned repository.\n\n#### CMake\n\nDownload the latest stable version of CMake from the official site and mount its\ndisk image:\n\n```bash\ncurl -fsSL https://github.com/Kitware/CMake/releases/download/v3.25.1/cmake-3.25.1-Darwin-x86_64.dmg \\\n    -o $HOME/Downloads/cmake-osx.dmg\nhdiutil attach $HOME/Downloads/cmake-osx.dmg\n```\n\nAt this point you will need to review and accept CMake's license agreement. Now\ninstall CMake:\n\n```bash\nsudo cp -Rf /Volumes/cmake-3.25.1-Darwin-x86_64/CMake.app /Applications/\nhdiutil detach /Volumes/cmake-3.25.1-Darwin-x86_64\nsudo /Applications/CMake.app/Contents/bin/cmake-gui --install\n```\n\nThe last command makes CMake available in the system path.\n\n#### IDA SDK\n\nUnzip the contents of the IDA SDK into `third_party/idasdk`. Shown commands are\nfor IDA Pro 8.2:\n\n```bash\nunzip PATH/TO/idasdk_pro82.zip -d third_party/idasdk\nmv third_party/idasdk/idasdk_pro82/* third_party/idasdk\nrmdir third_party/idasdk/idasdk_pro82\n```\n\n#### Build BinExport\n\nWith all prerequisites in place, configure and build BinExport and run\nits tests:\n\n```bash\nmkdir -p build_mac \u0026\u0026 cd build_mac\ncmake .. \\\n    -DCMAKE_BUILD_TYPE=Release \\\n    \"-DCMAKE_INSTALL_PREFIX=${PWD}\" \\\n    -DBINEXPORT_ENABLE_IDAPRO=ON \\\n    \"-DIdaSdk_ROOT_DIR=${PWD}/../third_party/idasdk\" \\\n    -DBINEXPORT_ENABLE_BINARYNINJA=ON \\\ncmake --build . --config Release -- \"-j$(sysctl -n hw.logicalcpu)\"\nctest --build-config Release --output-on-failure\ncmake --install . --config Release --strip\n```\n\nNote: This will use the standard CMake \"Makefile Generator\". You can use XCode\nor Ninja as generators as well.\n\nTo disable the IDA Pro build, set `-DBINEXPORT_ENABLE_IDAPRO=OFF`. Likewise, to\ndisable the Binary Ninja build, set `-DBINEXPORT_ENABLE_BINARYNINJA=OFF`.\n\nThis will download and build Abseil, GoogleTest, Protocol Buffers and the\nBinary Ninja API. If all went well, the `build_mac/binexport-prefix`\ndirectory should contain two the files `binexport12_ida.dylib` and\n`binexport12_ida64.dylib` (for use with `ida` and `ida64`, respectively) as well\nas `binexport12_binaryninja.dylib` (for Binary Ninja).\n\n\n### Windows\n\nThe preferred build environment is Windows 10 (64-bit Intel) using the Visual\nStudio 2022 compiler and the [Windows SDK for Windows\n10](https://dev.windows.com/en-us/downloads/windows-10-sdk).\n\n#### CMake\n\nDownload and install the latest stable CMake (3.25.1 at the time of writing)\nfrom its [download page](https://cmake.org/download/). Make sure to select\n\"Add CMake to the system PATH for all users\".\n\n#### Git\n\nDownload and install Git from its [download\npage](https://git-scm.com/download/win). Make sure to select the following\noptions: * The installation directory should be left at the default\n`%ProgramFiles%\\Git\\bin\\git.exe` * \"Use Git from the Windows Command Prompt\" -\nhave the setup utility add Git to your system path. * \"Use Windows' default\nconsole window\" - to be able to use Git from the regular command prompt.\n\n#### Prepare\n\nThe following sections assume an open command prompt with the current working\ndirectory located at the root of the cloned BinExport repository:\n\n```bat\ngit clone https://github.com/google/binexport.git\ncd binexport\n```\n\n#### IDA SDK\n\nUnzip the contents of the IDA SDK into `third_party/idasdk`. Shown commands are\nfor IDA Pro 8.2, assuming that Git was installed into the default directory\nfirst:\n\n```bat\n\"%ProgramFiles%\\Git\\usr\\bin\\unzip\" PATH\\TO\\idasdk_pro82.zip -d third_party\nrename third_party\\idasdk_pro82 idasdk\n```\n\n#### Build BinExport\n\nWith all prerequisites in place, configure and build BinExport:\n\n```bat\nif not exist build_msvc mkdir build_msvc\ncd build_msvc\ncmake .. ^\n    -G \"Visual Studio 17 2022\" ^\n    -DCMAKE_BUILD_TYPE=Release ^\n    \"-DCMAKE_INSTALL_PREFIX=%cd%\" ^\n    -DBINEXPORT_ENABLE_IDAPRO=ON ^\n    -DIdaSdk_ROOT_DIR=%cd%\\..\\third_party\\idasdk ^\n    -DBINEXPORT_ENABLE_BINARYNINJA=ON\ncmake --build . --config Release -- /m /clp:NoSummary;ForceNoAlign /v:minimal\nctest --build-config Release --output-on-failure\ncmake --install . --config Release --strip\n```\n\nNote: This will use the CMake \"Visual Studio\" generator. You can use the Ninja\ngenerator as well.\n\nTo disable the IDA Pro build, set `-DBINEXPORT_ENABLE_IDAPRO=OFF`. Likewise, to\ndisable the Binary Ninja build, set `-DBINEXPORT_ENABLE_BINARYNINJA=OFF`.\n\nThis will download and build Abseil, GoogleTest, Protocol Buffers and the\nBinary Ninja API. If all went well, the `build_msvc/binexport-prefix`\ndirectory should contain two the files `binexport12_ida.dll` and\n`binexport12_ida64.dll` (for use with `ida.exe` and `ida64.exe`, respectively) as well\nas `binexport12_binaryninja.dll` (for Binary Ninja).\n","funding_links":[],"categories":["TODO scan for Android support in followings","\u003ca id=\"6fb7e41786c49cc3811305c520dfe9a1\"\u003e\u003c/a\u003e导入导出\u0026与其他工具交互","使用"],"sub_categories":["\u003ca id=\"11139e7d6db4c1cef22718868f29fe12\"\u003e\u003c/a\u003eBinNavi","\u003ca id=\"6fb7e41786c49cc3811305c520dfe9a1\"\u003e\u003c/a\u003e导入导出\u0026与其他工具交互"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fbinexport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fbinexport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fbinexport/lists"}