Binary Ninja API C++: VariableList

Classes

class  VariableListItem
 An item part of VariableListModel. More...
class  VariableListModel
 The backing model for the variable list widget, holds VariableListItem. More...
class  VariableListItemDelegate
class  VariableList
 The main variable list dock widget. More...
class  VariableListSidebarWidgetType
 The main variable list dock widget. More...

Enumerations

enum class  VariableListItemType { VariableListItemType::LocalVariable , VariableListItemType::DataVariable }
 A variable list item can represent either a function-local variable, or a data variable referenced by the current function. More...

◆ VariableListItem

An item part of VariableListModel.

Public Member Functions

 VariableListItem (FunctionRef func, BinaryNinja::Variable var, BinaryNinja::PossibleValueSet pvs, bool hasUidf, std::string name, bool showPlacementInformation)
 Create a new VariableListItem of the LocalVariable type.
 VariableListItem (FunctionRef func, BinaryNinja::DataVariable dataVar, uint64_t refPoint, std::string name, bool showPlacementInformation)
 Create a new VariableListItem of the DataVariable type.
VariableListItemType type () const
 Get the type of this list item.
std::string name () const
 Get the represented variable's display name.
std::string constantValue () const
 Get the data variable's value; use with data variable items only.
BinaryNinja::PossibleValueSet possibleValueSet () const
 Get the variable possible value set; use with local variable items only.
bool hasUidf () const
 Is the PVS user-provided? Use with local variable items only.
std::vector< BinaryNinja::InstructionTextTokentokensBeforeName () const
std::vector< BinaryNinja::InstructionTextTokentokensAfterName () const
void displayVariablePlacementInfo (std::vector< BinaryNinja::InstructionTextToken > &tokens) const
std::vector< BinaryNinja::InstructionTextTokendisplayTokens () const
 Shorthand to get concatenated type, name, and value tokens.
BinaryNinja::Variable variable () const
 Get the represented variable; use with variable items only.
BinaryNinja::DataVariable dataVariable () const
 Get the represented data variable; use with data variable items only.
uint64_t refPoint () const
 Get the first use of this variable; use with data variables items only.
bool isUserDefined () const
 Is any part of this item user-defined?

◆ VariableListItem() [1/2]

Create a new VariableListItem of the LocalVariable type.

◆ VariableListItem() [2/2]

Create a new VariableListItem of the DataVariable type.

◆ type()

VariableListItemType VariableListItem::type ( ) const

Get the type of this list item.

◆ name()

std::string VariableListItem::name ( ) const

Get the represented variable's display name.

◆ constantValue()

std::string VariableListItem::constantValue ( ) const

Get the data variable's value; use with data variable items only.

◆ possibleValueSet()

Get the variable possible value set; use with local variable items only.

◆ hasUidf()

bool VariableListItem::hasUidf ( ) const

Is the PVS user-provided? Use with local variable items only.

◆ tokensBeforeName()

◆ tokensAfterName()

◆ displayVariablePlacementInfo()

◆ displayTokens()

Shorthand to get concatenated type, name, and value tokens.

◆ variable()

Get the represented variable; use with variable items only.

◆ dataVariable()

Get the represented data variable; use with data variable items only.

◆ refPoint()

uint64_t VariableListItem::refPoint ( ) const

Get the first use of this variable; use with data variables items only.

◆ isUserDefined()

bool VariableListItem::isUserDefined ( ) const

Is any part of this item user-defined?

◆ VariableListModel

The backing model for the variable list widget, holds VariableListItem.

Public Member Functions

 VariableListModel (QWidget *parent, ViewFrame *view, BinaryViewRef data)
void clear ()
 Clear the list's content.
FunctionRef function () const
 Get the current function.
const BinaryNinja::FunctionViewTypefunctionType () const
 Get the current function type.
bool functionExceedsComplexity () const
 Whether or not the function exceeds the set complexity threshold.
bool showPlacementInformation () const
 Get the showPlacementInformation setting.
void setFunction (FunctionRef func, const BinaryNinja::FunctionViewType &il, const HighlightTokenState &hts)
 Set the focused function and update the content of the list.
void setSelectionModel (QItemSelectionModel *model)
 Set the selection model, should correspond to the parent widget's.
virtual QVariant data (const QModelIndex &i, int role) const override
virtual QModelIndex index (int row, int col, const QModelIndex &parent=QModelIndex()) const override
virtual int columnCount (const QModelIndex &parent=QModelIndex()) const override
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const override
Qt::ItemFlags flags (const QModelIndex &index) const override
virtual QVariant headerData (int column, Qt::Orientation orientation, int role) const override
void linkActivatedEvent (const QString &link)

◆ VariableListModel()

◆ clear()

void VariableListModel::clear ( )

Clear the list's content.

◆ function()

Get the current function.

◆ functionType()

Get the current function type.

◆ functionExceedsComplexity()

bool VariableListModel::functionExceedsComplexity ( ) const
inline

Whether or not the function exceeds the set complexity threshold.

◆ showPlacementInformation()

bool VariableListModel::showPlacementInformation ( ) const
inline

Get the showPlacementInformation setting.

◆ setFunction()

Set the focused function and update the content of the list.

◆ setSelectionModel()

void VariableListModel::setSelectionModel ( QItemSelectionModel * model)

Set the selection model, should correspond to the parent widget's.

◆ data()

virtual QVariant VariableListModel::data ( const QModelIndex & i,
int role ) const
overridevirtual

◆ index()

virtual QModelIndex VariableListModel::index ( int row,
int col,
const QModelIndex & parent = QModelIndex() ) const
overridevirtual

◆ columnCount()

virtual int VariableListModel::columnCount ( const QModelIndex & parent = QModelIndex()) const
overridevirtual

◆ rowCount()

virtual int VariableListModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
overridevirtual

◆ flags()

Qt::ItemFlags VariableListModel::flags ( const QModelIndex & index) const
override

◆ headerData()

virtual QVariant VariableListModel::headerData ( int column,
Qt::Orientation orientation,
int role ) const
overridevirtual

◆ linkActivatedEvent()

void VariableListModel::linkActivatedEvent ( const QString & link)

◆ VariableListItemDelegate

class VariableListItemDelegate

Public Member Functions

 VariableListItemDelegate (QObject *parent=nullptr)
void paint (QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &index) const
QSize sizeHint (const QStyleOptionViewItem &opt, const QModelIndex &index) const

◆ VariableListItemDelegate()

VariableListItemDelegate::VariableListItemDelegate ( QObject * parent = nullptr)
inline

◆ paint()

void VariableListItemDelegate::paint ( QPainter * painter,
const QStyleOptionViewItem & opt,
const QModelIndex & index ) const

◆ sizeHint()

QSize VariableListItemDelegate::sizeHint ( const QStyleOptionViewItem & opt,
const QModelIndex & index ) const

The main variable list dock widget.

Public Member Functions

 VariableList (ViewFrame *view, BinaryViewRef data)
QWidget * headerWidget () override
void focus () override
void refresh ()
VariableListItemselectedItem () const
 Get the VariableListItem corresponding to the current selection.
void showHamburgerMenu () const
void changeSelectedVariableName ()
 Show the rename dialog for the selected variable.
void changeSelectedVariableType ()
 Show the new type dialog for the selected variable.
void mergeSelectedVariable ()
 Show the "merge variables" dialog for the selected variable.
void clearSelectedVariableName ()
 Clear the selected variable's name.
void clearSelectedVariableType ()
 Clear the selected variable's type.
void clearSelectedVariableNameAndType ()
 Undefine the selected variable's user symbol.
void showSelectedVariableFirstUsage ()
 Navigate to the first usage of the selected variable.
void showSelectedDataVariableDefinition ()
 Navigate to the definition of the selected data variable.
void setSelectedVariableDeadStoreElimination (BNDeadStoreElimination dse)
 Set the selected variable's DSE policy.
void setSelectedVariableValue ()
 Prompt the user to set the selected variable's value.
void resetSelectedVariableValue ()
 Remove UIDF for the selected variable.
void copy ()
 Copy selected variables to clipboard.
virtual void setFilter (const std::string &filter) override
virtual void scrollToFirstItem () override
virtual void scrollToCurrentItem () override
virtual void ensureSelection () override
virtual void activateSelection () override
Public Member Functions inherited from SidebarWidget
 SidebarWidget (const QString &title)
 ~SidebarWidget ()
const QString & title () const
void setTitle (const QString &title)
void enableRefreshTimer (int interval)
void setRefreshQuiesce (bool enable)
bool isQuiesced () const
virtual void notifyRefresh ()
virtual void notifyQuiesce (bool)
virtual void notifyFontChanged ()
virtual void notifyOffsetChanged (uint64_t)
virtual void notifyThemeChanged ()
virtual void notifyViewChanged (ViewFrame *)
virtual void notifyViewLocationChanged (View *, const ViewLocation &)
virtual void closing ()
virtual void setPrimaryOrientation (Qt::Orientation)
Public Member Functions inherited from FilterTarget
virtual ~FilterTarget ()
virtual void closeFilter ()

Additional Inherited Members

Protected Attributes inherited from SidebarWidget
QString m_title
UIActionHandler m_actionHandler
ContextMenuManagerm_contextMenuManager = nullptr
Menum_menu = nullptr
bool m_quiesceState = true
QTimer * m_updateTimer = nullptr

◆ VariableList()

◆ headerWidget()

QWidget * VariableList::headerWidget ( )
inlineoverridevirtual

◆ focus()

void VariableList::focus ( )
inlineoverridevirtual

◆ refresh()

void VariableList::refresh ( )

◆ selectedItem()

VariableListItem * VariableList::selectedItem ( ) const

Get the VariableListItem corresponding to the current selection.

◆ showHamburgerMenu()

void VariableList::showHamburgerMenu ( ) const

◆ changeSelectedVariableName()

void VariableList::changeSelectedVariableName ( )

Show the rename dialog for the selected variable.

◆ changeSelectedVariableType()

void VariableList::changeSelectedVariableType ( )

Show the new type dialog for the selected variable.

◆ mergeSelectedVariable()

void VariableList::mergeSelectedVariable ( )

Show the "merge variables" dialog for the selected variable.

◆ clearSelectedVariableName()

void VariableList::clearSelectedVariableName ( )

Clear the selected variable's name.

◆ clearSelectedVariableType()

void VariableList::clearSelectedVariableType ( )

Clear the selected variable's type.

◆ clearSelectedVariableNameAndType()

void VariableList::clearSelectedVariableNameAndType ( )

Undefine the selected variable's user symbol.

◆ showSelectedVariableFirstUsage()

void VariableList::showSelectedVariableFirstUsage ( )

Navigate to the first usage of the selected variable.

◆ showSelectedDataVariableDefinition()

void VariableList::showSelectedDataVariableDefinition ( )

Navigate to the definition of the selected data variable.

◆ setSelectedVariableDeadStoreElimination()

Set the selected variable's DSE policy.

◆ setSelectedVariableValue()

void VariableList::setSelectedVariableValue ( )

Prompt the user to set the selected variable's value.

◆ resetSelectedVariableValue()

void VariableList::resetSelectedVariableValue ( )

Remove UIDF for the selected variable.

◆ copy()

void VariableList::copy ( )

Copy selected variables to clipboard.

◆ setFilter()

virtual void VariableList::setFilter ( const std::string & filter)
overridevirtual

◆ scrollToFirstItem()

virtual void VariableList::scrollToFirstItem ( )
overridevirtual

◆ scrollToCurrentItem()

virtual void VariableList::scrollToCurrentItem ( )
overridevirtual

◆ ensureSelection()

virtual void VariableList::ensureSelection ( )
overridevirtual

◆ activateSelection()

virtual void VariableList::activateSelection ( )
overridevirtual

◆ VariableListSidebarWidgetType

class VariableListSidebarWidgetType

◆ VariableListItemType

enum class VariableListItemType

strong

A variable list item can represent either a function-local variable, or a data variable referenced by the current function.

Enumerator
LocalVariable 
DataVariable