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:
-
DarkTheme– -
LightTheme– -
BinjaProvider–
Functions:
-
binja_config_changed– -
ensure_disabled– -
try_init_bn_rpc_client–Try to connect to the Binary Ninja RPC client.
-
enabledBinja–If we have a connection to binary ninja, call the function.
-
establish_connection–If we already had a connection, or succeed in creating a new one, return True.
-
withBinja–Try to connect to Binary Ninja before running the decorated function.
-
l2r– -
r2l– -
base– -
auto_update_pc– -
auto_update_bp– -
auto_clear_pc– -
navigate_to– -
bn_to_pygment_tok– -
bn_to_pygment_theme–
Attributes:
-
bn_rpc_host– -
bn_rpc_port– -
bn_timeout– -
bn_autosync– -
bn_il_level– -
P– -
T– -
K– -
themes– -
style–
bn_rpc_host module-attribute ¤
bn_rpc_port module-attribute ¤
bn_timeout module-attribute ¤
bn_autosync module-attribute ¤
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"],
)
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–
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–
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_versions– -
is_in_function– -
get_comment_lines– -
decompile– -
get_func_type– -
get_stack_var_name– -
disable–
try_init_bn_rpc_client ¤
Try to connect to the Binary Ninja RPC client.
If the connection succeeds, or we were already connected, return True. Otherwise, False.
An appropriate message will be also printed to the user.
enabledBinja ¤
If we have a connection to binary ninja, call the function.
Otherwise, return fallback. Thus, all functions decorated with this, that do not specify a fallback, must have "| None" in their return signature.
This will not try to open a connection if it doesn't already exist. No messages will be printed.
establish_connection ¤
If we already had a connection, or succeed in creating a new one, return True. Otherwise False.
withBinja ¤
Try to connect to Binary Ninja before running the decorated function.
If we fail connecting, return None. Thus, all functions decorated with this must have "| None" in their return signature.
Use this for user-initiated stuff like pwndbg.commands.binja.bn_sync().