interaction module

Class

Description

binaryninja.interaction.AddressField

AddressField prompts the user for an address. By passing the optional view and…

binaryninja.interaction.CheckboxField

CheckboxField prompts the user to choose a yes/no option in a checkbox.

binaryninja.interaction.ChoiceField

ChoiceField prompts the user to choose from the list of strings provided in choices….

binaryninja.interaction.DirectoryNameField

DirectoryNameField prompts the user to specify a directory name to open. Result is stored in…

binaryninja.interaction.FlowGraphReport

binaryninja.interaction.HTMLReport

binaryninja.interaction.IntegerField

IntegerField add prompt for integer. Result is stored in self.result as an int.

binaryninja.interaction.InteractionHandler

binaryninja.interaction.LabelField

LabelField adds a text label to the display.

binaryninja.interaction.MarkdownReport

binaryninja.interaction.MultilineTextField

MultilineTextField add multi-line text string input field. Result is stored in self.result

binaryninja.interaction.OpenFileNameField

OpenFileNameField prompts the user to specify a file name to open. Result is stored in…

binaryninja.interaction.PlainTextReport

binaryninja.interaction.ReportCollection

binaryninja.interaction.SaveFileNameField

SaveFileNameField prompts the user to specify a file name to save. Result is stored in…

binaryninja.interaction.SeparatorField

SeparatorField adds vertical separation to the display.

binaryninja.interaction.TextLineField

TextLineField Adds prompt for text string input. Result is stored in self.result as a string…

AddressField

class AddressField[source]

Bases: object

AddressField prompts the user for an address. By passing the optional view and current_address parameters offsets can be used instead of just an address. The result is stored as in int in self.result.

Note

This API currently functions differently on the command-line, as the view and current_address are disregarded. Additionally where as in the UI the result defaults to hexadecimal on the command-line 0x must be specified.

__init__(prompt: str, view: BinaryView | None = None, current_address: int = 0, default: int | None = None)[source]
Parameters:
  • prompt (str) –

  • view (BinaryView | None) –

  • current_address (int) –

  • default (int | None) –

property current_address

current address to use as a base for relative calculations

property prompt

prompt to be presented to the user

property result
property view

BinaryView for the address

CheckboxField

class CheckboxField[source]

Bases: object

CheckboxField prompts the user to choose a yes/no option in a checkbox. Result is stored in self.result as a boolean value.

Parameters:
  • prompt (str) – Prompt to be presented to the user

  • default (bool) – Default state of the checkbox (False == unchecked, True == checked)

__init__(prompt, default)[source]
property default
property prompt
property result

ChoiceField

class ChoiceField[source]

Bases: object

ChoiceField prompts the user to choose from the list of strings provided in choices. Result is stored in self.result as an index in to the choices array.

Parameters:
  • prompt (str) – Prompt to be presented to the user

  • choices (list(str)) – List of choices to choose from

  • default (Optional[int]) – Optional index into choices that will be selected by default

__init__(prompt: str, choices: List[str], default: int | None = None)[source]
Parameters:
  • prompt (str) –

  • choices (List[str]) –

  • default (int | None) –

property choices: List[str]
property default: int | None
property prompt: str
property result: int | None

DirectoryNameField

class DirectoryNameField[source]

Bases: object

DirectoryNameField prompts the user to specify a directory name to open. Result is stored in self.result as a string.

__init__(prompt, default_name='', default=None)[source]
property default_name
property prompt
property result

FlowGraphReport

class FlowGraphReport[source]

Bases: object

__init__(title, graph, view=None)[source]
property graph
property title
property view

HTMLReport

class HTMLReport[source]

Bases: object

__init__(title, contents, plaintext='', view=None)[source]
property contents
property plaintext
property title
property view

IntegerField

class IntegerField[source]

Bases: object

IntegerField add prompt for integer. Result is stored in self.result as an int.

__init__(prompt: str, default: int | None = None)[source]
Parameters:
  • prompt (str) –

  • default (int | None) –

property prompt
property result

InteractionHandler

class InteractionHandler[source]

Bases: object

__init__()[source]
get_address_input(prompt, title, view, current_address)[source]
get_checkbox_input(prompt, default_choice)[source]
get_choice_input(prompt, title, choices)[source]
get_directory_name_input(prompt, default_name)[source]
get_form_input(fields, title)[source]
get_int_input(prompt, title)[source]
get_large_choice_input(prompt, title, choices)[source]
get_open_filename_input(prompt, ext)[source]
get_save_filename_input(prompt, ext, default_name)[source]
get_text_line_input(prompt, title)[source]
open_url(url)[source]
register()[source]
run_progress_dialog(task: Callable[[Callable[[int, int], bool]], None]) bool[source]
Parameters:

task (Callable[[Callable[[int, int], bool]], None]) –

Return type:

bool

show_graph_report(view, title, graph)[source]
show_html_report(view, title, contents, plaintext)[source]
show_markdown_report(view, title, contents, plaintext)[source]
show_message_box(title, text, buttons, icon)[source]
show_plain_text_report(view, title, contents)[source]
show_report_collection(title, reports)[source]

LabelField

class LabelField[source]

Bases: object

LabelField adds a text label to the display.

__init__(text: str)[source]
Parameters:

text (str) –

property text: str

MarkdownReport

class MarkdownReport[source]

Bases: object

__init__(title, contents, plaintext='', view=None)[source]
property contents
property plaintext
property title
property view

MultilineTextField

class MultilineTextField[source]

Bases: object

MultilineTextField add multi-line text string input field. Result is stored in self.result as a string. This option is not supported on the command-line.

__init__(prompt: str, default: str | None = None)[source]
Parameters:
  • prompt (str) –

  • default (str | None) –

property prompt
property result

OpenFileNameField

class OpenFileNameField[source]

Bases: object

OpenFileNameField prompts the user to specify a file name to open. Result is stored in self.result as a string.

__init__(prompt: str, ext: str = '', default: str | None = None)[source]
Parameters:
  • prompt (str) –

  • ext (str) –

  • default (str | None) –

property ext
property prompt
property result

PlainTextReport

class PlainTextReport[source]

Bases: object

__init__(title, contents, view=None)[source]
property contents
property title
property view

ReportCollection

class ReportCollection[source]

Bases: object

__init__(handle=None)[source]
append(report)[source]
update(i, report)[source]

SaveFileNameField

class SaveFileNameField[source]

Bases: object

SaveFileNameField prompts the user to specify a file name to save. Result is stored in self.result as a string.

__init__(prompt, ext='', default_name='', default=None)[source]
property default_name
property ext
property prompt
property result

SeparatorField

class SeparatorField[source]

Bases: object

SeparatorField adds vertical separation to the display.

TextLineField

class TextLineField[source]

Bases: object

TextLineField Adds prompt for text string input. Result is stored in self.result as a string on completion.

__init__(prompt: str, default: str | None = None)[source]
Parameters:
  • prompt (str) –

  • default (str | None) –

property prompt
property result