binaryninja-api
binaryninja-api copied to clipboard
`DisassemblyTextRenderer.get_instruction_annotations` is broken
It was a victim of a refactor and now always returns an empty list
Here is a workaround that appears to work:
r = DisassemblyTextRenderer(current_function)
tokens = list(r.get_disassembly_text(here))[0][0].tokens
in_annotation = False
out = ""
for i in tokens:
if i.type == InstructionTextTokenType.AnnotationToken:
in_annotation = True
continue
if in_annotation:
out += i.text
print(out)
We should still fix the API, though.