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<
DisassemblyTextLine >
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())
std::vector<
DisassemblyTextLine >
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())
Public Member Functions inherited from
BinaryNinja::CoreRefCountObject< BNDataRenderer, BNNewDataRendererReference, BNFreeDataRenderer >
CoreRefCountObject ()
virtual
~CoreRefCountObject ()
BNDataRenderer *
GetObject () 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)