main_window
. This is the QMainWindow
instance for the application. It contains basic functions that correspond to top-level buttons, such as loading a binary.workspace
. This is a light object which coordinates the UI elements and manages the tabbed environment. You can use it to access any analysis-related GUI element, such as the disassembly view.instance
. This is angr management's data model. It contains mechanisms for synchronizing components on shared data sources, as well as logic for creating long-running jobs.workspace
is also available as an attribute on main_window
and instance
is available as an attribute on workspace
. If you are programming in a namespace where none of these objects are available, you can import the angrmanagment.logic.GlobalInfo
object, which contains a reference to main_window
.instance.project
as an example. This is an ObjectContainer that contains the current project. You can use it in every way that you would normally use a project - you can access project.factory
, project.kb
, etc. However, it also has two very important features that are helpful for building UIs.instance.project.am_subscribe(callback)
. Then, you can notify listeners of changes by calling instance.project.am_event()
. Note that events are NEVER automatically triggered - you must call am_event
in order to trigger the callbacks. One useful feature of this model is that you can provide arbitrary keyword arguments to am_event
, and they will be passed on to each callback. This means that you should always have your callbacks take **kwargs
in order to account for unknown parameters. This feature is particularly useful to prevent feedback loops - if you ever find yourself in a situation where you need to broadcast an event from your callback, you can add an argument that you can use as a flag not to recurse any further.instance.project.am_obj
and then send off an event. Combined with the event publication model, this provides an efficient way to build responsive UIs that follow the principle of least access.is None
will obviously not work. To resolve this, you can use instance.project.am_none
- this will be True when no project is loaded.__init__
method. There are more containers floating around for synchronizing on non-global elements - for example, the current state of the disassembly view is synchronized through its InfoDock object. Given a disassembly view instance, you can subscribe to, for example, its current selected instructions through view.infodock.selected_insns
.workspace
contains methods to manipulate UI elements. Notably, you can manipulate all open tabs with the workspace.view_manager
reference. Additionally, you can pass any sort of object you like to workspace.viz()
and it will attempt to visualize the object in the current window.angrmanagement.plugins.BasePlugin
. Plugin files will be automatically loaded from the plugins
module of angr management, and also from ~/.local/share/angr-management/plugins
. These paths are configurable through the program configuration, but at the time of writing, this is not exposed in the UI.show=False
to its constructor - this will also get you access to a workspace and an instance.