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

Method get_lines

python/highlevelil.py:926–944  ·  view source on GitHub ↗

Gets HLIL text lines with optional settings

(self, settings: Optional['function.DisassemblySettings'] = None)

Source from the content-addressed store, hash-verified

924 return core.BNHighLevelILHasSideEffects(self.function.handle, self.expr_index)
925
926 def get_lines(self, settings: Optional['function.DisassemblySettings'] = None) -> LinesType:
927 """Gets HLIL text lines with optional settings"""
928 if settings is not None:
929 settings = settings.handle
930 count = ctypes.c_ulonglong()
931 lines = core.BNGetHighLevelILExprText(self.function.handle, self.expr_index, self.as_ast, count, settings)
932 assert lines is not None, "core.BNGetHighLevelILExprText returned None"
933 try:
934 for i in range(0, count.value):
935 addr = lines[i].addr
936 if lines[i].instrIndex != 0xffffffffffffffff:
937 il_instr = self.function[lines[i].instrIndex]
938 else:
939 il_instr = None
940 color = highlight.HighlightColor._from_core_struct(lines[i].highlight)
941 tokens = function.InstructionTextToken._from_core_struct(lines[i].tokens, lines[i].count)
942 yield function.DisassemblyTextLine(tokens, addr, il_instr, color)
943 finally:
944 core.BNFreeDisassemblyTextLines(lines, count.value)
945
946
947@dataclass(frozen=True, repr=False, eq=False)

Callers 4

__str__Method · 0.95
__repr__Method · 0.95
tokensMethod · 0.95
linesMethod · 0.95

Calls 2

DisassemblyTextLineMethod · 0.80
_from_core_structMethod · 0.45

Tested by

no test coverage detected