main_window. This is the
QMainWindowinstance 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.
workspaceis also avaialble as an attribute on
instanceis 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.GlobalInfoobject, which contains a reference to
instance.projectas 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.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_eventin 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
**kwargsin 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 which you can use as a flag not to recurse any further.
instance.project.am_objand 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 Nonewill 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 instrucitons through
workspacecontains methods to manipulate UI elements. Notably, you can manipulate all open tabs with the
workspace.view_managerreference. 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
pluginsmodule of angr management, and also from
~/.local/share/angr-management/plugins. These paths are configurable through the program configuration, but at time of writing this is not exposed in the UI.
show=Falseto its constructor - this will also get you access to a workspace and an instance.