Helper method for converting between core.BNInstructionTextToken and InstructionTextToken lists
(tokens: List['InstructionTextToken'])
| 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 |
no test coverage detected