Skip to main content

Workspace

The Workspace class implements the angr management workspace, providing access to views, plugins, analysis, and job management.

Constructor

Workspace(main_window: MainWindow)
main_window
MainWindow
required
The main window instance that contains this workspace

Properties

main_instance
Instance
The main Instance object containing the angr project and analysis data
job_manager
JobManager
Manager for background jobs and tasks
command_manager
CommandManager
Manager for command execution and history
view_manager
ViewManager
Manager for all workspace views
plugins
PluginManager
Manager for loaded plugins
analysis_manager
AnalysisManager
Manager for running analyses (CFG, decompilation, etc.)

View Management

add_view

add_view(view: BaseView) -> None
Add a view to the workspace.
view
BaseView
required
The view to add to the workspace

remove_view

remove_view(view: BaseView) -> None
Remove a view from the workspace.
view
BaseView
required
The view to remove from the workspace

raise_view

raise_view(view: BaseView) -> None
Bring a view to the front and give it focus.
view
BaseView
required
The view to raise

reload

reload(categories: list[str] | None = None) -> None
Ask all or specified views to reload the underlying data and regenerate the UI. This is usually expensive.
categories
list[str]
List of view categories to reload. If None, reloads all views.

refresh

refresh(categories: list[str] | None = None) -> None
Ask all or specified views to refresh based on changes in the underlying data. This is fast and may be called frequently.
categories
list[str]
List of view categories to refresh. If None, refreshes all views.

jump_to

jump_to(addr: int, view=None, use_animation: bool = False) -> None
Jump to a specific address in a disassembly view.
addr
int
required
The address to jump to
view
BaseView
The view to use. If None or not a disassembly view, uses or creates a disassembly view.
use_animation
bool
default:"False"
Whether to use animation when jumping

viz

viz(obj: int | str | Function) -> None
Visualize the given object by jumping to it in the disassembly view.
obj
int | str | Function
required
  • For integers: jump to that address
  • For strings: look up the symbol and jump to it
  • For Function objects: jump to the function address

Breakpoints

add_breakpoint

add_breakpoint(obj: str | int, type_: str | None = None, size: int | None = None) -> None
Add a breakpoint at the specified location.
obj
str | int
required
Address (int) or symbol name (str) for the breakpoint
type_
str
Breakpoint type: “execute”, “write”, or “read”. Auto-detected based on symbol type if not provided.
size
int
Size of the breakpoint in bytes. Defaults to 1 or symbol size.

toggle_exec_breakpoint

toggle_exec_breakpoint() -> None
Toggle execution breakpoint at currently selected instruction(s) in disassembly view.

Analysis

run_analysis

run_analysis() -> None
Run analyses on the current project. Shows analysis options dialog if running with GUI.

decompile_current_function

decompile_current_function() -> None
Decompile the currently selected function.

decompile_function

decompile_function(func: Function, curr_ins=None, view=None) -> None
Decompile a specific function and switch to decompiled view.
func
Function
required
The function to decompile
curr_ins
int
The instruction address to focus on in the decompiled view
view
CodeView
The code view to use. If None, creates or uses existing pseudocode view.

LLM Features

llm_refine_all

llm_refine_all() -> None
Run LLM refinement on the currently decompiled function (all aspects).

llm_suggest_variable_names

llm_suggest_variable_names() -> None
Use LLM to suggest better variable names for the current function.

llm_suggest_function_name

llm_suggest_function_name() -> None
Use LLM to suggest a better function name.

llm_suggest_variable_types

llm_suggest_variable_types() -> None
Use LLM to suggest variable types for the current function.

llm_summarize_function

llm_summarize_function() -> None
Use LLM to generate a summary comment for the current function.

Patching

patch

patch(addr: int, asm: str, pad: bool = True) -> None
Patch an instruction at the given address with new assembly code.
addr
int
required
Address to patch
asm
str
required
Assembly code to assemble and patch in
pad
bool
default:"True"
Whether to pad with NOPs to maintain instruction size

set_comment

set_comment(addr: int, comment_text: str) -> None
Set a comment at the specified address.
addr
int
required
Address to set comment at
comment_text
str
required
The comment text

Code Definition

define_code

define_code(addr: int) -> None
Define an address as code and regenerate CFG.
addr
int
required
Address to define as code

undefine_code

undefine_code(addr: int) -> None
Undefine an address as code and mark it as data.
addr
int
required
Address to undefine

View Creation

new_disassembly_view

new_disassembly_view() -> DisassemblyView
Create and add a new disassembly view to the workspace.
return
DisassemblyView
The newly created disassembly view

show_linear_disassembly_view

show_linear_disassembly_view() -> None
Show or create a disassembly view in linear mode.

show_graph_disassembly_view

show_graph_disassembly_view() -> None
Show or create a disassembly view in graph mode.

show_pseudocode_view

show_pseudocode_view() -> None
Show or create the pseudocode/decompiler view.

show_hex_view

show_hex_view() -> None
Show or create the hex editor view.

show_functions_view

show_functions_view() -> None
Show or create the functions list view.

show_console_view

show_console_view() -> None
Show or create the interactive Python console view.

Debugging

step_forward

step_forward(until_addr: int | None = None) -> None
Step forward in the debugger.
until_addr
int
Step until reaching this address

continue_forward

continue_forward() -> None
Continue execution in the debugger.

create_simulation_manager

create_simulation_manager(state, state_name: str, view=None) -> None
Create a simulation manager from a state.
state
SimState
required
The initial state for the simulation manager
state_name
str
required
Name for the state
view
SymexecView
The symbolic execution view to use

Logging

log

log(msg: str | BaseException) -> None
Log a message to the console view.
msg
str | BaseException
required
Message or exception to log

Traces

load_trace_from_path

load_trace_from_path(path: str) -> None
Load a bintrace trace from the specified path.
path
str
required
Path to the trace file

set_current_trace

set_current_trace(trace: Trace | None) -> None
Set the currently active trace.
trace
Trace | None
required
The trace to set as current, or None to clear

remove_trace

remove_trace(trace: Trace) -> None
Remove a trace from the workspace.
trace
Trace
required
The trace to remove

Build docs developers (and LLMs) love