forked from Vector35/binaryninja-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,529 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "binaryninjaapi.h" | ||
#include <string> | ||
|
||
using namespace BinaryNinja; | ||
using namespace std; | ||
|
||
|
||
Activity::Activity(const string& name, const std::function<void(Ref<AnalysisContext> analysisContext)>& action): m_action(action) | ||
{ | ||
//LogError("API-Side Activity Constructed!"); | ||
m_object = BNCreateActivity(name.c_str(), this, Run); | ||
} | ||
|
||
|
||
Activity::Activity(BNActivity* activity) | ||
{ | ||
m_object = BNNewActivityReference(activity); | ||
} | ||
|
||
|
||
Activity::~Activity() | ||
{ | ||
//LogError("API-Side Activity Destructed!"); | ||
} | ||
|
||
|
||
void Activity::Run(void* ctxt, BNAnalysisContext* analysisContext) | ||
{ | ||
Activity* activity = (Activity*)ctxt; | ||
Ref<AnalysisContext> ac = new AnalysisContext(BNNewAnalysisContextReference(analysisContext)); | ||
activity->m_action(ac); | ||
} | ||
|
||
|
||
string Activity::GetName() const | ||
{ | ||
char* name = BNActivityGetName(m_object); | ||
string result = name; | ||
BNFreeString(name); | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR) | ||
|
||
project(workflow_inliner) | ||
|
||
if((NOT BN_API_PATH) AND (NOT BN_INTERNAL_BUILD)) | ||
set(BN_API_PATH $ENV{BN_API_PATH}) | ||
if(NOT BN_API_PATH) | ||
message(FATAL_ERROR "Provide path to Binary Ninja API source in BN_API_PATH") | ||
endif() | ||
endif() | ||
if(NOT BN_INTERNAL_BUILD) | ||
add_subdirectory(${BN_API_PATH} ${PROJECT_BINARY_DIR}/api) | ||
endif() | ||
|
||
file(GLOB SOURCES | ||
*.cpp | ||
*.c | ||
*.h) | ||
|
||
add_library(workflow_inliner SHARED ${SOURCES}) | ||
|
||
target_link_libraries(workflow_inliner binaryninjaapi) | ||
|
||
set_target_properties(workflow_inliner PROPERTIES | ||
CXX_STANDARD 17 | ||
CXX_VISIBILITY_PRESET hidden | ||
CXX_STANDARD_REQUIRED ON | ||
C_STANDARD 99 | ||
C_STANDARD_REQUIRED ON | ||
C_VISIBILITY_PRESET hidden | ||
VISIBILITY_INLINES_HIDDEN ON | ||
POSITION_INDEPENDENT_CODE ON) | ||
|
||
if(BN_INTERNAL_BUILD) | ||
plugin_rpath(workflow_inliner) | ||
set_target_properties(workflow_inliner PROPERTIES | ||
LIBRARY_OUTPUT_DIRECTORY ${BN_CORE_PLUGIN_DIR} | ||
RUNTIME_OUTPUT_DIRECTORY ${BN_CORE_PLUGIN_DIR}) | ||
endif() |
Oops, something went wrong.