Binary Ninja API C++: BinaryNinja::ConstantRenderer Class Reference
ConstantRenderer allows custom rendering of constants in high level representations.
More...
ConstantRenderer allows custom rendering of constants in high level representations.
Public Member Functions | |
| ConstantRenderer (const std::string &name) | |
| ConstantRenderer (BNConstantRenderer *renderer) | |
| std::string | GetName () const |
| virtual bool | IsValidForType (HighLevelILFunction *func, Type *type) |
| Determines if the rendering methods should be called for the given expression type. | |
| virtual bool | RenderConstant (const HighLevelILInstruction &instr, Type *type, int64_t val, HighLevelILTokenEmitter &tokens, DisassemblySettings *settings, BNOperatorPrecedence precedence) |
| Can be overridden to render a constant that is not a pointer. | |
| virtual bool | RenderConstantPointer (const HighLevelILInstruction &instr, Type *type, int64_t val, HighLevelILTokenEmitter &tokens, DisassemblySettings *settings, BNSymbolDisplayType symbolDisplay, BNOperatorPrecedence precedence) |
| Can be overridden to render a constant pointer. | |
| Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNConstantRenderer > | |
| StaticCoreRefCountObject () | |
| virtual | ~StaticCoreRefCountObject () |
| BNConstantRenderer * | GetObject () const |
| void | AddRef () |
| void | Release () |
| void | AddRefForRegistration () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Static Public Member Functions | |
| static void | Register (ConstantRenderer *renderer) |
| Registers the constant renderer. | |
| static Ref< ConstantRenderer > | GetByName (const std::string &name) |
| static std::vector< Ref< ConstantRenderer > > | GetRenderers () |
| ConstantRenderer::ConstantRenderer | ( | const std::string & | name | ) |
◆ ConstantRenderer() [2/2]
◆ GetName()
| string ConstantRenderer::GetName | ( | ) | const |
◆ IsValidForType()
Determines if the rendering methods should be called for the given expression type.
It is optional to override this method. If the method isn't overridden, all expression types are passed to the rendering methods.
- Parameters
- Returns
trueif the constant should be passed to the rendering methods,falseotherwise
Reimplemented in BinaryNinja::CoreConstantRenderer.
◆ RenderConstant()
Can be overridden to render a constant that is not a pointer.
The expression type and value of the expression are given. If the expression is not handled by this constant renderer, this method should return false
To render a constant, emit the tokens to the tokens object and return true
- Parameters
-
instr High level expression type Type of the expression val Value of the expression tokens Token emitter for adding the rendered tokens settings Settings for rendering precedence Operator precedence of the expression
- Returns
trueif the constant was rendered,falseotherwise
Reimplemented in BinaryNinja::CoreConstantRenderer.
◆ RenderConstantPointer()
Can be overridden to render a constant pointer.
The expression type and value of the expression are given. If the expression is not handled by this constant renderer, this method should return false
To render a constant, emit the tokens to the tokens object and return true
- Parameters
-
instr High level expression type Type of the expression val Value of the expression tokens Token emitter for adding the rendered tokens settings Settings for rendering precedence Operator precedence of the expression
- Returns
trueif the constant was rendered,falseotherwise
Reimplemented in BinaryNinja::CoreConstantRenderer.
◆ Register()
|
static |
Registers the constant renderer.
- Parameters
-
renderer The constant renderer to register.
◆ GetByName()
|
static |
◆ GetRenderers()
|
static |