Skip to content

Commit bc3d3bc

Browse files
committed
Initial commit
0 parents  commit bc3d3bc

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "binaryninjaapi"]
2+
path = binaryninjaapi
3+
url = https://github.com/Vector35/binaryninja-api.git

CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
cmake_minimum_required(VERSION 3.24)
2+
project(TestPlugin CXX)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
6+
set(HEADLESS 1)
7+
find_path(
8+
BN_API_PATH
9+
NAMES binaryninjaapi.h
10+
# List of paths to search for the clone of the api
11+
HINTS ../.. binaryninjaapi $ENV{BN_API_PATH}
12+
REQUIRED
13+
)
14+
add_subdirectory(${BN_API_PATH} api)
15+
16+
add_library(TestPlugin SHARED library.cpp)
17+
18+
target_link_libraries(TestPlugin PUBLIC binaryninjaapi)
19+
20+
bn_install_plugin(TestPlugin)

library.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include "library.h"
2+
#include "binaryninjaapi.h"
3+
4+
using namespace BinaryNinja;
5+
6+
extern "C"
7+
{
8+
BN_DECLARE_CORE_ABI_VERSION
9+
10+
BINARYNINJAPLUGIN bool CorePluginInit()
11+
{
12+
return true;
13+
}
14+
15+
BINARYNINJAPLUGIN void CorePluginDependencies()
16+
{
17+
}
18+
}

library.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef TESTPLUGIN_LIBRARY_H
2+
#define TESTPLUGIN_LIBRARY_H
3+
4+
#include "binaryninjaapi.h"
5+
6+
#endif //TESTPLUGIN_LIBRARY_H

0 commit comments

Comments
 (0)