Skip to content

binja ¤

Talks to an XMLRPC server running inside of an active Binary Ninja instance, in order to query it about the database. Allows symbol resolution and interactive debugging.

Classes:

Functions:

Attributes:

bn_rpc_host module-attribute ¤

bn_rpc_host = add_param(
    "bn-rpc-host", "127.0.0.1", "Binary Ninja XML-RPC server host"
)

bn_rpc_port module-attribute ¤

bn_rpc_port = add_param(
    "bn-rpc-port", 31337, "Binary Ninja XML-RPC server port"
)

bn_timeout module-attribute ¤

bn_timeout = add_param(
    "bn-timeout", 2, "time to wait for Binary Ninja XML-RPC, in seconds"
)

bn_autosync module-attribute ¤

bn_autosync = add_param(
    "bn-autosync", False, "whether to automatically run bn-sync every step"
)

bn_il_level module-attribute ¤

bn_il_level = add_param(
    "bn-il-level",
    "hlil",
    "the IL level to use when displaying Binary Ninja decompilation",
    param_class=PARAM_ENUM,
    enum_sequence=["disasm", "llil", "mlil", "hlil"],
)

P module-attribute ¤

P = ParamSpec('P')

T module-attribute ¤

T = TypeVar('T')

K module-attribute ¤

K = TypeVar('K')

themes module-attribute ¤

themes = {}

style module-attribute ¤

style = add_param(
    "bn-decomp-style",
    "dark",
    "decompilation highlight theme for Binary Ninja",
    param_class=PARAM_ENUM,
    enum_sequence=list(keys()),
)

DarkTheme ¤

Bases: Style

Attributes:

styles class-attribute instance-attribute ¤

styles = bn_to_pygment_theme(
    {
        "TextToken": "#e0e0e0",
        "InstructionToken": "#eddfb3",
        "OperandSeparatorToken": "#e0e0e0",
        "RegisterToken": "#e0e0e0",
        "IntegerToken": "#a2d9af",
        "PossibleAddressToken": "#a2d9af",
        "BeginMemoryOperandToken": "#e0e0e0",
        "EndMemoryOperandToken": "#e0e0e0",
        "FloatingPointToken": "#a2d9af",
        "AnnotationToken": "#dac4d1",
        "CodeRelativeAddressToken": "#a2d9af",
        "ArgumentNameToken": "#e0e0e0",
        "HexDumpByteValueToken": "#e0e0e0",
        "HexDumpSkippedByteToken": "#e0e0e0",
        "HexDumpInvalidByteToken": "#909090",
        "HexDumpTextToken": "#e0e0e0",
        "OpcodeToken": "#909090",
        "StringToken": "#dac4d1",
        "CharacterConstantToken": "#dac4d1",
        "KeywordToken": "#eddfb3",
        "TypeNameToken": "#edbd81",
        "FieldNameToken": "#b0dde4",
        "NameSpaceToken": "#80c6e9",
        "NameSpaceSeparatorToken": "#80c6e9",
        "TagToken": "#e0e0e0",
        "StructOffsetToken": "#b0dde4",
        "StructOffsetByteValueToken": "#e0e0e0",
        "StructureHexDumpTextToken": "#e0e0e0",
        "GotoLabelToken": "#80c6e9",
        "CommentToken": "#dac4d1",
        "PossibleValueToken": "#e0e0e0",
        "PossibleValueTypeToken": "#e0e0e0",
        "ArrayIndexToken": "#a2d9af",
        "IndentationToken": "#5d5d5d",
        "UnknownMemoryToken": "#909090",
        "EnumerationMemberToken": "#eddfb3",
        "OperationToken": "#89a4b1",
        "BaseStructureNameToken": "#dac4d1",
        "BaseStructureSeparatorToken": "#dac4d1",
        "BraceToken": "#e0e0e0",
        "CodeSymbolToken": "#80c6e9",
        "DataSymbolToken": "#8ee6ed",
        "LocalVariableToken": "#e0e0e0",
        "ImportToken": "#edbd81",
        "AddressDisplayToken": "#a2d9af",
        "IndirectImportToken": "#edbd81",
        "ExternalSymbolToken": "#edbd81",
        "StackVariableToken": "#c1dcc7",
        "AddressSeparatorToken": "#e0e0e0",
    }
)

LightTheme ¤

Bases: Style

Attributes:

styles class-attribute instance-attribute ¤

styles = bn_to_pygment_theme(
    {
        "TextToken": "#1f1f1f",
        "InstructionToken": "#8d8d2d",
        "OperandSeparatorToken": "#1f1f1f",
        "RegisterToken": "#1f1f1f",
        "IntegerToken": "#30820d",
        "PossibleAddressToken": "#30820d",
        "BeginMemoryOperandToken": "#1f1f1f",
        "EndMemoryOperandToken": "#1f1f1f",
        "FloatingPointToken": "#30820d",
        "AnnotationToken": "#bf2624",
        "CodeRelativeAddressToken": "#30820d",
        "ArgumentNameToken": "#1f1f1f",
        "HexDumpByteValueToken": "#1f1f1f",
        "HexDumpSkippedByteToken": "#1f1f1f",
        "HexDumpInvalidByteToken": "#7a7a7a",
        "HexDumpTextToken": "#1f1f1f",
        "OpcodeToken": "#7a7a7a",
        "StringToken": "#203635",
        "CharacterConstantToken": "#203635",
        "KeywordToken": "#8d8d2d",
        "TypeNameToken": "#e07c35",
        "FieldNameToken": "#35dae0",
        "NameSpaceToken": "#00a4c7",
        "NameSpaceSeparatorToken": "#00a4c7",
        "TagToken": "#1f1f1f",
        "StructOffsetToken": "#35dae0",
        "StructOffsetByteValueToken": "#1f1f1f",
        "StructureHexDumpTextToken": "#1f1f1f",
        "GotoLabelToken": "#00a4c7",
        "CommentToken": "#bf2624",
        "PossibleValueToken": "#1f1f1f",
        "PossibleValueTypeToken": "#1f1f1f",
        "ArrayIndexToken": "#30820d",
        "IndentationToken": "#bcbcbc",
        "UnknownMemoryToken": "#7a7a7a",
        "EnumerationMemberToken": "#8d8d2d",
        "OperationToken": "#5b848d",
        "BaseStructureNameToken": "#bf2624",
        "BaseStructureSeparatorToken": "#bf2624",
        "BraceToken": "#1f1f1f",
        "CodeSymbolToken": "#00a4c7",
        "DataSymbolToken": "#278cad",
        "LocalVariableToken": "#1f1f1f",
        "ImportToken": "#e07c35",
        "AddressDisplayToken": "#30820d",
        "IndirectImportToken": "#e07c35",
        "ExternalSymbolToken": "#e07c35",
        "StackVariableToken": "#275016",
        "AddressSeparatorToken": "#1f1f1f",
    }
)

BinjaProvider ¤

Bases: IntegrationProvider

Methods:

get_symbol ¤

get_symbol(addr: int) -> str | None

get_versions ¤

get_versions() -> tuple[str, ...]

is_in_function ¤

is_in_function(addr: int) -> bool

get_comment_lines ¤

get_comment_lines(addr: int) -> list[str]

decompile ¤

decompile(addr: int, lines: int) -> list[str] | None

get_func_type ¤

get_func_type(addr: int) -> Function | None

get_stack_var_name ¤

get_stack_var_name(addr: int) -> str | None

init_bn_rpc_client ¤

init_bn_rpc_client() -> None

with_bn ¤

with_bn(
    fallback: K = None,
) -> Callable[[Callable[P, T]], Callable[P, T | K]]

available ¤

available() -> bool

can_connect ¤

can_connect() -> bool

l2r ¤

l2r(addr: int) -> int

r2l ¤

r2l(addr: int) -> int

base ¤

base()

auto_update_pc ¤

auto_update_pc() -> None

auto_update_bp ¤

auto_update_bp() -> None

auto_clear_pc ¤

auto_clear_pc() -> None

navigate_to ¤

navigate_to(addr: int) -> None

bn_to_pygment_tok ¤

bn_to_pygment_tok(tok: str) -> Any

bn_to_pygment_theme ¤

bn_to_pygment_theme(theme: dict[str, str]) -> dict[Any, str]