lineformatter module

binaryninja.lineformatter.CoreLineFormatter(handle)

binaryninja.lineformatter.LineFormatter([handle])

class LineFormatter represents a custom line formatter, which can reformat code in High Level IL and high level language representations.

binaryninja.lineformatter.LineFormatterSettings(...)

class CoreLineFormatter(handle: BNLineFormatter)[source]

Bases: LineFormatter

Parameters:

handle (BNLineFormatter) –

format_lines(in_lines: List[DisassemblyTextLine], settings: LineFormatterSettings) List[DisassemblyTextLine][source]

Reformats the given list of lines. Returns a new list of lines containing the reformatted code.

Parameters:
Return type:

List[DisassemblyTextLine]

class LineFormatter(handle=None)[source]

Bases: object

class LineFormatter represents a custom line formatter, which can reformat code in High Level IL and high level language representations.

format_lines(in_lines: List[DisassemblyTextLine], settings: LineFormatterSettings) List[DisassemblyTextLine][source]

Reformats the given list of lines. Returns a new list of lines containing the reformatted code.

Parameters:
Return type:

List[DisassemblyTextLine]

register()[source]

Registers the line formatter.

formatter_name = None
property name: str
class LineFormatterSettings(hlil: HighLevelILFunction, desired_line_length: int, minimum_content_length: int, tab_width: int, language_name: str | None, comment_start_string: str, comment_end_string: str, annotation_start_string: str, annotation_end_string: str)[source]

Bases: object

Parameters:
  • hlil (HighLevelILFunction) –

  • desired_line_length (int) –

  • minimum_content_length (int) –

  • tab_width (int) –

  • language_name (str | None) –

  • comment_start_string (str) –

  • comment_end_string (str) –

  • annotation_start_string (str) –

  • annotation_end_string (str) –

static default(settings: DisassemblySettings | None, hlil: HighLevelILFunction) LineFormatterSettings[source]

Gets the default line formatter settings for High Level IL code.

Parameters:
Return type:

LineFormatterSettings

static language_representation_settings(settings: DisassemblySettings | None, func: LanguageRepresentationFunction) LineFormatterSettings[source]

Gets the default line formatter settings for a language representation function.

Parameters:
Return type:

LineFormatterSettings

annotation_end_string: str
annotation_start_string: str
comment_end_string: str
comment_start_string: str
desired_line_length: int
hlil: HighLevelILFunction
language_name: str | None
minimum_content_length: int
tab_width: int