Skip to main content

View Base Classes

angr management provides several base classes for creating views. Views are UI components that display different aspects of the binary analysis.

BaseView

The base class for all main views.

Constructor

BaseView(
    category: str,
    workspace: Workspace,
    default_docking_position: str
)
category
str
required
The category of the view (e.g., “disassembly”, “pseudocode”, “hex”)
workspace
Workspace
required
The workspace this view belongs to
default_docking_position
str
required
Default docking position: “center”, “left”, “right”, “top”, or “bottom”

Properties

workspace
Workspace
The workspace containing this view
category
str
The view category
default_docking_position
str
Where the view should dock by default
index
int
Index number for this view instance (used in caption)
base_caption
str
Base caption text for the view
caption
str
Full caption including index (read-only property)
icon
QIcon
Icon for the view

Methods

focus

focus() -> None
Bring this view to the front and give it focus.

refresh

refresh() -> None
Refresh the view based on changes in underlying data. Should be fast as it may be called frequently.

reload

reload() -> None
Reload and regenerate the view from scratch. May be expensive.

InstanceView

Base class for views associated with an Instance.

Constructor

InstanceView(
    category: str,
    workspace: Workspace,
    default_docking_position: str,
    instance: Instance
)
category
str
required
The view category
workspace
Workspace
required
The workspace this view belongs to
default_docking_position
str
required
Default docking position
instance
Instance
required
The instance this view is associated with

Properties

instance
Instance
The instance containing project and analysis data
published_view_state
ViewState
The current view state being published

Methods

on_focused

on_focused() -> None
Called when this view receives focus.

notify_view_state_updated

notify_view_state_updated() -> None
Notify subscribers that the view state has been updated.

FunctionView

Base class for views that display function-specific content.

Constructor

FunctionView(
    category: str,
    workspace: Workspace,
    default_docking_position: str,
    instance: Instance
)
Parameters are the same as InstanceView.

Properties

function
Function | None
The currently displayed function (read/write property)

SynchronizedView

Base class for views that can be synchronized with other views.

Properties

sync_state
SynchronizedViewState
The synchronization state shared with other views

Methods

desync

desync() -> None
Stop synchronization with other views.

sync_with_state_object

sync_with_state_object(state: SynchronizedViewState | None = None) -> None
Synchronize with another view state.
state
SynchronizedViewState | None
required
The view state to synchronize with, or None to create a new isolated state

sync_from_state

sync_from_state() -> None
Update this view to reflect the current synchronized state.

set_synchronized_cursor_address

set_synchronized_cursor_address(address: int | None) -> None
Set the cursor address that will be synchronized across all views in the group.
address
int | None
required
The address to synchronize, or None to clear

on_synchronized_cursor_address_changed

on_synchronized_cursor_address_changed() -> None
Handle synchronized cursor address change event. Override to implement custom behavior.

set_synchronized_highlight_regions

set_synchronized_highlight_regions(regions: Sequence[SynchronizedHighlightRegion]) -> None
Set highlight regions that will be synchronized across views.
regions
Sequence[SynchronizedHighlightRegion]
required
The regions to highlight

on_synchronized_highlight_regions_changed

on_synchronized_highlight_regions_changed() -> None
Handle synchronized highlight region change event. Override to implement custom behavior.

on_synchronized_view_group_changed

on_synchronized_view_group_changed() -> None
Handle view being added to or removed from the synchronization group. Override to implement custom behavior.

get_synchronize_with_submenu

get_synchronize_with_submenu() -> QMenu
Get a submenu for ‘Synchronize with’ context menu option.
return
QMenu
A menu containing available view groups to synchronize with

SynchronizedInstanceView

Base class for views that are associated with an instance and can be synchronized. Combines InstanceView and SynchronizedView functionality.

Constructor

SynchronizedInstanceView(
    category: str,
    workspace: Workspace,
    default_docking_position: str,
    instance: Instance
)
Parameters are the same as InstanceView.

SynchronizedFunctionView

Base class for views that are function-specific and can be synchronized. Combines FunctionView and SynchronizedView functionality.

Constructor

SynchronizedFunctionView(
    category: str,
    workspace: Workspace,
    default_docking_position: str,
    instance: Instance
)
Parameters are the same as FunctionView.

ViewState

Represents the state of a view that can be published to other components.

Constructor

ViewState(cursors: list[int] | None = None)
cursors
list[int]
List of cursor addresses in the view

Properties

cursors
list[int]
List of cursor addresses

SynchronizedViewState

State tracking for synchronized views.

Properties

views
set[SynchronizedView]
Set of views participating in synchronization
cursor_address
int | None
The synchronized cursor address
highlight_regions
dict[SynchronizedView, Sequence[SynchronizedHighlightRegion]]
Highlight regions contributed by each view

Methods

register_view

register_view(view: SynchronizedView) -> None
Register a view for synchronization.
view
SynchronizedView
required
The view to register

unregister_view

unregister_view(view: SynchronizedView) -> None
Unregister a view from synchronization.
view
SynchronizedView
required
The view to unregister

Common View Categories

The following view categories are used in angr management:
  • disassembly - Disassembly view (graph and linear modes)
  • pseudocode - Decompiled pseudocode view
  • hex - Hex editor view
  • functions - Functions list view
  • strings - Strings view
  • console - Python console view
  • log - Log messages view
  • jobs - Background jobs view
  • symexec - Symbolic execution view
  • states - States list view
  • traces - Traces view
  • breakpoints - Breakpoints view
  • registers - Registers view
  • stack - Stack view
  • types - Types view
  • patches - Patches view
  • proximity - Proximity graph view
  • call_explorer - Call explorer view
  • data_dependency - Data dependency graph view

Build docs developers (and LLMs) love