Workspace
The Workspace class implements the angr management workspace, providing access to views, plugins, analysis, and job management.
Constructor
Workspace(main_window: MainWindow)
The main window instance that contains this workspace
Properties
The main Instance object containing the angr project and analysis data
Manager for background jobs and tasks
Manager for command execution and history
Manager for all workspace views
Manager for loaded plugins
Manager for running analyses (CFG, decompilation, etc.)
View Management
add_view
add_view(view: BaseView) -> None
Add a view to the workspace.
The view to add to the workspace
remove_view
remove_view(view: BaseView) -> None
Remove a view from the workspace.
The view to remove from the workspace
raise_view
raise_view(view: BaseView) -> None
Bring a view to the front and give it focus.
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.
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.
List of view categories to refresh. If None, refreshes all views.
Navigation
jump_to
jump_to(addr: int, view=None, use_animation: bool = False) -> None
Jump to a specific address in a disassembly view.
The view to use. If None or not a disassembly view, uses or creates a disassembly view.
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.
Address (int) or symbol name (str) for the breakpoint
Breakpoint type: “execute”, “write”, or “read”. Auto-detected based on symbol type if not provided.
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 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.
The function to decompile
The instruction address to focus on in the decompiled view
The code view to use. If None, creates or uses existing pseudocode view.
LLM Features
llm_refine_all
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.
Assembly code to assemble and patch in
Whether to pad with NOPs to maintain instruction size
set_comment(addr: int, comment_text: str) -> None
Set a comment at the specified address.
Address to set comment at
Code Definition
define_code
define_code(addr: int) -> None
Define an address as code and regenerate CFG.
Address to define as code
undefine_code
undefine_code(addr: int) -> None
Undefine an address as code and mark it as data.
View Creation
new_disassembly_view
new_disassembly_view() -> DisassemblyView
Create and add a new disassembly view to the workspace.
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 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.
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.
The initial state for the simulation manager
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.
set_current_trace
set_current_trace(trace: Trace | None) -> None
Set the currently active trace.
The trace to set as current, or None to clear
remove_trace
remove_trace(trace: Trace) -> None
Remove a trace from the workspace.