binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

`DisassemblyTextRenderer.get_instruction_annotations` is broken

Open negasora opened this issue 1 year ago • 1 comments

It was a victim of a refactor and now always returns an empty list

negasora avatar Aug 19 '24 14:08 negasora

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.

fuzyll avatar Aug 19 '24 18:08 fuzyll