FIRST :: Model

class first_plugin_ida.first.FIRST[source]
class Model[source]
class Base(header, data=None, parent=None)[source]

A QT QAbstractTableModel Implementation.

Parameters:
  • header (list) – The column values.
  • data (dict) – Dictionary of values.
  • parent (QtCore.QObject) – The parent object.

Overloads many class methods to provide the functionality FIRST required.

columnCount(parent=<sphinx.ext.autodoc.importer._MockObject object>)[source]

The number of columns for the children of the given parent.

Parameters:parent (QtCore.QModelIndex, optional) – Parent
Returns:Number of columns
Return type:int
data(index, role=<sphinx.ext.autodoc.importer._MockObject object>)[source]

The data stored under the given role for the item referred to by the index.

Parameters:
  • index (QtCore.QModelIndex) – Index
  • role (Qt.ItemDataRole) – Default Qt.DisplayRole
Returns:

data

headerData(section, orientation, role=<sphinx.ext.autodoc.importer._MockObject object>)[source]

The data for the given role and section in the header with the specified orientation.

Parameters:
  • section (int) –
  • orientation (Qt.Orientation) –
  • role (Qt.DisplayRole) –
Returns:

data

raw_data(i)[source]

Provides a way to get the raw data in the model.

Parameters:i (int) – The data index to be retrieved.
Returns:dict. The data held at the given index, otherwise None.
rowCount(parent=<sphinx.ext.autodoc.importer._MockObject object>)[source]

The number of rows under the given parent.

When the parent is valid it means that rowCount is returning the number of children of parent.

Parameters:parent (QtCore.QModelIndex, optional) – Parent
Returns:Number of rows
Return type:int
class Check(data, parent=None)[source]

Expands on the Qt QStandardItemModel for Check operations.

add_data(data)[source]

Provides a way to add more data to the model.

Parameters:data (dict) – Data to be added to the model.
data(index, role)[source]

The data stored under the given role for the item referred to by the index.

Parameters:
  • index (QtCore.QModelIndex) – Index
  • role (Qt.ItemDataRole) – Default Qt.DisplayRole
Returns:

data

get_selected_data()[source]

Returns a dictionary of data selected in the model.

select_highest_ranked(flag, hidden=[])[source]

Sets the highsest rank annotations as (de)selected.

Parameters:
  • flag (bool) – Where to select or deselect the highest. True to select highest, False to deselect highest.
  • hidden (list or int) – Address that should be skipped.
set_id_selected(data)[source]

Add or removes data associated with an ID to/from the selected ids array.

Parameters:data (list) – The data to be (de)selected.
unselect_group(data)[source]

Unselects a group of addresses at once.

Parameters:data (list of int) – List of addresses.
class TreeView(widget=None, depth=2)[source]

A QT QTreeView Implementation.

Parameters:
  • widget (Qt.QObject, optional) – The parent.
  • depth (int, optional) – The depth of the tree.
drawRow(painter, option, index)[source]

Draws the row in the tree view that contains the model item index, using the painter given. The option control how the item is displayed.

Parameters:
  • painter (QtGui.QPainter) – Painter
  • option (QtGui.QStyleOptionViewItem) – Options
  • index (QtCore.QModelIndex) – Index
class Upload(header, data, parent=None)[source]

Expands on the Base QAbstractTableModel for Add operation.

Data held in this DataModel is sorted based on their offset within the IDB. A couple of additional functions are added to this model to provide more functionality to modify the selected underlying data.

data(index, role)[source]

The data stored under the given role for the item referred to by the index.

Parameters:
  • index (QtCore.QModelIndex) – Index
  • role (Qt.ItemDataRole) – Default Qt.DisplayRole
Returns:

data

filter_sub_functions(flag)[source]

Filters out or restores any sub_* functions.

Parameters:flag (bool) – Flag to filter out or restore sub_* functions
get_selected_data()[source]

Returns the list of data selected in the model.

select_all(flag)[source]

Makes all visible functions selected or deselected.

Parameters:flag (bool) – Flag to select or deselect all.
set_colors(changed='66d9ef', unchanged='d2d2d2', default='ffffff', select='a9c5ff')[source]

Sets the colors associated with the various properties.

Parameters:
  • changed (str) – Change color, default: ‘66d9ef’
  • unchanged (str) – Unchanged color, default: ‘d2d2d2’
  • default (str) – Default color, default: ‘ffffff’
  • select (str) – Selected color, default: ‘a9c5ff’
set_row_selected(row)[source]

Causes a row to be selected or deselected.

Parameters:row (int) – The row index to be selected.