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

Method _apply_to_linear_view_object

python/renderlayer.py:122–144  ·  view source on GitHub ↗
(self, ctxt, obj, prev, next, in_lines, in_line_count, out_lines, out_line_count)

Source from the content-addressed store, hash-verified

120 log_error(traceback.format_exc())
121
122 def _apply_to_linear_view_object(self, ctxt, obj, prev, next, in_lines, in_line_count, out_lines, out_line_count):
123 try:
124 obj_obj = binaryninja.LinearViewObject(core.BNNewLinearViewObjectReference(obj))
125 prev_obj = binaryninja.LinearViewObject(core.BNNewLinearViewObjectReference(prev)) if prev else None
126 next_obj = binaryninja.LinearViewObject(core.BNNewLinearViewObjectReference(next)) if next else None
127
128 lines = []
129 for i in range(in_line_count):
130 lines.append(LinearDisassemblyLine._from_core_struct(in_lines[i], obj=obj_obj))
131
132 lines = self.apply_to_linear_view_object(obj_obj, prev_obj, next_obj, lines)
133
134 out_line_count[0] = len(lines)
135 out_lines_buf = (core.BNLinearDisassemblyLine * len(lines))()
136 for i, r in enumerate(lines):
137 out_lines_buf[i] = r._to_core_struct()
138 out_lines_ptr = ctypes.cast(out_lines_buf, ctypes.c_void_p)
139 out_lines[0] = out_lines_buf
140 self._pending_lines[out_lines_ptr.value] = (out_lines_ptr.value, out_lines_buf)
141 except:
142 log_error(traceback.format_exc())
143 out_lines[0] = None
144 out_line_count[0] = 0
145
146 def _free_lines(self, ctxt, lines, count):
147 try:

Callers

nothing calls this directly

Calls 6

log_errorFunction · 0.85
LinearViewObjectMethod · 0.80
appendMethod · 0.45
_from_core_structMethod · 0.45
_to_core_structMethod · 0.45

Tested by

no test coverage detected