Classes | |
struct | BinaryNinja::PluginCommandContext |
class | BinaryNinja::PluginCommand |
The PluginCommand class is used for registering "commands" for Plugins, corresponding to code in those plugins to be executed. More... | |
class | BinaryNinja::MainThreadAction |
class | BinaryNinja::MainThreadActionHandler |
class | BinaryNinja::BackgroundTask |
struct BinaryNinja::PluginCommandContext |
Public Member Functions | |
PluginCommandContext () | |
Public Attributes | |
Ref< BinaryView > | binaryView |
uint64_t | address |
uint64_t | length |
size_t | instrIndex |
Ref< Function > | function |
Ref< LowLevelILFunction > | lowLevelILFunction |
Ref< MediumLevelILFunction > | mediumLevelILFunction |
Ref< HighLevelILFunction > | highLevelILFunction |
PluginCommandContext::PluginCommandContext | ( | ) |
Ref<BinaryView> BinaryNinja::PluginCommandContext::binaryView |
uint64_t BinaryNinja::PluginCommandContext::address |
uint64_t BinaryNinja::PluginCommandContext::length |
size_t BinaryNinja::PluginCommandContext::instrIndex |
Ref<LowLevelILFunction> BinaryNinja::PluginCommandContext::lowLevelILFunction |
Ref<MediumLevelILFunction> BinaryNinja::PluginCommandContext::mediumLevelILFunction |
Ref<HighLevelILFunction> BinaryNinja::PluginCommandContext::highLevelILFunction |
class BinaryNinja::PluginCommand |
The PluginCommand class is used for registering "commands" for Plugins, corresponding to code in those plugins to be executed.
The proper way to use this class is via one of the "Register*"
static methods.
Public Member Functions | |
PluginCommand (const BNPluginCommand &cmd) | |
PluginCommand (const PluginCommand &cmd) | |
~PluginCommand () | |
PluginCommand & | operator= (const PluginCommand &cmd) |
std::string | GetName () const |
Get the name for the registered PluginCommand. | |
std::string | GetDescription () const |
Get the description for the registered PluginCommand. | |
BNPluginCommandType | GetType () const |
Get the type of the registered PluginCommand. | |
const BNPluginCommand * | GetObject () const |
bool | IsValid (const PluginCommandContext &ctxt) const |
void | Execute (const PluginCommandContext &ctxt) const |
Static Public Member Functions | |
static void | Register (const std::string &name, const std::string &description, const std::function< void(BinaryView *view)> &action) |
Register a command for a given BinaryView. | |
static void | Register (const std::string &name, const std::string &description, const std::function< void(BinaryView *view)> &action, const std::function< bool(BinaryView *view)> &isValid) |
Register a command for a given BinaryView, with a validity check. | |
static void | RegisterForAddress (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, uint64_t addr)> &action) |
Register a command for a given BinaryView, when an address is selected. | |
static void | RegisterForAddress (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, uint64_t addr)> &action, const std::function< bool(BinaryView *view, uint64_t addr)> &isValid) |
Register a command for a given BinaryView and an address, with a validity check. | |
static void | RegisterForRange (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, uint64_t addr, uint64_t len)> &action) |
Register a command for a given BinaryView, when a range of address is selected. | |
static void | RegisterForRange (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, uint64_t addr, uint64_t len)> &action, const std::function< bool(BinaryView *view, uint64_t addr, uint64_t len)> &isValid) |
Register a command for a given BinaryView and a range, with a validity check. | |
static void | RegisterForFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, Function *func)> &action) |
Register a command for a given BinaryView within a function. | |
static void | RegisterForFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, Function *func)> &action, const std::function< bool(BinaryView *view, Function *func)> &isValid) |
Register a command for a given BinaryView and a function, with a validity check. | |
static void | RegisterForLowLevelILFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, LowLevelILFunction *func)> &action) |
Register a command for a given BinaryView within a LowLevelILFunction. | |
static void | RegisterForLowLevelILFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, LowLevelILFunction *func)> &action, const std::function< bool(BinaryView *view, LowLevelILFunction *func)> &isValid) |
Register a command for a given BinaryView and a Low Level IL function, with a validity check. | |
static void | RegisterForLowLevelILInstruction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, const LowLevelILInstruction &instr)> &action) |
Register a command for a given BinaryView with a given LowLevelILInstruction. | |
static void | RegisterForLowLevelILInstruction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, const LowLevelILInstruction &instr)> &action, const std::function< bool(BinaryView *view, const LowLevelILInstruction &instr)> &isValid) |
Register a command for a given BinaryView and a LowLevelILInstruction, with a validity check. | |
static void | RegisterForMediumLevelILFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, MediumLevelILFunction *func)> &action) |
Register a command for a given BinaryView within a MediumLevelILFunction. | |
static void | RegisterForMediumLevelILFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, MediumLevelILFunction *func)> &action, const std::function< bool(BinaryView *view, MediumLevelILFunction *func)> &isValid) |
Register a command for a given BinaryView and a Medium Level IL function, with a validity check. | |
static void | RegisterForMediumLevelILInstruction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, const MediumLevelILInstruction &instr)> &action) |
Register a command for a given BinaryView with a given MediumLevelILInstruction. | |
static void | RegisterForMediumLevelILInstruction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, const MediumLevelILInstruction &instr)> &action, const std::function< bool(BinaryView *view, const MediumLevelILInstruction &instr)> &isValid) |
Register a command for a given BinaryView and a MediumLevelILInstruction, with a validity check. | |
static void | RegisterForHighLevelILFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, HighLevelILFunction *func)> &action) |
Register a command for a given BinaryView within a HighLevelILFunction. | |
static void | RegisterForHighLevelILFunction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, HighLevelILFunction *func)> &action, const std::function< bool(BinaryView *view, HighLevelILFunction *func)> &isValid) |
Register a command for a given BinaryView and a High Level IL function, with a validity check. | |
static void | RegisterForHighLevelILInstruction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, const HighLevelILInstruction &instr)> &action) |
Register a command for a given BinaryView with a given HighLevelILInstruction. | |
static void | RegisterForHighLevelILInstruction (const std::string &name, const std::string &description, const std::function< void(BinaryView *view, const HighLevelILInstruction &instr)> &action, const std::function< bool(BinaryView *view, const HighLevelILInstruction &instr)> &isValid) |
Register a command for a given BinaryView and a HighLevelILInstruction, with a validity check. | |
static std::vector< PluginCommand > | GetList () |
Get the list of registered PluginCommands. | |
static std::vector< PluginCommand > | GetValidList (const PluginCommandContext &ctxt) |
Get the list of valid PluginCommands for a given context. | |
PluginCommand::PluginCommand | ( | const BNPluginCommand & | cmd | ) |
PluginCommand::PluginCommand | ( | const PluginCommand & | cmd | ) |
PluginCommand::~PluginCommand | ( | ) |
PluginCommand & PluginCommand::operator= | ( | const PluginCommand & | cmd | ) |
|
static |
Register a command for a given BinaryView.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Function that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView, when an address is selected.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and an address, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView, when a range of address is selected.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a range, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView within a function.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a function, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView within a LowLevelILFunction.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a Low Level IL function, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView with a given LowLevelILInstruction.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a LowLevelILInstruction, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView within a MediumLevelILFunction.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a Medium Level IL function, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView with a given MediumLevelILInstruction.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a MediumLevelILInstruction, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView within a HighLevelILFunction.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a High Level IL function, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Register a command for a given BinaryView with a given HighLevelILInstruction.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
|
static |
Register a command for a given BinaryView and a HighLevelILInstruction, with a validity check.
This will appear in the top menu and the right-click context menu.
name | Name of the command to register. This will appear in the top menu and the context menu. You can register submenus to an item by separating names with a |
description | Description of the command |
action | Action to perform |
isValid | Expression that returns whether the command is allowed to be performed. |
|
static |
Get the list of registered PluginCommands.
|
static |
Get the list of valid PluginCommands for a given context.
ctxt | The context to be used for the checks |
|
inline |
Get the name for the registered PluginCommand.
|
inline |
Get the description for the registered PluginCommand.
|
inline |
Get the type of the registered PluginCommand.
|
inline |
bool PluginCommand::IsValid | ( | const PluginCommandContext & | ctxt | ) | const |
void PluginCommand::Execute | ( | const PluginCommandContext & | ctxt | ) | const |
class BinaryNinja::MainThreadAction |
Public Member Functions | |
MainThreadAction (BNMainThreadAction *action) | |
void | Execute () |
bool | IsDone () const |
void | Wait () |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNMainThreadAction, BNNewMainThreadActionReference, BNFreeMainThreadAction > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNMainThreadAction * | 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< BNMainThreadAction, BNNewMainThreadActionReference, BNFreeMainThreadAction > | |
static BNMainThreadAction * | GetObject (CoreRefCountObject *obj) |
static BNMainThreadAction * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNMainThreadAction, BNNewMainThreadActionReference, BNFreeMainThreadAction > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNMainThreadAction * | m_object |
MainThreadAction::MainThreadAction | ( | BNMainThreadAction * | action | ) |
void MainThreadAction::Execute | ( | ) |
bool MainThreadAction::IsDone | ( | ) | const |
void MainThreadAction::Wait | ( | ) |
class BinaryNinja::MainThreadActionHandler |
Public Member Functions | |
virtual void | AddMainThreadAction (MainThreadAction *action)=0 |
|
pure virtual |
class BinaryNinja::BackgroundTask |
Public Member Functions | |
BackgroundTask (BNBackgroundTask *task) | |
BackgroundTask (const std::string &initialText, bool canCancel) | |
Provides a mechanism for reporting progress of an optionally cancelable task to the user via the status bar in the UI. | |
bool | CanCancel () const |
bool | IsCancelled () const |
bool | IsFinished () const |
std::string | GetProgressText () const |
uint64_t | GetRuntimeSeconds () const |
void | Cancel () |
void | Finish () |
void | SetProgressText (const std::string &text) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNBackgroundTask, BNNewBackgroundTaskReference, BNFreeBackgroundTask > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNBackgroundTask * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Static Public Member Functions | |
static std::vector< Ref< BackgroundTask > > | GetRunningTasks () |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNBackgroundTask, BNNewBackgroundTaskReference, BNFreeBackgroundTask > | |
static BNBackgroundTask * | GetObject (CoreRefCountObject *obj) |
static BNBackgroundTask * | GetObject (const CoreRefCountObject *obj) |
Additional Inherited Members | |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNBackgroundTask, BNNewBackgroundTaskReference, BNFreeBackgroundTask > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNBackgroundTask * | m_object |
BackgroundTask::BackgroundTask | ( | BNBackgroundTask * | task | ) |
BinaryNinja::BackgroundTask::BackgroundTask | ( | const std::string & | initialText, |
bool | canCancel ) |
Provides a mechanism for reporting progress of an optionally cancelable task to the user via the status bar in the UI.
If canCancel is is `True`, then the task can be cancelled either programmatically or by the user via the UI.
initialText | Text description of the progress of the background task (displayed in status bar of the UI) |
canCancel | Whether the task can be cancelled |
bool BackgroundTask::CanCancel | ( | ) | const |
bool BackgroundTask::IsCancelled | ( | ) | const |
bool BackgroundTask::IsFinished | ( | ) | const |
string BackgroundTask::GetProgressText | ( | ) | const |
uint64_t BackgroundTask::GetRuntimeSeconds | ( | ) | const |
void BackgroundTask::Cancel | ( | ) |
void BackgroundTask::Finish | ( | ) |
void BackgroundTask::SetProgressText | ( | const std::string & | text | ) |
|
static |