Skip to content

Commit ff1ab1a

Browse files
update to use binaryninja-api generate stubs
1 parent bdb8c44 commit ff1ab1a

File tree

8 files changed

+56
-15965
lines changed

8 files changed

+56
-15965
lines changed

.github/workflows/cmake.yml

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,28 @@ jobs:
1212
matrix:
1313
include:
1414
- os: ubuntu-22.04
15-
- os: macos-12
15+
boost_platform_version: 22.04
16+
boost_toolset: gcc
17+
boost_arch: x86
18+
- os: macos-13
19+
boost_platform_version: 13
20+
boost_toolset: clang
21+
boost_arch: x86
22+
- os: macos-14
23+
boost_platform_version: 14
24+
boost_toolset: clang
25+
boost_arch: aarch64
1626
- os: windows-2022
27+
boost_platform_version: 2022
28+
boost_toolset: msvc
29+
boost_arch: x86
1730
runs-on: ${{ matrix.os }}
1831

1932
steps:
2033
- uses: actions/checkout@v4
2134

2235
- name: Install ninja-build tool
23-
uses: turtlesec-no/get-ninja@1.1.0
36+
uses: seanmiddleditch/gha-setup-ninja@v6
2437

2538
- name: Create Build Environment
2639
env:
@@ -37,6 +50,15 @@ jobs:
3750
if: matrix.os == 'windows-2022'
3851
uses: ilammy/[email protected]
3952

53+
- name: Install Boost
54+
uses: MarkusJx/install-boost@v2
55+
id: install-boost
56+
with:
57+
arch: ${{ matrix.boost_arch }}
58+
boost_version: 1.83.0
59+
platform_version: ${{ matrix.boost_platform_version }}
60+
toolset: ${{ matrix.boost_toolset }}
61+
4062
- name: Enable mold linker (Linux)
4163
if: matrix.os == 'ubuntu-22.04'
4264
uses: rui314/setup-mold@v1
@@ -47,7 +69,12 @@ jobs:
4769
run: |
4870
cmake "${{ github.workspace }}" -G Ninja \
4971
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
50-
"-DIdaSdk_ROOT_DIR=${{ runner.workspace }}/build/idasdk_teams82"
72+
"-DIdaSdk_ROOT_DIR=${{ runner.workspace }}/build/idasdk_teams82" \
73+
"-DBINEXPORT_ENABLE_BINARYNINJA=ON" \
74+
"-DBINEXPORT_BINARYNINJA_CHANNEL=stable" \
75+
"-DBoost_INCLUDE_DIR=${{steps.install-boost.outputs.BOOST_ROOT}}/include"
76+
env:
77+
BOOST_ROOT: ${{steps.install-boost.outputs.BOOST_ROOT}}
5178

5279
- name: Build
5380
working-directory: ${{ runner.workspace }}/build
@@ -60,9 +87,9 @@ jobs:
6087
run: ctest --build-config "${BUILD_TYPE}" --output-on-failure -R '^[A-Z]'
6188

6289
- name: Upload Build Artifacts
63-
uses: actions/upload-artifact@v3.1.2
90+
uses: actions/upload-artifact@v4
6491
with:
65-
name: BinExport-${{ runner.os }}
92+
name: BinExport-${{ runner.os }}-${{ runner.arch }}
6693
path: |
6794
${{ runner.workspace }}/build/binaryninja/binexport*
6895
${{ runner.workspace }}/build/ida/binexport*

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ mv third_party/idasdk/idasdk_pro82/* third_party/idasdk
283283
rmdir third_party/idasdk/idasdk_pro82
284284
```
285285

286+
#### Binary Ninja
287+
288+
If building the Binary Ninja plugin, set `-DBINEXPORT_BINARYNINJA_CHANNEL` to either `stable` or `dev` to build against pinned versions of those channels.
289+
290+
`-DBINEXPORT_BINARYNINJA_LATEST=ON` can be used to instead build against the latest commit from [GitHub](https://github.com/Vector35/binaryninja-api).
291+
286292
#### Build BinExport
287293

288294
With all prerequisites in place, configure and build BinExport and run

binaryninja/main_plugin.cc

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -567,18 +567,11 @@ bool Plugin::Init() {
567567

568568
} // namespace security::binexport
569569

570-
extern "C" BINARYNINJAPLUGIN uint32_t CorePluginABIVersion() {
571-
// Previously, BinExport worked around Binary Ninja's ABI version handling,
572-
// to make sure to have it try and load the plugin unconditionally. This
573-
// was done in order to be able to support both the fast moving "dev"
574-
// channel as well as the stable one. The intention was for BinExport to
575-
// use "mostly stable" API functions to work on both and have Binary Ninja
576-
// ignore the plugin if it used functionality that was not available.
577-
// However, this proved to be no longer feasible at some point with
578-
// BinExport leading to crashes.
579-
return BN_MINIMUM_CORE_ABI_VERSION;
580-
}
570+
extern "C"
571+
{
572+
BN_DECLARE_CORE_ABI_VERSION
581573

582-
extern "C" BINARYNINJAPLUGIN bool CorePluginInit() {
583-
return security::binexport::Plugin::instance()->Init();
574+
BINARYNINJAPLUGIN bool CorePluginInit() {
575+
return security::binexport::Plugin::instance()->Init();
576+
}
584577
}

0 commit comments

Comments
 (0)