Loading...
Searching...
No Matches
DataRenderer

Detailed Description

Classes

class  BinaryNinja::DataRenderer
 DataRenderer objects tell the Linear View how to render specific types. More...
 
class  BinaryNinja::DataRendererContainer
 Used for registering DataRenderers. More...
 

Class Documentation

◆ BinaryNinja::DataRenderer

class BinaryNinja::DataRenderer

DataRenderer objects tell the Linear View how to render specific types.

The `IsValidForData` method returns a boolean to indicate if your derived class is able to render the type, given the `addr` and `context`. The `context` is a list of Type objects which represents the chain of nested objects that is being displayed.

The `GetLinesForData` method returns a list of `DisassemblyTextLine` objects, each one representing a single line of Linear View output. The `prefix` variable is a list of `InstructionTextToken`'s which have already been generated by other `DataRenderer`'s.

After defining the `DataRenderer` subclass you must then register it with the core. This is done by calling either `DataRendererContainer::RegisterGenericDataRenderer()` or `DataRendererContainer::RegisterTypeSpecificDataRenderer()`. A "generic" type renderer is able to be overridden by a "type specific" renderer. For instance there is a generic struct render which renders any struct that hasn't been explicitly overridden by a "type specific" renderer.

Public Member Functions

 DataRenderer ()
 
 DataRenderer (BNDataRenderer *renderer)
 
virtual bool IsValidForData (BinaryView *data, uint64_t addr, Type *type, std::vector< std::pair< Type *, size_t > > &context)
 
virtual std::vector< DisassemblyTextLineGetLinesForData (BinaryView *data, uint64_t addr, Type *type, const std::vector< InstructionTextToken > &prefix, size_t width, std::vector< std::pair< Type *, size_t > > &context, const std::string &language=std::string())
 
std::vector< DisassemblyTextLineRenderLinesForData (BinaryView *data, uint64_t addr, Type *type, const std::vector< InstructionTextToken > &prefix, size_t width, std::vector< std::pair< Type *, size_t > > &context, const std::string &language=std::string())
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNDataRenderer, BNNewDataRendererReference, BNFreeDataRenderer >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNDataRendererGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Static Public Member Functions

static bool IsStructOfTypeName (Type *type, const QualifiedName &name, std::vector< std::pair< Type *, size_t > > &context)
 
static bool IsStructOfTypeName (Type *type, const std::string &name, std::vector< std::pair< Type *, size_t > > &context)
 
- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNDataRenderer, BNNewDataRendererReference, BNFreeDataRenderer >
static BNDataRendererGetObject (CoreRefCountObject *obj)
 
static BNDataRendererGetObject (const CoreRefCountObject *obj)
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNDataRenderer, BNNewDataRendererReference, BNFreeDataRenderer >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNDataRendererm_object
 

Constructor & Destructor Documentation

◆ DataRenderer() [1/2]

DataRenderer::DataRenderer ( )

◆ DataRenderer() [2/2]

DataRenderer::DataRenderer ( BNDataRenderer * renderer)

Member Function Documentation

◆ IsValidForData()

bool DataRenderer::IsValidForData ( BinaryView * data,
uint64_t addr,
Type * type,
std::vector< std::pair< Type *, size_t > > & context )
virtual

◆ GetLinesForData()

vector< DisassemblyTextLine > DataRenderer::GetLinesForData ( BinaryView * data,
uint64_t addr,
Type * type,
const std::vector< InstructionTextToken > & prefix,
size_t width,
std::vector< std::pair< Type *, size_t > > & context,
const std::string & language = std::string() )
virtual

◆ RenderLinesForData()

vector< DisassemblyTextLine > DataRenderer::RenderLinesForData ( BinaryView * data,
uint64_t addr,
Type * type,
const std::vector< InstructionTextToken > & prefix,
size_t width,
std::vector< std::pair< Type *, size_t > > & context,
const std::string & language = std::string() )

◆ IsStructOfTypeName() [1/2]

static bool BinaryNinja::DataRenderer::IsStructOfTypeName ( Type * type,
const QualifiedName & name,
std::vector< std::pair< Type *, size_t > > & context )
static

◆ IsStructOfTypeName() [2/2]

static bool BinaryNinja::DataRenderer::IsStructOfTypeName ( Type * type,
const std::string & name,
std::vector< std::pair< Type *, size_t > > & context )
static

◆ BinaryNinja::DataRendererContainer

class BinaryNinja::DataRendererContainer

Used for registering DataRenderers.

See also
DataRenderer

Static Public Member Functions

static void RegisterGenericDataRenderer (DataRenderer *renderer)
 
static void RegisterTypeSpecificDataRenderer (DataRenderer *renderer)
 

Member Function Documentation

◆ RegisterGenericDataRenderer()

void DataRendererContainer::RegisterGenericDataRenderer ( DataRenderer * renderer)
static

◆ RegisterTypeSpecificDataRenderer()

void DataRendererContainer::RegisterTypeSpecificDataRenderer ( DataRenderer * renderer)
static