angr.knowledge_plugins.comments¶
- class angr.knowledge_plugins.comments.CommentKind¶
Bases:
IntEnumHow a comment is displayed.
PLAINshows only at its own address.FUNCTIONrenders as a header block above the function, which is also what the decompiler does with a comment on a function entry.REPEATABLEadditionally shows at every location referencing the commented address.- PLAIN = 0¶
- FUNCTION = 1¶
- REPEATABLE = 2¶
- __new__(value)
- class angr.knowledge_plugins.comments.Comment¶
Bases:
objectA comment together with its display metadata. Rebuilt on demand from the knowledge base.
- __init__(addr, text, kind, func_addr=None, func_name=None)¶
- Parameters:
addr (int)
text (str)
kind (CommentKind)
func_addr (int | None)
func_name (str | None)
- Return type:
None
- addr
- text
- kind
- func_addr
- func_name
- class angr.knowledge_plugins.comments.Comments¶
Bases:
KnowledgeBasePlugin,dictTracks comments via a Dict of Address -> Text, along with a per-address
CommentKind.- property kinds: dict[int, CommentKind]¶
Explicitly-set comment kinds. Addresses not present here use
kind_of()defaults.
- set_kind(addr, kind)¶
Set the display kind for the comment at
addr, or reset it to the default with None.- Return type:
- Parameters:
addr (int)
kind (CommentKind | None)
- function_comment(func_addr)¶
The comment rendered as a function’s header block, if any.
- inline_comment(addr)¶
The comment rendered next to the instruction at
addr. A comment that already renders as a function header block is not repeated inline.
- iter_comments()¶
All comments in address order, with their kinds and owning functions.
- repeatable_comments_at(ins_addr)¶
Repeatable comments that should show at
ins_addrbecause it references their address.