Classes | |
class | BinaryNinja::AnalysisContext |
class | BinaryNinja::Activity |
class | BinaryNinja::Workflow |
A Binary Ninja Workflow is an abstraction of a computational binary analysis pipeline and it provides the extensibility mechanism needed for tailored binary analysis and decompilation. More... | |
class BinaryNinja::AnalysisContext |
Public Member Functions | |
AnalysisContext (BNAnalysisContext *analysisContext) | |
virtual | ~AnalysisContext () |
Ref< BinaryView > | GetBinaryView () |
Get the BinaryView for the current AnalysisContext. | |
Ref< Function > | GetFunction () |
Get the Function for the current AnalysisContext. | |
Ref< LowLevelILFunction > | GetLowLevelILFunction () |
Get the low level IL function for the current AnalysisContext. | |
Ref< MediumLevelILFunction > | GetMediumLevelILFunction () |
Get the medium level IL function for the current AnalysisContext. | |
Ref< HighLevelILFunction > | GetHighLevelILFunction () |
Get the high level IL function for the current AnalysisContext. | |
void | SetBasicBlockList (std::vector< Ref< BasicBlock > > basicBlocks) |
Set a new BasicBlock list for the current analysis context. | |
void | SetLiftedILFunction (Ref< LowLevelILFunction > liftedIL) |
Set new lifted IL for the current analysis context. | |
void | SetLowLevelILFunction (Ref< LowLevelILFunction > lowLevelIL) |
Set the new Low Level IL for the current analysis context. | |
void | SetMediumLevelILFunction (Ref< MediumLevelILFunction > mediumLevelIL) |
Set the new Medium Level IL for the current analysis context. | |
void | SetHighLevelILFunction (Ref< HighLevelILFunction > highLevelIL) |
Set the new High Level IL for the current analysis context. | |
bool | Inform (const std::string &request) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNAnalysisContext, BNNewAnalysisContextReference, BNFreeAnalysisContext > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNAnalysisContext * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNAnalysisContext, BNNewAnalysisContextReference, BNFreeAnalysisContext > | |
static BNAnalysisContext * | GetObject (CoreRefCountObject *obj) |
static BNAnalysisContext * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNAnalysisContext, BNNewAnalysisContextReference, BNFreeAnalysisContext > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNAnalysisContext * | m_object |
AnalysisContext::AnalysisContext | ( | BNAnalysisContext * | analysisContext | ) |
|
virtual |
Ref< BinaryView > AnalysisContext::GetBinaryView | ( | ) |
Get the BinaryView for the current AnalysisContext.
Get the Function for the current AnalysisContext.
Ref< LowLevelILFunction > AnalysisContext::GetLowLevelILFunction | ( | ) |
Get the low level IL function for the current AnalysisContext.
Ref< MediumLevelILFunction > AnalysisContext::GetMediumLevelILFunction | ( | ) |
Get the medium level IL function for the current AnalysisContext.
Ref< HighLevelILFunction > AnalysisContext::GetHighLevelILFunction | ( | ) |
Get the high level IL function for the current AnalysisContext.
void AnalysisContext::SetBasicBlockList | ( | std::vector< Ref< BasicBlock > > | basicBlocks | ) |
Set a new BasicBlock list for the current analysis context.
basicBlocks | The new list of BasicBlocks |
void AnalysisContext::SetLiftedILFunction | ( | Ref< LowLevelILFunction > | liftedIL | ) |
Set new lifted IL for the current analysis context.
liftedIL | The new lifted IL |
void AnalysisContext::SetLowLevelILFunction | ( | Ref< LowLevelILFunction > | lowLevelIL | ) |
Set the new Low Level IL for the current analysis context.
lowLevelIL | the new Low Level IL |
void AnalysisContext::SetMediumLevelILFunction | ( | Ref< MediumLevelILFunction > | mediumLevelIL | ) |
Set the new Medium Level IL for the current analysis context.
mediumLevelIL | the new Medium Level IL |
void AnalysisContext::SetHighLevelILFunction | ( | Ref< HighLevelILFunction > | highLevelIL | ) |
Set the new High Level IL for the current analysis context.
highLevelIL | the new High Level IL |
bool AnalysisContext::Inform | ( | const std::string & | request | ) |
class BinaryNinja::Activity |
Public Member Functions | |
Activity (const std::string &configuration, const std::function< void(Ref< AnalysisContext >)> &action) | |
Activity (BNActivity *activity) | |
virtual | ~Activity () |
std::string | GetName () const |
Get the Activity name. | |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNActivity, BNNewActivityReference, BNFreeActivity > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNActivity * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Static Protected Member Functions | |
static void | Run (void *ctxt, BNAnalysisContext *analysisContext) |
Protected Attributes | |
std::function< void(Ref< AnalysisContext > analysisContext)> | m_action |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNActivity, BNNewActivityReference, BNFreeActivity > | |
static BNActivity * | GetObject (CoreRefCountObject *obj) |
static BNActivity * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNActivity, BNNewActivityReference, BNFreeActivity > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNActivity * | m_object |
BinaryNinja::Activity::Activity | ( | const std::string & | configuration, |
const std::function< void(Ref< AnalysisContext >)> & | action ) |
configuration | a JSON representation of the activity configuration |
action | Workflow action, a function taking a Ref<AnalysisContext> as an argument. |
Activity::Activity | ( | BNActivity * | activity | ) |
|
virtual |
|
staticprotected |
|
protected |
class BinaryNinja::Workflow |
A Binary Ninja Workflow is an abstraction of a computational binary analysis pipeline and it provides the extensibility mechanism needed for tailored binary analysis and decompilation.
More specifically, a Workflow is a repository of activities along with a unique strategy to execute them. Binary Ninja provides two Workflows named ``core.module.defaultAnalysis`` and ``core.function.defaultAnalysis`` which expose the core analysis.
A Workflow starts in the unregistered state from either creating a new empty Workflow, or cloning an existing Workflow. While unregistered it's possible to add and remove activities, as well as change the execution strategy. In order to use the Workflow on a binary it must be registered. Once registered the Workflow is immutable and available for use.
Public Member Functions | |
Workflow (const std::string &name="") | |
Workflow (BNWorkflow *workflow) | |
Workflow (BNWorkflow *workflow, Ref< BinaryView > view) | |
Workflow (BNWorkflow *workflow, Ref< Function > function) | |
virtual | ~Workflow () |
Ref< Workflow > | Clone (const std::string &name, const std::string &activity="") |
Clone a workflow, copying all Activities and the execution strategy. | |
Ref< Activity > | RegisterActivity (const std::string &configuration, const std::function< void(Ref< AnalysisContext >)> &action, const std::vector< std::string > &subactivities={}) |
Register an Activity with this Workflow. | |
Ref< Activity > | RegisterActivity (Ref< Activity > activity, const std::vector< std::string > &subactivities={}) |
Register an Activity with this Workflow. | |
bool | Contains (const std::string &activity) |
Determine if an Activity exists in this Workflow. | |
std::string | GetConfiguration (const std::string &activity="") |
Retrieve the configuration as an adjacency list in JSON for the Workflow, or if specified just for the given ``activity``. | |
std::string | GetName () const |
Get the workflow name. | |
bool | IsRegistered () const |
Check whether the workflow is registered. | |
size_t | Size () const |
Get the amount of registered activities for this Workflow. | |
Ref< Activity > | GetActivity (const std::string &activity) |
Retrieve an activity by name. | |
std::vector< std::string > | GetActivityRoots (const std::string &activity="") |
Retrieve the list of activity roots for the Workflow, or if specified just for the given `activity`. | |
std::vector< std::string > | GetSubactivities (const std::string &activity="", bool immediate=true) |
Retrieve the list of all activities, or optionally a filtered list. | |
bool | AssignSubactivities (const std::string &activity, const std::vector< std::string > &subactivities={}) |
Assign the list of `activities` as the new set of children for the specified `activity`. | |
bool | Clear () |
Remove all activity nodes from this Workflow. | |
bool | Insert (const std::string &activity, const std::string &newActivity) |
Insert an activity before the specified activity and at the same level. | |
bool | Insert (const std::string &activity, const std::vector< std::string > &activities) |
Insert a list of activities before the specified activity and at the same level. | |
bool | Remove (const std::string &activity) |
Remove an activity by name. | |
bool | Replace (const std::string &activity, const std::string &newActivity) |
Replace the activity name. | |
Ref< FlowGraph > | GetGraph (const std::string &activity="", bool sequential=false) |
Generate a FlowGraph object for the current Workflow. | |
void | ShowReport (const std::string &name) |
std::vector< std::string > | GetEligibilitySettings () |
WorkflowMachine * | GetWorkflowMachine () const |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNWorkflow, BNNewWorkflowReference, BNFreeWorkflow > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNWorkflow * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Static Public Member Functions | |
static std::vector< Ref< Workflow > > | GetList () |
Get a list of all workflows. | |
static Ref< Workflow > | Instance (const std::string &name="") |
Get an instance of a workflow by name. | |
static bool | RegisterWorkflow (Ref< Workflow > workflow, const std::string &description="") |
Register a workflow, making it immutable and available for use. | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNWorkflow, BNNewWorkflowReference, BNFreeWorkflow > | |
static BNWorkflow * | GetObject (CoreRefCountObject *obj) |
static BNWorkflow * | GetObject (const CoreRefCountObject *obj) |
Additional Inherited Members | |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNWorkflow, BNNewWorkflowReference, BNFreeWorkflow > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNWorkflow * | m_object |
BinaryNinja::Workflow::Workflow | ( | const std::string & | name = "" | ) |
Workflow::Workflow | ( | BNWorkflow * | workflow | ) |
Workflow::Workflow | ( | BNWorkflow * | workflow, |
Ref< BinaryView > | view ) |
Workflow::Workflow | ( | BNWorkflow * | workflow, |
Ref< Function > | function ) |
|
inlinevirtual |
Get a list of all workflows.
|
static |
Register a workflow, making it immutable and available for use.
workflow | The workflow to register |
description | A JSON description of the Workflow |
Ref< Activity > BinaryNinja::Workflow::RegisterActivity | ( | const std::string & | configuration, |
const std::function< void(Ref< AnalysisContext >)> & | action, | ||
const std::vector< std::string > & | subactivities = {} ) |
bool Workflow::Contains | ( | const std::string & | activity | ) |
string Workflow::GetConfiguration | ( | const std::string & | activity = "" | ) |
Retrieve the configuration as an adjacency list in JSON for the Workflow, or if specified just for the given ``activity``.
activity | If specified, return the configuration for the ``activity`` |
string Workflow::GetName | ( | ) | const |
Get the workflow name.
bool Workflow::IsRegistered | ( | ) | const |
Check whether the workflow is registered.
size_t Workflow::Size | ( | ) | const |
Get the amount of registered activities for this Workflow.
vector< string > Workflow::GetActivityRoots | ( | const std::string & | activity = "" | ) |
Retrieve the list of activity roots for the Workflow, or if specified just for the given `activity`.
activity | If specified, return the roots for `activity` |
vector< string > Workflow::GetSubactivities | ( | const std::string & | activity = "", |
bool | immediate = true ) |
Retrieve the list of all activities, or optionally a filtered list.
activity | If specified, return the direct children and optionally the descendants of the `activity` (includes `activity`) |
immediate | whether to include only direct children of `activity` or all descendants |
bool Workflow::AssignSubactivities | ( | const std::string & | activity, |
const std::vector< std::string > & | subactivities = {} ) |
Assign the list of `activities` as the new set of children for the specified `activity`.
activity | The activity node to assign children |
subactivities | the list of Activities to assign |
bool Workflow::Clear | ( | ) |
Remove all activity nodes from this Workflow.
bool BinaryNinja::Workflow::Insert | ( | const std::string & | activity, |
const std::string & | newActivity ) |
Insert an activity before the specified activity and at the same level.
activity | Name of the activity to insert the new one before |
newActivity | Name of the new activity to be inserted |
bool BinaryNinja::Workflow::Insert | ( | const std::string & | activity, |
const std::vector< std::string > & | activities ) |
Insert a list of activities before the specified activity and at the same level.
activity | Name of the activity to insert the new one before |
newActivity | Name of the new activities to be inserted |
bool Workflow::Remove | ( | const std::string & | activity | ) |
Remove an activity by name.
activity | Name of the activity to remove |
bool Workflow::Replace | ( | const std::string & | activity, |
const std::string & | newActivity ) |
Replace the activity name.
activity | Name of the activity to replace |
newActivity | Name of the new activity |
void Workflow::ShowReport | ( | const std::string & | name | ) |
vector< string > Workflow::GetEligibilitySettings | ( | ) |
|
inline |