File tree Expand file tree Collapse file tree
plugins/cstyle_format_string Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919// IN THE SOFTWARE.
2020
2121#include " binaryninjaapi.h"
22- #include " cstyleformatstringresolutionprovider.h"
2322#include < numeric>
2423
2524using namespace BinaryNinja ;
2625using namespace std ;
2726
28- namespace
29- {
30- const bool g_cStyleFormatStringResolutionProviderRegistered = []() {
31- RegisterCStyleFormatStringResolutionProvider ();
32- return true ;
33- }();
34- }
35-
36-
3727struct WorkerThreadActionContext
3828{
3929 std::function<void ()> action;
Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.15 FATAL_ERROR )
2+
3+ project (cstyle_format_string)
4+
5+ file (GLOB SOURCES CONFIGURE_DEPENDS
6+ *.cpp
7+ *.c
8+ *.h )
9+
10+ if (DEMO)
11+ add_library (${PROJECT_NAME } STATIC ${SOURCES} )
12+ else ()
13+ add_library (${PROJECT_NAME } SHARED ${SOURCES} )
14+ endif ()
15+
16+ if (NOT BN_INTERNAL_BUILD)
17+ # Out-of-tree build
18+ find_path (
19+ BN_API_PATH
20+ NAMES binaryninjaapi.h
21+ HINTS ../../.. binaryninjaapi $ENV{BN_API_PATH}
22+ REQUIRED
23+ )
24+ add_subdirectory (${BN_API_PATH} api )
25+ endif ()
26+
27+ target_link_libraries (${PROJECT_NAME } binaryninjaapi )
28+
29+ set_target_properties (${PROJECT_NAME } PROPERTIES
30+ CXX_STANDARD 20
31+ CXX_VISIBILITY_PRESET hidden
32+ CXX_STANDARD_REQUIRED ON
33+ C_VISIBILITY_PRESET hidden
34+ VISIBILITY_INLINES_HIDDEN ON
35+ POSITION_INDEPENDENT_CODE ON )
36+
37+ if (BN_INTERNAL_BUILD)
38+ plugin_rpath (${PROJECT_NAME } )
39+ set_target_properties (${PROJECT_NAME } PROPERTIES
40+ LIBRARY_OUTPUT_DIRECTORY ${BN_CORE_PLUGIN_DIR}
41+ RUNTIME_OUTPUT_DIRECTORY ${BN_CORE_PLUGIN_DIR} )
42+ else ()
43+ bn_install_plugin (${PROJECT_NAME } )
44+ endif ()
Original file line number Diff line number Diff line change 1+ #include " cstyleformatstringresolutionprovider.h"
2+
3+ using namespace BinaryNinja ;
4+
5+ extern " C"
6+ {
7+ BN_DECLARE_CORE_ABI_VERSION
8+
9+ #ifdef DEMO_EDITION
10+ bool CStyleFormatStringPluginInit ()
11+ #else
12+ BINARYNINJAPLUGIN bool CorePluginInit ()
13+ #endif
14+ {
15+ RegisterCStyleFormatStringResolutionProvider ();
16+ return true ;
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments