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

Method wrap_comment

python/function.py:3829–3857  ·  view source on GitHub ↗
(
	    self, lines: List['DisassemblyTextLine'], cur_line: 'DisassemblyTextLine', comment: str,
	    has_auto_annotations: bool, leading_spaces: str = "  ", indent_spaces: str = ""
	)

Source from the content-addressed store, hash-verified

3827 core.BNFreeInstructionText(new_tokens, count.value)
3828
3829 def wrap_comment(
3830 self, lines: List['DisassemblyTextLine'], cur_line: 'DisassemblyTextLine', comment: str,
3831 has_auto_annotations: bool, leading_spaces: str = " ", indent_spaces: str = ""
3832 ) -> None:
3833 cur_line_obj = core.BNDisassemblyTextLine()
3834 cur_line_obj.addr = cur_line.address
3835 if cur_line.il_instruction is None:
3836 cur_line_obj.instrIndex = 0xffffffffffffffff
3837 else:
3838 cur_line_obj.instrIndex = cur_line.il_instruction.instr_index
3839 cur_line_obj.highlight = cur_line.highlight._to_core_struct()
3840 cur_line_obj.tokens = InstructionTextToken._get_core_struct(cur_line.tokens)
3841 cur_line_obj.count = len(cur_line.tokens)
3842 count = ctypes.c_ulonglong()
3843 new_lines = core.BNDisassemblyTextRendererWrapComment(
3844 self.handle, cur_line_obj, count, comment, has_auto_annotations, leading_spaces, indent_spaces
3845 )
3846 assert new_lines is not None, "core.BNDisassemblyTextRendererWrapComment returned None"
3847 il_function = self.il_function
3848 for i in range(0, count.value):
3849 addr = new_lines[i].addr
3850 if (new_lines[i].instrIndex != 0xffffffffffffffff) and (il_function is not None):
3851 il_instr = il_function[new_lines[i].instrIndex]
3852 else:
3853 il_instr = None
3854 color = _highlight.HighlightColor._from_core_struct(new_lines[i].highlight)
3855 tokens = InstructionTextToken._from_core_struct(new_lines[i].tokens, new_lines[i].count)
3856 lines.append(DisassemblyTextLine(tokens, addr, il_instr, color))
3857 core.BNFreeDisassemblyTextLines(new_lines, count.value)

Callers 1

apply_to_linesFunction · 0.45

Calls 5

_get_core_structMethod · 0.80
DisassemblyTextLineClass · 0.70
_to_core_structMethod · 0.45
_from_core_structMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected