renderlayer module

binaryninja.renderlayer.CoreRenderLayer([handle])

binaryninja.renderlayer.RenderLayer([handle])

RenderLayer is a plugin class that allows you to customize the presentation of Linear and Graph view output, adding, changing, or removing lines before they are presented in the UI.

class CoreRenderLayer(handle=None)[source]

Bases: RenderLayer

apply_to_flow_graph(graph: FlowGraph) None[source]

Apply this Render Layer to a Flow Graph, potentially modifying its nodes, their edges, their lines, and their lines’ content.

Note

If you override this function, you will need to call the super() implementation if you want to use the higher level apply_to_X_level_il_block functionality.

Parameters:

graph (FlowGraph) – Graph to modify

Return type:

None

apply_to_linear_view_object(obj: LinearViewObject, prev: LinearViewObject | None, next: LinearViewObject | None, lines: List[LinearDisassemblyLine]) List[LinearDisassemblyLine][source]

Apply this Render Layer to the lines produced by a LinearViewObject for rendering in Linear View, potentially modifying the lines and their contents.

Note

If you override this function, you will need to call the super() implementation if you want to use the higher level apply_to_X_level_il_block functionality.

Parameters:
Returns:

Modified list of lines to display in Linear View

Return type:

List[LinearDisassemblyLine]

class RenderLayer(handle=None)[source]

Bases: object

RenderLayer is a plugin class that allows you to customize the presentation of Linear and Graph view output, adding, changing, or removing lines before they are presented in the UI.

apply_to_block(block: BasicBlock, lines: List[DisassemblyTextLine]) List[DisassemblyTextLine][source]

Apply to lines generated by a Basic Block, of any type. If not overridden, this function will call the appropriate apply_to_X_level_il_block function. Subclasses should return a modified list of lines to be rendered in the UI.

Parameters:
Returns:

Modified list of lines

Return type:

List[DisassemblyTextLine]

apply_to_disassembly_block(block: BasicBlock, lines: List[DisassemblyTextLine]) List[DisassemblyTextLine][source]

Apply this Render Layer to a single Basic Block of Disassembly lines. Subclasses should return a modified list of lines to be rendered in the UI.

Note

This function will only handle Disassembly lines, and not any ILs.

Parameters:
Returns:

Modified list of lines

Return type:

List[DisassemblyTextLine]

apply_to_flow_graph(graph: FlowGraph) None[source]

Apply this Render Layer to a Flow Graph, potentially modifying its nodes, their edges, their lines, and their lines’ content.

Note

If you override this function, you will need to call the super() implementation if you want to use the higher level apply_to_X_level_il_block functionality.

Parameters:

graph (FlowGraph) – Graph to modify

Return type:

None

apply_to_high_level_il_block(block: HighLevelILBasicBlock, lines: List[DisassemblyTextLine]) List[DisassemblyTextLine][source]

Apply this Render Layer to a single Basic Block of High Level IL lines. Subclasses should return a modified list of lines to be rendered in the UI.

Note

This function will only handle HLIL/HLIL(SSA)/Language Representation lines. You can use the block’s function_graph_type property to determine which is being handled.

Warning

This function will NOT apply to High Level IL bodies as displayed in Linear View! Those are handled by apply_to_high_level_il_body instead as they do not have a Basic Block associated with them.

Parameters:
Returns:

Modified list of lines

Return type:

List[DisassemblyTextLine]

apply_to_high_level_il_body(function: Function, lines: List[LinearDisassemblyLine]) List[LinearDisassemblyLine][source]

Apply this Render Layer to the entire body of a High Level IL function. Subclasses should return a modified list of lines to be rendered in the UI.

Warning

This function only applies to Linear View, and not to Graph View! If you want to handle Graph View too, you will need to use apply_to_high_level_il_block and handle the lines one block at a time.

Parameters:
Returns:

Modified list of lines

Return type:

List[LinearDisassemblyLine]

apply_to_linear_view_object(obj: LinearViewObject, prev: LinearViewObject | None, next: LinearViewObject | None, lines: List[LinearDisassemblyLine]) List[LinearDisassemblyLine][source]

Apply this Render Layer to the lines produced by a LinearViewObject for rendering in Linear View, potentially modifying the lines and their contents.

Note

If you override this function, you will need to call the super() implementation if you want to use the higher level apply_to_X_level_il_block functionality.

Parameters:
Returns:

Modified list of lines to display in Linear View

Return type:

List[LinearDisassemblyLine]

apply_to_low_level_il_block(block: LowLevelILBasicBlock, lines: List[DisassemblyTextLine]) List[DisassemblyTextLine][source]

Apply this Render Layer to a single Basic Block of Low Level IL lines. Subclasses should return a modified list of lines to be rendered in the UI.

Note

This function will only handle Lifted IL/LLIL/LLIL(SSA) lines. You can use the block’s function_graph_type property to determine which is being handled.

Parameters:
Returns:

Modified list of lines

Return type:

List[DisassemblyTextLine]

apply_to_medium_level_il_block(block: MediumLevelILBasicBlock, lines: List[DisassemblyTextLine]) List[DisassemblyTextLine][source]

Apply this Render Layer to a single Basic Block of Medium Level IL lines. Subclasses should return a modified list of lines to be rendered in the UI.

Note

This function will only handle MLIL/MLIL(SSA)/Mapped MLIL/Mapped MLIL(SSA) lines. You can use the block’s function_graph_type property to determine which is being handled.

Parameters:
Returns:

Modified list of lines

Return type:

List[DisassemblyTextLine]

apply_to_misc_linear_lines(obj: LinearViewObject, prev: LinearViewObject | None, next: LinearViewObject | None, lines: List[LinearDisassemblyLine]) List[DisassemblyTextLine][source]

Apply to lines generated by Linear View that are not part of a function. It is up to your implementation to figure out which type of Linear View Object lines these are, and what to do with them. Subclasses should return a modified list of lines to be rendered in the UI.

Parameters:
Returns:

Modified list of lines

Return type:

List[DisassemblyTextLine]

classmethod register()[source]

Register a custom Render Layer.

default_enable_state = 0

Whether the Render Layer is enabled by default in the UI. If set to AlwaysEnabled, the Render Layer will always be enabled and will not be displayed in the UI.

name = None

Name of the Render Layer, to be displayed in the UI.