MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / get_disassembly_text

Method get_disassembly_text

python/function.py:3697–3718  ·  view source on GitHub ↗
(self, addr: int)

Source from the content-addressed store, hash-verified

3695 core.BNFreeDisassemblyTextLines(lines, count.value)
3696
3697 def get_disassembly_text(self, addr: int) -> Generator[Tuple[Optional['DisassemblyTextLine'], int], None, None]:
3698 count = ctypes.c_ulonglong()
3699 length = ctypes.c_ulonglong()
3700 length.value = 0
3701 lines = ctypes.POINTER(core.BNDisassemblyTextLine)()
3702 ok = core.BNGetDisassemblyTextRendererLines(self.handle, addr, length, lines, count)
3703 if not ok:
3704 yield None, 0
3705 return
3706 il_function = self.il_function
3707 try:
3708 for i in range(0, count.value):
3709 addr = lines[i].addr
3710 if (lines[i].instrIndex != 0xffffffffffffffff) and (il_function is not None):
3711 il_instr = il_function[lines[i].instrIndex]
3712 else:
3713 il_instr = None
3714 color = _highlight.HighlightColor._from_core_struct(lines[i].highlight)
3715 tokens = InstructionTextToken._from_core_struct(lines[i].tokens, lines[i].count)
3716 yield DisassemblyTextLine(tokens, addr, il_instr, color), length.value
3717 finally:
3718 core.BNFreeDisassemblyTextLines(lines, count.value)
3719
3720 def post_process_lines(
3721 self, addr: int, length: int, in_lines: Union[str, List[str], List['DisassemblyTextLine']],

Callers 2

generateLinesMethod · 0.95
populate_nodesMethod · 0.95

Calls 2

DisassemblyTextLineClass · 0.70
_from_core_structMethod · 0.45

Tested by

no test coverage detected