@@ -64,7 +64,14 @@ class RenderLayer(metaclass=_RenderLayerMetaclass):
64
64
"""
65
65
66
66
name = None
67
+ """Name of the Render Layer, to be displayed in the UI."""
68
+
67
69
default_enable_state = RenderLayerDefaultEnableState .DisabledByDefaultRenderLayerDefaultEnableState
70
+ """
71
+ Whether the Render Layer is enabled by default in the UI. If set to AlwaysEnabled,
72
+ the Render Layer will always be enabled and will not be displayed in the UI.
73
+ """
74
+
68
75
_registered_instances = {}
69
76
_pending_lines = {}
70
77
@@ -150,11 +157,10 @@ def apply_to_disassembly_block(
150
157
self ,
151
158
block : 'binaryninja.BasicBlock' ,
152
159
lines : List ['binaryninja.DisassemblyTextLine' ]
153
- ):
160
+ ) -> List [ 'binaryninja.DisassemblyTextLine' ] :
154
161
"""
155
162
Apply this Render Layer to a single Basic Block of Disassembly lines.
156
- Subclasses should modify the input `lines` list to make modifications to
157
- the presentation of the block.
163
+ Subclasses should return a modified list of lines to be rendered in the UI.
158
164
159
165
.. note:: This function will only handle Disassembly lines, and not any ILs.
160
166
@@ -168,14 +174,13 @@ def apply_to_low_level_il_block(
168
174
self ,
169
175
block : 'binaryninja.LowLevelILBasicBlock' ,
170
176
lines : List ['binaryninja.DisassemblyTextLine' ]
171
- ):
177
+ ) -> List [ 'binaryninja.DisassemblyTextLine' ] :
172
178
"""
173
179
Apply this Render Layer to a single Basic Block of Low Level IL lines.
174
- Subclasses should modify the input `lines` list to make modifications to
175
- the presentation of the block.
180
+ Subclasses should return a modified list of lines to be rendered in the UI.
176
181
177
182
.. note:: This function will only handle Lifted IL/LLIL/LLIL(SSA) lines. \
178
- You can use the block's `function_graph_type` property to determine which is being handled.
183
+ You can use the block's `` function_graph_type` ` property to determine which is being handled.
179
184
180
185
:param block: Basic Block containing those lines
181
186
:param lines: Original lines of text for the block
@@ -187,14 +192,13 @@ def apply_to_medium_level_il_block(
187
192
self ,
188
193
block : 'binaryninja.MediumLevelILBasicBlock' ,
189
194
lines : List ['binaryninja.DisassemblyTextLine' ]
190
- ):
195
+ ) -> List [ 'binaryninja.DisassemblyTextLine' ] :
191
196
"""
192
197
Apply this Render Layer to a single Basic Block of Medium Level IL lines.
193
- Subclasses should modify the input `lines` list to make modifications to
194
- the presentation of the block.
198
+ Subclasses should return a modified list of lines to be rendered in the UI.
195
199
196
200
.. note:: This function will only handle MLIL/MLIL(SSA)/Mapped MLIL/Mapped MLIL(SSA) lines. \
197
- You can use the block's `function_graph_type` property to determine which is being handled.
201
+ You can use the block's `` function_graph_type` ` property to determine which is being handled.
198
202
199
203
:param block: Basic Block containing those lines
200
204
:param lines: Original lines of text for the block
@@ -206,17 +210,16 @@ def apply_to_high_level_il_block(
206
210
self ,
207
211
block : 'binaryninja.HighLevelILBasicBlock' ,
208
212
lines : List ['binaryninja.DisassemblyTextLine' ]
209
- ):
213
+ ) -> List [ 'binaryninja.DisassemblyTextLine' ] :
210
214
"""
211
215
Apply this Render Layer to a single Basic Block of High Level IL lines.
212
- Subclasses should modify the input `lines` list to make modifications to
213
- the presentation of the block.
216
+ Subclasses should return a modified list of lines to be rendered in the UI.
214
217
215
218
.. note:: This function will only handle HLIL/HLIL(SSA)/Language Representation lines. \
216
- You can use the block's `function_graph_type` property to determine which is being handled.
219
+ You can use the block's `` function_graph_type` ` property to determine which is being handled.
217
220
218
221
.. warning:: This function will NOT apply to High Level IL bodies as displayed \
219
- in Linear View! Those are handled by `apply_to_high_level_il_body` instead as they \
222
+ in Linear View! Those are handled by `` apply_to_high_level_il_body` ` instead as they \
220
223
do not have a Basic Block associated with them.
221
224
222
225
:param block: Basic Block containing those lines
@@ -229,14 +232,13 @@ def apply_to_high_level_il_body(
229
232
self ,
230
233
function : 'binaryninja.Function' ,
231
234
lines : List ['binaryninja.LinearDisassemblyLine' ]
232
- ):
235
+ ) -> List [ 'binaryninja.LinearDisassemblyLine' ] :
233
236
"""
234
237
Apply this Render Layer to the entire body of a High Level IL function.
235
- Subclasses should modify the input `lines` list to make modifications to
236
- the presentation of the function.
238
+ Subclasses should return a modified list of lines to be rendered in the UI.
237
239
238
240
.. warning:: This function only applies to Linear View, and not to Graph View! \
239
- If you want to handle Graph View too, you will need to use `apply_to_high_level_il_block` \
241
+ If you want to handle Graph View too, you will need to use `` apply_to_high_level_il_block` ` \
240
242
and handle the lines one block at a time.
241
243
242
244
:param function: Function containing those lines
@@ -251,11 +253,12 @@ def apply_to_misc_linear_lines(
251
253
prev : Optional ['binaryninja.LinearViewObject' ],
252
254
next : Optional ['binaryninja.LinearViewObject' ],
253
255
lines : List ['binaryninja.LinearDisassemblyLine' ]
254
- ):
256
+ ) -> List [ 'binaryninja.DisassemblyTextLine' ] :
255
257
"""
256
258
Apply to lines generated by Linear View that are not part of a function.
257
259
It is up to your implementation to figure out which type of Linear View Object
258
260
lines these are, and what to do with them.
261
+ Subclasses should return a modified list of lines to be rendered in the UI.
259
262
260
263
:param obj: Linear View Object being rendered
261
264
:param prev: Linear View Object located directly above this one
@@ -269,10 +272,11 @@ def apply_to_block(
269
272
self ,
270
273
block : 'binaryninja.BasicBlock' ,
271
274
lines : List ['binaryninja.DisassemblyTextLine' ],
272
- ):
275
+ ) -> List [ 'binaryninja.DisassemblyTextLine' ] :
273
276
"""
274
277
Apply to lines generated by a Basic Block, of any type. If not overridden, this
275
- function will call the appropriate apply_to_X_level_il_block function.
278
+ function will call the appropriate ``apply_to_X_level_il_block`` function.
279
+ Subclasses should return a modified list of lines to be rendered in the UI.
276
280
277
281
:param block: Basic Block containing those lines
278
282
:param lines: Original lines of text for the block
0 commit comments