paint_over_graph
summary: paint text on graph view edges
- description:
This sample registers an action enabling painting of a recognizable string of text over horizontal nodes edge sections beyond a satisfying size threshold.
In a disassembly view, open the context menu and select “Paint on edges”. This should work for both graph disassembly, and proximity browser.
Using an “event filter”, we will intercept paint events targeted at the disassembly view, let it paint itself, and then add our own markers along.
level: advanced
Attributes
Classes
Module Contents
- paint_over_graph.edge_segment_threshold = 50
- paint_over_graph.text_color
- paint_over_graph.text_antialiasing = True
- paint_over_graph.verbose = False
- class paint_over_graph.painter_t(w, verbose=False)
Bases:
PySide6.QtCore.QObject- idaview
- idaview_pyqt
- target
- painting = False
- eventFilter(receiver, event)
- paint_over_graph.painter = None
- class paint_over_graph.paint_on_edges_t
Bases:
ida_kernwin.action_handler_t- activate(ctx)
Activate an action. This function implements the core behavior of an action. It is called when the action is triggered, from a menu, from a popup menu, from the toolbar, or programmatically.
- Returns:
non-zero: all IDA windows will be refreshed
- update(ctx)
Update an action. This is called when the context of the UI changed, and we need to let the action update some of its properties if needed (label, icon, …) In addition, this lets IDA know whether the action is enabled, and when it should be queried for availability again. Note: This callback is not meant to change anything in the application’s state, except by calling one (or many) of the “update_action_*()” functions on this very action.
- get_idaview(ctx)
- paint_over_graph.action_name = 'paint_over_graph:enable'
Bases:
ida_kernwin.UI_Hooks
- paint_over_graph.hooks