Binary Ninja API C++: BinaryNinja::RenderLayer Class Reference
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. More...
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.
Public Member Functions | |
| std::string | GetName () const |
| Get the name of a Render Layer. | |
| BNRenderLayerDefaultEnableState | GetDefaultEnableState () const |
| Get whether the Render Layer is enabled by default. | |
| virtual void | ApplyToDisassemblyBlock (Ref< BasicBlock > block, std::vector< DisassemblyTextLine > &lines) |
| Apply this Render Layer to a single Basic Block of Disassembly lines. | |
| virtual void | ApplyToLowLevelILBlock (Ref< BasicBlock > block, std::vector< DisassemblyTextLine > &lines) |
| Apply this Render Layer to a single Basic Block of Low Level IL lines. | |
| virtual void | ApplyToMediumLevelILBlock (Ref< BasicBlock > block, std::vector< DisassemblyTextLine > &lines) |
| Apply this Render Layer to a single Basic Block of Medium Level IL lines. | |
| virtual void | ApplyToHighLevelILBlock (Ref< BasicBlock > block, std::vector< DisassemblyTextLine > &lines) |
| Apply this Render Layer to a single Basic Block of High Level IL lines. | |
| virtual void | ApplyToHighLevelILBody (Ref< Function > function, std::vector< LinearDisassemblyLine > &lines) |
| Apply this Render Layer to the entire body of a High Level IL function. | |
| virtual void | ApplyToMiscLinearLines (Ref< LinearViewObject > obj, Ref< LinearViewObject > prev, Ref< LinearViewObject > next, std::vector< LinearDisassemblyLine > &lines) |
| Apply to lines generated by Linear View that are not part of a function. | |
| virtual void | ApplyToBlock (Ref< BasicBlock > block, std::vector< DisassemblyTextLine > &lines) |
| Apply to lines generated by a Basic Block, of any type. | |
| virtual void | ApplyToFlowGraph (Ref< FlowGraph > graph) |
| Apply this Render Layer to a Flow Graph, potentially modifying its nodes, their edges, their lines, and their lines' content. | |
| virtual void | ApplyToLinearViewObject (Ref< LinearViewObject > obj, Ref< LinearViewObject > prev, Ref< LinearViewObject > next, std::vector< LinearDisassemblyLine > &lines) |
| Apply this Render Layer to the lines produced by a LinearViewObject for rendering in Linear View, potentially modifying the lines and their contents. | |
| Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNRenderLayer > | |
| StaticCoreRefCountObject () | |
| virtual | ~StaticCoreRefCountObject () |
| BNRenderLayer * | GetObject () const |
| void | AddRef () |
| void | Release () |
| void | AddRefForRegistration () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Static Public Member Functions | |
| static void | Register (RenderLayer *layer, BNRenderLayerDefaultEnableState enableState=DisabledByDefaultRenderLayerDefaultEnableState) |
| Register a custom Render Layer. | |
| static std::vector< Ref< RenderLayer > > | GetList () |
| Get the list of all currently registered Render Layers. | |
| static Ref< RenderLayer > | GetByName (const std::string &name) |
| Look up a Render Layer by its name. | |
Protected Member Functions | |
| RenderLayer (const std::string &name) | |
| RenderLayer (BNRenderLayer *layer) | |
| virtual | ~RenderLayer ()=default |
Static Protected Member Functions | |
| static void | ApplyToFlowGraphCallback (void *ctxt, BNFlowGraph *graph) |
| static void | ApplyToLinearViewObjectCallback (void *ctxt, BNLinearViewObject *obj, BNLinearViewObject *prev, BNLinearViewObject *next, BNLinearDisassemblyLine *inLines, size_t inLineCount, BNLinearDisassemblyLine **outLines, size_t *outLineCount) |
| static void | FreeLinesCallback (void *ctxt, BNLinearDisassemblyLine *lines, size_t count) |
|
explicitprotected |
◆ RenderLayer() [2/2]
◆ ~RenderLayer()
|
protectedvirtualdefault |
◆ ApplyToFlowGraphCallback()
|
staticprotected |
◆ ApplyToLinearViewObjectCallback()
◆ FreeLinesCallback()
◆ Register()
Register a custom Render Layer.
Specify enableState to change whether the layer is enabled by default in the UI. If it is set to AlwaysEnabled, the Render Layer will always be enabled and will not be displayed in the UI.
- Parameters
-
layer Render Layer to register enableState Whether the layer should be enabled by default
◆ GetList()
|
static |
Get the list of all currently registered Render Layers.
- Returns
- List of Render Layers
◆ GetByName()
|
static |
Look up a Render Layer by its name.
- Parameters
- Returns
- Render Layer, if it exists. Otherwise, nullptr.
◆ GetName()
| std::string RenderLayer::GetName | ( | ) | const |
Get the name of a Render Layer.
- Returns
- Render Layer's name
◆ GetDefaultEnableState()
Get whether the Render Layer is enabled by default.
- Returns
- Default enable state
◆ ApplyToDisassemblyBlock()
Apply this Render Layer to a single Basic Block of Disassembly lines.
Subclasses should modify the input `lines` list to make modifications to the presentation of the block.
- Note
- This function will only handle Disassembly lines, and not any ILs.
- Parameters
-
block Basic Block containing those lines lines Lines of text for the block, to be modified by this function
◆ ApplyToLowLevelILBlock()
Apply this Render Layer to a single Basic Block of Low Level IL lines.
Subclasses should modify the input `lines` list to make modifications to the presentation of the block.
- 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
-
block Basic Block containing those lines lines Lines of text for the block, to be modified by this function
◆ ApplyToMediumLevelILBlock()
Apply this Render Layer to a single Basic Block of Medium Level IL lines.
Subclasses should modify the input `lines` list to make modifications to the presentation of the block.
- 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
-
block Basic Block containing those lines lines Lines of text for the block, to be modified by this function
◆ ApplyToHighLevelILBlock()
Apply this Render Layer to a single Basic Block of High Level IL lines.
Subclasses should modify the input `lines` list to make modifications to the presentation of the block.
- 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 `ApplyToHighLevelILBody` instead as they do not have a Basic Block associated with them.
- Parameters
-
block Basic Block containing those lines lines Lines of text for the block, to be modified by this function
◆ ApplyToHighLevelILBody()
Apply this Render Layer to the entire body of a High Level IL function.
Subclasses should modify the input `lines` list to make modifications to the presentation of the function.
- 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 `ApplyToHighLevelILBlock` and handle the lines one block at a time.
- Parameters
-
function Function containing those lines lines Lines of text for the function, to be modified by this function
◆ ApplyToMiscLinearLines()
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.
◆ ApplyToBlock()
Apply to lines generated by a Basic Block, of any type.
If not overridden, this function will call the appropriate ApplyToXLevelILBlock function.
- Parameters
-
block Basic Block containing those lines lines Lines of text for the block, to be modified by this function
◆ ApplyToFlowGraph()
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 parent implementation if you want to use the higher level ApplyToXLevelILBlock functionality.
- Parameters
Reimplemented in BinaryNinja::CoreRenderLayer.
◆ ApplyToLinearViewObject()
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 parent implementation if you want to use the higher level ApplyToXLevelILBlock functionality.
- Parameters
-
obj Linear View Object being rendered prev Linear View Object located directly above this one next Linear View Object located directly below this one lines Lines originally rendered by the Linear View Object
- Returns
- Updated set of lines to display in Linear View
Reimplemented in BinaryNinja::CoreRenderLayer.