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

Method _get_core_struct

python/architecture.py:2889–2907  ·  view source on GitHub ↗

Helper method for converting between core.BNInstructionTextToken and InstructionTextToken lists

(tokens: List['InstructionTextToken'])

Source from the content-addressed store, hash-verified

2887
2888 @staticmethod
2889 def _get_core_struct(tokens: List['InstructionTextToken']) -> 'ctypes.Array[core.BNInstructionTextToken]':
2890 """ Helper method for converting between core.BNInstructionTextToken and InstructionTextToken lists """
2891 result = (core.BNInstructionTextToken * len(tokens))()
2892 for j in range(len(tokens)):
2893 result[j].type = tokens[j].type
2894 result[j].text = tokens[j].text
2895 result[j].width = tokens[j].width
2896 result[j].value = tokens[j].value
2897 result[j].size = tokens[j].size
2898 result[j].operand = tokens[j].operand
2899 result[j].context = tokens[j].context
2900 result[j].confidence = tokens[j].confidence
2901 result[j].address = tokens[j].address
2902 result[j].namesCount = len(tokens[j].typeNames)
2903 result[j].typeNames = (ctypes.c_char_p * len(tokens[j].typeNames))()
2904 result[j].exprIndex = tokens[j].il_expr_index
2905 for i in range(len(tokens[j].typeNames)):
2906 result[j].typeNames[i] = tokens[j].typeNames[i].encode("utf-8")
2907 return result
2908
2909 def __str__(self):
2910 return self.text

Callers 15

_get_type_tokensMethod · 0.80
appendMethod · 0.80
_function_type_tokensMethod · 0.80
_get_instruction_textMethod · 0.80
_to_core_structMethod · 0.80
_to_core_structMethod · 0.80
post_process_linesMethod · 0.80
add_integer_tokenMethod · 0.80
wrap_commentMethod · 0.80
_get_lines_for_dataMethod · 0.80

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected