Loading...
Searching...
No Matches
Scripting Provider

Detailed Description

Classes

class  BinaryNinja::ScriptingOutputListener
 
class  BinaryNinja::ScriptingInstance
 
class  BinaryNinja::CoreScriptingInstance
 
class  BinaryNinja::ScriptingProvider
 

Class Documentation

◆ BinaryNinja::ScriptingOutputListener

class BinaryNinja::ScriptingOutputListener

Public Member Functions

 ScriptingOutputListener ()
 
BNScriptingOutputListenerGetCallbacks ()
 
virtual void NotifyOutput (const std::string &text)
 
virtual void NotifyWarning (const std::string &text)
 
virtual void NotifyError (const std::string &text)
 
virtual void NotifyInputReadyStateChanged (BNScriptingProviderInputReadyState state)
 

Constructor & Destructor Documentation

◆ ScriptingOutputListener()

ScriptingOutputListener::ScriptingOutputListener ( )

Member Function Documentation

◆ GetCallbacks()

BNScriptingOutputListener & BinaryNinja::ScriptingOutputListener::GetCallbacks ( )
inline

◆ NotifyOutput()

void ScriptingOutputListener::NotifyOutput ( const std::string & text)
virtual

Reimplemented in ScriptingConsole.

◆ NotifyWarning()

void ScriptingOutputListener::NotifyWarning ( const std::string & text)
virtual

Reimplemented in ScriptingConsole.

◆ NotifyError()

void ScriptingOutputListener::NotifyError ( const std::string & text)
virtual

Reimplemented in ScriptingConsole.

◆ NotifyInputReadyStateChanged()

void ScriptingOutputListener::NotifyInputReadyStateChanged ( BNScriptingProviderInputReadyState state)
virtual

Reimplemented in ScriptingConsole.

◆ BinaryNinja::ScriptingInstance

class BinaryNinja::ScriptingInstance

Public Member Functions

virtual BNScriptingProviderExecuteResult ExecuteScriptInput (const std::string &input)=0
 
virtual BNScriptingProviderExecuteResult ExecuteScriptInputFromFilename (const std::string &filename)=0
 
virtual void CancelScriptInput ()
 
virtual void ReleaseBinaryView (BinaryView *view)
 
virtual void SetCurrentBinaryView (BinaryView *view)
 
virtual void SetCurrentFunction (Function *func)
 
virtual void SetCurrentBasicBlock (BasicBlock *block)
 
virtual void SetCurrentAddress (uint64_t addr)
 
virtual void SetCurrentSelection (uint64_t begin, uint64_t end)
 
virtual std::string CompleteInput (const std::string &text, uint64_t state)
 
virtual void Stop ()
 
void Output (const std::string &text)
 
void Warning (const std::string &text)
 
void Error (const std::string &text)
 
void InputReadyStateChanged (BNScriptingProviderInputReadyState state)
 
BNScriptingProviderInputReadyState GetInputReadyState ()
 
void RegisterOutputListener (ScriptingOutputListener *listener)
 
void UnregisterOutputListener (ScriptingOutputListener *listener)
 
std::string GetDelimiters ()
 
void SetDelimiters (const std::string &delimiters)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNScriptingInstance, BNNewScriptingInstanceReference, BNFreeScriptingInstance >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNScriptingInstanceGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Protected Member Functions

 ScriptingInstance (ScriptingProvider *provider)
 
 ScriptingInstance (BNScriptingInstance *instance)
 
virtual void DestroyInstance ()
 

Static Protected Member Functions

static void DestroyInstanceCallback (void *ctxt)
 
static BNScriptingProviderExecuteResult ExecuteScriptInputCallback (void *ctxt, const char *input)
 
static BNScriptingProviderExecuteResult ExecuteScriptFromFilenameCallback (void *ctxt, const char *filename)
 
static void CancelScriptInputCallback (void *ctxt)
 
static void ReleaseBinaryViewCallback (void *ctxt, BNBinaryView *view)
 
static void SetCurrentBinaryViewCallback (void *ctxt, BNBinaryView *view)
 
static void SetCurrentFunctionCallback (void *ctxt, BNFunction *func)
 
static void SetCurrentBasicBlockCallback (void *ctxt, BNBasicBlock *block)
 
static void SetCurrentAddressCallback (void *ctxt, uint64_t addr)
 
static void SetCurrentSelectionCallback (void *ctxt, uint64_t begin, uint64_t end)
 
static char * CompleteInputCallback (void *ctxt, const char *text, uint64_t state)
 
static void StopCallback (void *ctxt)
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNScriptingInstance, BNNewScriptingInstanceReference, BNFreeScriptingInstance >
static BNScriptingInstanceGetObject (CoreRefCountObject *obj)
 
static BNScriptingInstanceGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNScriptingInstance, BNNewScriptingInstanceReference, BNFreeScriptingInstance >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNScriptingInstancem_object
 

Constructor & Destructor Documentation

◆ ScriptingInstance() [1/2]

ScriptingInstance::ScriptingInstance ( ScriptingProvider * provider)
protected

◆ ScriptingInstance() [2/2]

ScriptingInstance::ScriptingInstance ( BNScriptingInstance * instance)
protected

Member Function Documentation

◆ DestroyInstanceCallback()

void ScriptingInstance::DestroyInstanceCallback ( void * ctxt)
staticprotected

◆ ExecuteScriptInputCallback()

BNScriptingProviderExecuteResult ScriptingInstance::ExecuteScriptInputCallback ( void * ctxt,
const char * input )
staticprotected

◆ ExecuteScriptFromFilenameCallback()

static BNScriptingProviderExecuteResult BinaryNinja::ScriptingInstance::ExecuteScriptFromFilenameCallback ( void * ctxt,
const char * filename )
staticprotected

◆ CancelScriptInputCallback()

void ScriptingInstance::CancelScriptInputCallback ( void * ctxt)
staticprotected

◆ ReleaseBinaryViewCallback()

void ScriptingInstance::ReleaseBinaryViewCallback ( void * ctxt,
BNBinaryView * view )
staticprotected

◆ SetCurrentBinaryViewCallback()

void ScriptingInstance::SetCurrentBinaryViewCallback ( void * ctxt,
BNBinaryView * view )
staticprotected

◆ SetCurrentFunctionCallback()

void ScriptingInstance::SetCurrentFunctionCallback ( void * ctxt,
BNFunction * func )
staticprotected

◆ SetCurrentBasicBlockCallback()

void ScriptingInstance::SetCurrentBasicBlockCallback ( void * ctxt,
BNBasicBlock * block )
staticprotected

◆ SetCurrentAddressCallback()

void ScriptingInstance::SetCurrentAddressCallback ( void * ctxt,
uint64_t addr )
staticprotected

◆ SetCurrentSelectionCallback()

void ScriptingInstance::SetCurrentSelectionCallback ( void * ctxt,
uint64_t begin,
uint64_t end )
staticprotected

◆ CompleteInputCallback()

char * ScriptingInstance::CompleteInputCallback ( void * ctxt,
const char * text,
uint64_t state )
staticprotected

◆ StopCallback()

void ScriptingInstance::StopCallback ( void * ctxt)
staticprotected

◆ DestroyInstance()

void ScriptingInstance::DestroyInstance ( )
protectedvirtual

◆ ExecuteScriptInput()

virtual BNScriptingProviderExecuteResult BinaryNinja::ScriptingInstance::ExecuteScriptInput ( const std::string & input)
pure virtual

◆ ExecuteScriptInputFromFilename()

virtual BNScriptingProviderExecuteResult BinaryNinja::ScriptingInstance::ExecuteScriptInputFromFilename ( const std::string & filename)
pure virtual

◆ CancelScriptInput()

void ScriptingInstance::CancelScriptInput ( )
virtual

◆ ReleaseBinaryView()

void ScriptingInstance::ReleaseBinaryView ( BinaryView * view)
virtual

◆ SetCurrentBinaryView()

void ScriptingInstance::SetCurrentBinaryView ( BinaryView * view)
virtual

◆ SetCurrentFunction()

void ScriptingInstance::SetCurrentFunction ( Function * func)
virtual

◆ SetCurrentBasicBlock()

void ScriptingInstance::SetCurrentBasicBlock ( BasicBlock * block)
virtual

◆ SetCurrentAddress()

void ScriptingInstance::SetCurrentAddress ( uint64_t addr)
virtual

◆ SetCurrentSelection()

void ScriptingInstance::SetCurrentSelection ( uint64_t begin,
uint64_t end )
virtual

◆ CompleteInput()

std::string ScriptingInstance::CompleteInput ( const std::string & text,
uint64_t state )
virtual

◆ Stop()

void ScriptingInstance::Stop ( )
virtual

◆ Output()

void ScriptingInstance::Output ( const std::string & text)

◆ Warning()

void ScriptingInstance::Warning ( const std::string & text)

◆ Error()

void ScriptingInstance::Error ( const std::string & text)

◆ InputReadyStateChanged()

void ScriptingInstance::InputReadyStateChanged ( BNScriptingProviderInputReadyState state)

◆ GetInputReadyState()

BNScriptingProviderInputReadyState ScriptingInstance::GetInputReadyState ( )

◆ RegisterOutputListener()

void ScriptingInstance::RegisterOutputListener ( ScriptingOutputListener * listener)

◆ UnregisterOutputListener()

void ScriptingInstance::UnregisterOutputListener ( ScriptingOutputListener * listener)

◆ GetDelimiters()

std::string ScriptingInstance::GetDelimiters ( )

◆ SetDelimiters()

void ScriptingInstance::SetDelimiters ( const std::string & delimiters)

◆ BinaryNinja::CoreScriptingInstance

class BinaryNinja::CoreScriptingInstance

Public Member Functions

 CoreScriptingInstance (BNScriptingInstance *instance)
 
virtual ~CoreScriptingInstance ()
 
virtual BNScriptingProviderExecuteResult ExecuteScriptInput (const std::string &input) override
 
virtual BNScriptingProviderExecuteResult ExecuteScriptInputFromFilename (const std::string &filename) override
 
virtual void CancelScriptInput () override
 
virtual void ReleaseBinaryView (BinaryView *view) override
 
virtual void SetCurrentBinaryView (BinaryView *view) override
 
virtual void SetCurrentFunction (Function *func) override
 
virtual void SetCurrentBasicBlock (BasicBlock *block) override
 
virtual void SetCurrentAddress (uint64_t addr) override
 
virtual void SetCurrentSelection (uint64_t begin, uint64_t end) override
 
virtual std::string CompleteInput (const std::string &text, uint64_t state) override
 
virtual void Stop () override
 
- Public Member Functions inherited from BinaryNinja::ScriptingInstance
void Output (const std::string &text)
 
void Warning (const std::string &text)
 
void Error (const std::string &text)
 
void InputReadyStateChanged (BNScriptingProviderInputReadyState state)
 
BNScriptingProviderInputReadyState GetInputReadyState ()
 
void RegisterOutputListener (ScriptingOutputListener *listener)
 
void UnregisterOutputListener (ScriptingOutputListener *listener)
 
std::string GetDelimiters ()
 
void SetDelimiters (const std::string &delimiters)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNScriptingInstance, BNNewScriptingInstanceReference, BNFreeScriptingInstance >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNScriptingInstanceGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNScriptingInstance, BNNewScriptingInstanceReference, BNFreeScriptingInstance >
static BNScriptingInstanceGetObject (CoreRefCountObject *obj)
 
static BNScriptingInstanceGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNScriptingInstance, BNNewScriptingInstanceReference, BNFreeScriptingInstance >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNScriptingInstancem_object
 
- Protected Member Functions inherited from BinaryNinja::ScriptingInstance
 ScriptingInstance (ScriptingProvider *provider)
 
 ScriptingInstance (BNScriptingInstance *instance)
 
virtual void DestroyInstance ()
 
- Static Protected Member Functions inherited from BinaryNinja::ScriptingInstance
static void DestroyInstanceCallback (void *ctxt)
 
static BNScriptingProviderExecuteResult ExecuteScriptInputCallback (void *ctxt, const char *input)
 
static BNScriptingProviderExecuteResult ExecuteScriptFromFilenameCallback (void *ctxt, const char *filename)
 
static void CancelScriptInputCallback (void *ctxt)
 
static void ReleaseBinaryViewCallback (void *ctxt, BNBinaryView *view)
 
static void SetCurrentBinaryViewCallback (void *ctxt, BNBinaryView *view)
 
static void SetCurrentFunctionCallback (void *ctxt, BNFunction *func)
 
static void SetCurrentBasicBlockCallback (void *ctxt, BNBasicBlock *block)
 
static void SetCurrentAddressCallback (void *ctxt, uint64_t addr)
 
static void SetCurrentSelectionCallback (void *ctxt, uint64_t begin, uint64_t end)
 
static char * CompleteInputCallback (void *ctxt, const char *text, uint64_t state)
 
static void StopCallback (void *ctxt)
 

Constructor & Destructor Documentation

◆ CoreScriptingInstance()

CoreScriptingInstance::CoreScriptingInstance ( BNScriptingInstance * instance)

◆ ~CoreScriptingInstance()

virtual BinaryNinja::CoreScriptingInstance::~CoreScriptingInstance ( )
inlinevirtual

Member Function Documentation

◆ ExecuteScriptInput()

BNScriptingProviderExecuteResult CoreScriptingInstance::ExecuteScriptInput ( const std::string & input)
overridevirtual

◆ ExecuteScriptInputFromFilename()

BNScriptingProviderExecuteResult CoreScriptingInstance::ExecuteScriptInputFromFilename ( const std::string & filename)
overridevirtual

◆ CancelScriptInput()

void CoreScriptingInstance::CancelScriptInput ( )
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ ReleaseBinaryView()

void CoreScriptingInstance::ReleaseBinaryView ( BinaryView * view)
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ SetCurrentBinaryView()

void CoreScriptingInstance::SetCurrentBinaryView ( BinaryView * view)
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ SetCurrentFunction()

void CoreScriptingInstance::SetCurrentFunction ( Function * func)
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ SetCurrentBasicBlock()

void CoreScriptingInstance::SetCurrentBasicBlock ( BasicBlock * block)
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ SetCurrentAddress()

void CoreScriptingInstance::SetCurrentAddress ( uint64_t addr)
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ SetCurrentSelection()

void CoreScriptingInstance::SetCurrentSelection ( uint64_t begin,
uint64_t end )
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ CompleteInput()

std::string CoreScriptingInstance::CompleteInput ( const std::string & text,
uint64_t state )
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ Stop()

void CoreScriptingInstance::Stop ( )
overridevirtual

Reimplemented from BinaryNinja::ScriptingInstance.

◆ BinaryNinja::ScriptingProvider

class BinaryNinja::ScriptingProvider

Public Member Functions

virtual Ref< ScriptingInstanceCreateNewInstance ()=0
 
virtual bool LoadModule (const std::string &repository, const std::string &module, bool force)=0
 
virtual bool InstallModules (const std::string &modules)=0
 
std::string GetName ()
 
std::string GetAPIName ()
 
- Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNScriptingProvider >
 StaticCoreRefCountObject ()
 
virtual ~StaticCoreRefCountObject ()
 
BNScriptingProviderGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Static Public Member Functions

static std::vector< Ref< ScriptingProvider > > GetList ()
 
static Ref< ScriptingProviderGetByName (const std::string &name)
 
static Ref< ScriptingProviderGetByAPIName (const std::string &apiName)
 
static void Register (ScriptingProvider *provider)
 
- Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNScriptingProvider >
static BNScriptingProviderGetObject (StaticCoreRefCountObject *obj)
 

Protected Member Functions

 ScriptingProvider (const std::string &name, const std::string &apiName)
 
 ScriptingProvider (BNScriptingProvider *provider)
 

Static Protected Member Functions

static BNScriptingInstanceCreateInstanceCallback (void *ctxt)
 
static bool LoadModuleCallback (void *ctxt, const char *repository, const char *module, bool force)
 
static bool InstallModulesCallback (void *ctxt, const char *modules)
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNScriptingProvider >
std::atomic< int > m_refs
 
BNScriptingProviderm_object
 

Constructor & Destructor Documentation

◆ ScriptingProvider() [1/2]

BinaryNinja::ScriptingProvider::ScriptingProvider ( const std::string & name,
const std::string & apiName )
protected

◆ ScriptingProvider() [2/2]

ScriptingProvider::ScriptingProvider ( BNScriptingProvider * provider)
protected

Member Function Documentation

◆ CreateInstanceCallback()

BNScriptingInstance * ScriptingProvider::CreateInstanceCallback ( void * ctxt)
staticprotected

◆ LoadModuleCallback()

bool ScriptingProvider::LoadModuleCallback ( void * ctxt,
const char * repository,
const char * module,
bool force )
staticprotected

◆ InstallModulesCallback()

bool ScriptingProvider::InstallModulesCallback ( void * ctxt,
const char * modules )
staticprotected

◆ CreateNewInstance()

virtual Ref< ScriptingInstance > BinaryNinja::ScriptingProvider::CreateNewInstance ( )
pure virtual

◆ LoadModule()

virtual bool BinaryNinja::ScriptingProvider::LoadModule ( const std::string & repository,
const std::string & module,
bool force )
pure virtual

◆ InstallModules()

virtual bool BinaryNinja::ScriptingProvider::InstallModules ( const std::string & modules)
pure virtual

◆ GetName()

string ScriptingProvider::GetName ( )

◆ GetAPIName()

string ScriptingProvider::GetAPIName ( )

◆ GetList()

vector< Ref< ScriptingProvider > > ScriptingProvider::GetList ( )
static

◆ GetByName()

Ref< ScriptingProvider > ScriptingProvider::GetByName ( const std::string & name)
static

◆ GetByAPIName()

Ref< ScriptingProvider > ScriptingProvider::GetByAPIName ( const std::string & apiName)
static

◆ Register()

void ScriptingProvider::Register ( ScriptingProvider * provider)
static