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.

K = TypeVar('K') module-attribute

P = ParamSpec('P') module-attribute

T = TypeVar('T') module-attribute

bn_autosync = pwndbg.config.add_param('bn-autosync', False, 'whether to automatically run bn-sync every step') module-attribute

bn_il_level = pwndbg.config.add_param('bn-il-level', 'hlil', 'the IL level to use when displaying Binary Ninja decompilation', param_class=pwndbg.lib.config.PARAM_ENUM, enum_sequence=['disasm', 'llil', 'mlil', 'hlil']) module-attribute

bn_rpc_host = pwndbg.config.add_param('bn-rpc-host', '127.0.0.1', 'Binary Ninja XML-RPC server host') module-attribute

bn_rpc_port = pwndbg.config.add_param('bn-rpc-port', 31337, 'Binary Ninja XML-RPC server port') module-attribute

bn_timeout = pwndbg.config.add_param('bn-timeout', 2, 'time to wait for Binary Ninja XML-RPC, in seconds') module-attribute

style = theme.add_param('bn-decomp-style', 'dark', f'Decompilation highlight theme for Binary Ninja (valid values are {', '.join(themes.keys())})') module-attribute

themes = {} module-attribute

BinjaProvider

Bases: IntegrationProvider

decompile(addr, lines)

get_comment_lines(addr)

get_func_type(addr)

get_stack_var_name(addr)

get_symbol(addr)

get_versions()

is_in_function(addr)

DarkTheme

Bases: Style

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'}) class-attribute instance-attribute

LightTheme

Bases: Style

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'}) class-attribute instance-attribute

auto_clear_pc()

auto_update_bp()

auto_update_pc()

available()

base()

bn_to_pygment_theme(theme)

bn_to_pygment_tok(tok)

can_connect()

init_bn_rpc_client()

l2r(addr)

navigate_to(addr)

r2l(addr)

with_bn(fallback=None)