MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / get_instruction_text

Method get_instruction_text

python/architecture.py:2386–2408  ·  view source on GitHub ↗

``get_instruction_text`` returns a list of InstructionTextToken objects for the instruction at the given virtual address ``addr`` with data ``data``. :param bytes data: a maximum of max_instruction_length bytes from the binary at virtual address ``addr`` :param int addr: virtual address of

(self, data: bytes, addr: int)

Source from the content-addressed store, hash-verified

2384 return result
2385
2386 def get_instruction_text(self, data: bytes, addr: int) -> Optional[Tuple[List['function.InstructionTextToken'], int]]:
2387 """
2388 ``get_instruction_text`` returns a list of InstructionTextToken objects for the instruction at the given virtual
2389 address ``addr`` with data ``data``.
2390
2391 :param bytes data: a maximum of max_instruction_length bytes from the binary at virtual address ``addr``
2392 :param int addr: virtual address of bytes in ``data``
2393 :return: an InstructionTextToken list for the current instruction
2394 :rtype: list(InstructionTextToken)
2395 """
2396 count = ctypes.c_ulonglong()
2397 length = ctypes.c_ulonglong()
2398 length.value = len(data)
2399 buf = (ctypes.c_ubyte * len(data))()
2400 ctypes.memmove(buf, data, len(data))
2401 tokens = ctypes.POINTER(core.BNInstructionTextToken)()
2402 result = []
2403 result_length = 0
2404 if core.BNGetInstructionText(self.handle, buf, addr, length, tokens, count):
2405 result = function.InstructionTextToken._from_core_struct(tokens, count.value)
2406 result_length = length.value
2407 core.BNFreeInstructionText(tokens, count.value)
2408 return result, result_length
2409
2410 def get_instruction_low_level_il(self, data: bytes, addr: int, il: lowlevelil.LowLevelILFunction) -> Optional[int]:
2411 """

Callers

nothing calls this directly

Calls 1

_from_core_structMethod · 0.45

Tested by

no test coverage detected