Binary Ninja

class cle.backends.binja.BinjaSymbol[source]

Bases: Symbol

BINJA_FUNC_SYM_TYPES = []
BINJA_DATA_SYM_TYPES = []
BINJA_IMPORT_TYPES = []
__init__(owner, sym)[source]

Not documenting this since if you try calling it, you’re wrong.

class cle.backends.binja.BinjaReloc[source]

Bases: Relocation

property value
class cle.backends.binja.BinjaBin[source]

Bases: Backend

Get information from binaries using Binary Ninja. Basing this on idabin.py, but will try to be more complete. TODO: add more features as Binary Ninja’s feature set improves

is_default = True
BINJA_ARCH_MAP = {'aarch64': <Arch AARCH64 (LE)>, 'armv7': <Arch ARMEL (LE)>, 'armv7eb': <Arch ARMEL (BE)>, 'mips32': <Arch MIPS32 (BE)>, 'mipsel32': <Arch MIPS32 (LE)>, 'ppc': <Arch PPC32 (BE)>, 'ppc_le': <Arch PPC32 (LE)>, 'thumb2': <Arch ARMEL (LE)>, 'thumb2eb': <Arch ARMEL (BE)>, 'x86': <Arch X86 (LE)>, 'x86_64': <Arch AMD64 (LE)>}
__init__(binary, *args, **kwargs)[source]
Parameters:
  • binary – The path to the binary to load

  • binary_stream – The open stream to this binary. The reference to this will be held until you call close.

  • is_main_bin – Whether this binary should be loaded as the main executable

static is_compatible(stream)[source]

Determine quickly whether this backend can load an object from this stream

in_which_segment(addr)[source]

Return the segment name at address addr.

get_symbol_addr(sym)[source]

Get the address of the symbol sym from IDA.

Returns:

An address.

function_name(addr)[source]

Return the function name at address addr.

property min_addr

this is probably not “right”)

Type:

Get the min address of the binary. (note

property max_addr

Get the max address of the binary.

property entry
get_strings()[source]

Extract strings from binary (Binary Ninja).

Returns:

An array of strings.

set_got_entry(name, newaddr)[source]

Resolve import name with address newaddr. That is, update the GOT entry for name with newaddr.

close()[source]

Release the BinaryView we created in __init__ :return: None