BinaryNinja::Type Class Reference

Public Member Functions

 Type (BNType *type)
 
bool operator== (const Type &other)
 
bool operator!= (const Type &other)
 
BNTypeClass GetClass () const
 
uint64_t GetWidth () const
 
size_t GetAlignment () const
 
QualifiedName GetTypeName () const
 
Confidence< bool > IsSigned () const
 
Confidence< bool > IsConst () const
 
Confidence< bool > IsVolatile () const
 
bool IsSystemCall () const
 
Confidence< Ref< Type > > GetChildType () const
 
Confidence< Ref< CallingConvention > > GetCallingConvention () const
 
std::vector< FunctionParameterGetParameters () const
 
Confidence< bool > HasVariableArguments () const
 
Confidence< bool > CanReturn () const
 
Ref< StructureGetStructure () const
 
Ref< EnumerationGetEnumeration () const
 
Ref< NamedTypeReferenceGetNamedTypeReference () const
 
Confidence< BNMemberScopeGetScope () const
 
Confidence< int64_t > GetStackAdjustment () const
 
QualifiedName GetStructureName () const
 
Ref< NamedTypeReferenceGetRegisteredName () const
 
uint32_t GetSystemCallNumber () const
 
BNIntegerDisplayType GetIntegerTypeDisplayType () const
 
uint64_t GetElementCount () const
 
uint64_t GetOffset () const
 
std::string GetString (Platform *platform=nullptr, BNTokenEscapingType escaping=NoTokenEscapingType) const
 
std::string GetTypeAndName (const QualifiedName &name, BNTokenEscapingType escaping=NoTokenEscapingType) const
 
std::string GetStringBeforeName (Platform *platform=nullptr, BNTokenEscapingType escaping=NoTokenEscapingType) const
 
std::string GetStringAfterName (Platform *platform=nullptr, BNTokenEscapingType escaping=NoTokenEscapingType) const
 
std::vector< InstructionTextTokenGetTokens (Platform *platform=nullptr, uint8_t baseConfidence=255, BNTokenEscapingType escaping=NoTokenEscapingType) const
 
std::vector< InstructionTextTokenGetTokensBeforeName (Platform *platform=nullptr, uint8_t baseConfidence=255, BNTokenEscapingType escaping=NoTokenEscapingType) const
 
std::vector< InstructionTextTokenGetTokensAfterName (Platform *platform=nullptr, uint8_t baseConfidence=255, BNTokenEscapingType escaping=NoTokenEscapingType) const
 
Ref< TypeDuplicate () const
 
Confidence< Ref< Type > > WithConfidence (uint8_t conf)
 
bool IsReferenceOfType (BNNamedTypeReferenceClass refType)
 
bool IsStructReference ()
 
bool IsEnumReference ()
 
bool IsUnionReference ()
 
bool IsClassReference ()
 
bool IsTypedefReference ()
 
bool IsStructOrClassReference ()
 
bool IsVoid () const
 
bool IsBool () const
 
bool IsInteger () const
 
bool IsFloat () const
 
bool IsStructure () const
 
bool IsEnumeration () const
 
bool IsPointer () const
 
bool IsArray () const
 
bool IsFunction () const
 
bool IsVarArgs () const
 
bool IsValue () const
 
bool IsNamedTypeRefer () const
 
bool IsWideChar () const
 
Ref< TypeWithReplacedStructure (Structure *from, Structure *to)
 
Ref< TypeWithReplacedEnumeration (Enumeration *from, Enumeration *to)
 
Ref< TypeWithReplacedNamedTypeReference (NamedTypeReference *from, NamedTypeReference *to)
 
bool AddTypeMemberTokens (BinaryView *data, std::vector< InstructionTextToken > &tokens, int64_t offset, std::vector< std::string > &nameList, size_t size=0, bool indirect=false)
 
std::vector< TypeDefinitionLineGetLines (Ref< BinaryView > data, const std::string &name, int lineWidth=80, bool collapsed=false, BNTokenEscapingType escaping=NoTokenEscapingType)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNType, BNNewTypeReference, BNFreeType >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNType * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 

Static Public Member Functions

static Ref< TypeVoidType ()
 
static Ref< TypeBoolType ()
 
static Ref< TypeIntegerType (size_t width, const Confidence< bool > &sign, const std::string &altName="")
 
static Ref< TypeFloatType (size_t width, const std::string &altName="")
 
static Ref< TypeWideCharType (size_t width, const std::string &altName="")
 
static Ref< TypeStructureType (Structure *strct)
 
static Ref< TypeNamedType (NamedTypeReference *ref, size_t width=0, size_t align=1, const Confidence< bool > &cnst=Confidence< bool >(false, 0), const Confidence< bool > &vltl=Confidence< bool >(false, 0))
 
static Ref< TypeNamedType (const QualifiedName &name, Type *type)
 
static Ref< TypeNamedType (const std::string &id, const QualifiedName &name, Type *type)
 
static Ref< TypeNamedType (BinaryView *view, const QualifiedName &name)
 
static Ref< TypeEnumerationType (Architecture *arch, Enumeration *enm, size_t width=0, const Confidence< bool > &isSigned=Confidence< bool >(false, 0))
 
static Ref< TypeEnumerationType (Enumeration *enm, size_t width, const Confidence< bool > &isSigned=Confidence< bool >(false, 0))
 
static Ref< TypePointerType (Architecture *arch, const Confidence< Ref< Type > > &type, const Confidence< bool > &cnst=Confidence< bool >(false, 0), const Confidence< bool > &vltl=Confidence< bool >(false, 0), BNReferenceType refType=PointerReferenceType)
 
static Ref< TypePointerType (size_t width, const Confidence< Ref< Type > > &type, const Confidence< bool > &cnst=Confidence< bool >(false, 0), const Confidence< bool > &vltl=Confidence< bool >(false, 0), BNReferenceType refType=PointerReferenceType)
 
static Ref< TypeArrayType (const Confidence< Ref< Type > > &type, uint64_t elem)
 
static Ref< TypeFunctionType (const Confidence< Ref< Type > > &returnValue, const Confidence< Ref< CallingConvention > > &callingConvention, const std::vector< FunctionParameter > &params, const Confidence< bool > &varArg=Confidence< bool >(false, 0), const Confidence< int64_t > &stackAdjust=Confidence< int64_t >(0, 0))
 
static Ref< TypeFunctionType (const Confidence< Ref< Type > > &returnValue, const Confidence< Ref< CallingConvention > > &callingConvention, const std::vector< FunctionParameter > &params, const Confidence< bool > &hasVariableArguments, const Confidence< bool > &canReturn, const Confidence< int64_t > &stackAdjust, const std::map< uint32_t, Confidence< int32_t > > &regStackAdjust=std::map< uint32_t, Confidence< int32_t > >(), const Confidence< std::vector< uint32_t > > &returnRegs=Confidence< std::vector< uint32_t > >(std::vector< uint32_t >(), 0), BNNameType ft=NoNameType)
 
static std::string GenerateAutoTypeId (const std::string &source, const QualifiedName &name)
 
static std::string GenerateAutoDemangledTypeId (const QualifiedName &name)
 
static std::string GetAutoDemangledTypeIdSource ()
 
static std::string GenerateAutoDebugTypeId (const QualifiedName &name)
 
static std::string GetAutoDebugTypeIdSource ()
 
static std::string GetSizeSuffix (size_t size)
 
- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNType, BNNewTypeReference, BNFreeType >
static BNType * GetObject (CoreRefCountObject *obj)
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNType, BNNewTypeReference, BNFreeType >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNType * m_object
 

Constructor & Destructor Documentation

◆ Type()

Type::Type ( BNType *  type)

Member Function Documentation

◆ AddTypeMemberTokens()

bool Type::AddTypeMemberTokens ( BinaryView data,
std::vector< InstructionTextToken > &  tokens,
int64_t  offset,
std::vector< std::string > &  nameList,
size_t  size = 0,
bool  indirect = false 
)

◆ ArrayType()

Ref< Type > Type::ArrayType ( const Confidence< Ref< Type > > &  type,
uint64_t  elem 
)
static

◆ BoolType()

Ref< Type > Type::BoolType ( )
static

◆ CanReturn()

Confidence< bool > Type::CanReturn ( ) const

◆ Duplicate()

Ref< Type > Type::Duplicate ( ) const

◆ EnumerationType() [1/2]

Ref< Type > Type::EnumerationType ( Architecture arch,
Enumeration enm,
size_t  width = 0,
const Confidence< bool > &  isSigned = Confidence<bool>(false, 0) 
)
static

◆ EnumerationType() [2/2]

Ref< Type > Type::EnumerationType ( Enumeration enm,
size_t  width,
const Confidence< bool > &  isSigned = Confidence<bool>(false, 0) 
)
static

◆ FloatType()

Ref< Type > Type::FloatType ( size_t  width,
const std::string &  altName = "" 
)
static

◆ FunctionType() [1/2]

Ref< Type > Type::FunctionType ( const Confidence< Ref< Type > > &  returnValue,
const Confidence< Ref< CallingConvention > > &  callingConvention,
const std::vector< FunctionParameter > &  params,
const Confidence< bool > &  hasVariableArguments,
const Confidence< bool > &  canReturn,
const Confidence< int64_t > &  stackAdjust,
const std::map< uint32_t, Confidence< int32_t > > &  regStackAdjust = std::map<uint32_t, Confidence<int32_t>>(),
const Confidence< std::vector< uint32_t > > &  returnRegs = Confidence<std::vector<uint32_t>>(std::vector<uint32_t>(), 0),
BNNameType  ft = NoNameType 
)
static

◆ FunctionType() [2/2]

Ref< Type > Type::FunctionType ( const Confidence< Ref< Type > > &  returnValue,
const Confidence< Ref< CallingConvention > > &  callingConvention,
const std::vector< FunctionParameter > &  params,
const Confidence< bool > &  varArg = Confidence<bool>(false, 0),
const Confidence< int64_t > &  stackAdjust = Confidence<int64_t>(0, 0) 
)
static

◆ GenerateAutoDebugTypeId()

string Type::GenerateAutoDebugTypeId ( const QualifiedName name)
static

◆ GenerateAutoDemangledTypeId()

string Type::GenerateAutoDemangledTypeId ( const QualifiedName name)
static

◆ GenerateAutoTypeId()

string Type::GenerateAutoTypeId ( const std::string &  source,
const QualifiedName name 
)
static

◆ GetAlignment()

size_t Type::GetAlignment ( ) const

◆ GetAutoDebugTypeIdSource()

string Type::GetAutoDebugTypeIdSource ( )
static

◆ GetAutoDemangledTypeIdSource()

string Type::GetAutoDemangledTypeIdSource ( )
static

◆ GetCallingConvention()

Confidence< Ref< CallingConvention > > Type::GetCallingConvention ( ) const

◆ GetChildType()

Confidence< Ref< Type > > Type::GetChildType ( ) const

◆ GetClass()

BNTypeClass Type::GetClass ( ) const

◆ GetElementCount()

uint64_t Type::GetElementCount ( ) const

◆ GetEnumeration()

Ref< Enumeration > Type::GetEnumeration ( ) const

◆ GetIntegerTypeDisplayType()

BNIntegerDisplayType Type::GetIntegerTypeDisplayType ( ) const

◆ GetLines()

std::vector< TypeDefinitionLine > Type::GetLines ( Ref< BinaryView data,
const std::string &  name,
int  lineWidth = 80,
bool  collapsed = false,
BNTokenEscapingType  escaping = NoTokenEscapingType 
)

◆ GetNamedTypeReference()

Ref< NamedTypeReference > Type::GetNamedTypeReference ( ) const

◆ GetOffset()

uint64_t Type::GetOffset ( ) const

◆ GetParameters()

vector< FunctionParameter > Type::GetParameters ( ) const

◆ GetRegisteredName()

Ref< NamedTypeReference > Type::GetRegisteredName ( ) const

◆ GetScope()

Confidence< BNMemberScope > BinaryNinja::Type::GetScope ( ) const

◆ GetSizeSuffix()

string Type::GetSizeSuffix ( size_t  size)
static

◆ GetStackAdjustment()

Confidence< int64_t > Type::GetStackAdjustment ( ) const

◆ GetString()

string Type::GetString ( Platform platform = nullptr,
BNTokenEscapingType  escaping = NoTokenEscapingType 
) const

◆ GetStringAfterName()

string Type::GetStringAfterName ( Platform platform = nullptr,
BNTokenEscapingType  escaping = NoTokenEscapingType 
) const

◆ GetStringBeforeName()

string Type::GetStringBeforeName ( Platform platform = nullptr,
BNTokenEscapingType  escaping = NoTokenEscapingType 
) const

◆ GetStructure()

Ref< Structure > Type::GetStructure ( ) const

◆ GetStructureName()

QualifiedName Type::GetStructureName ( ) const

◆ GetSystemCallNumber()

uint32_t Type::GetSystemCallNumber ( ) const

◆ GetTokens()

vector< InstructionTextToken > Type::GetTokens ( Platform platform = nullptr,
uint8_t  baseConfidence = 255,
BNTokenEscapingType  escaping = NoTokenEscapingType 
) const

◆ GetTokensAfterName()

vector< InstructionTextToken > Type::GetTokensAfterName ( Platform platform = nullptr,
uint8_t  baseConfidence = 255,
BNTokenEscapingType  escaping = NoTokenEscapingType 
) const

◆ GetTokensBeforeName()

vector< InstructionTextToken > Type::GetTokensBeforeName ( Platform platform = nullptr,
uint8_t  baseConfidence = 255,
BNTokenEscapingType  escaping = NoTokenEscapingType 
) const

◆ GetTypeAndName()

string Type::GetTypeAndName ( const QualifiedName name,
BNTokenEscapingType  escaping = NoTokenEscapingType 
) const

◆ GetTypeName()

QualifiedName Type::GetTypeName ( ) const

◆ GetWidth()

uint64_t Type::GetWidth ( ) const

◆ HasVariableArguments()

Confidence< bool > Type::HasVariableArguments ( ) const

◆ IntegerType()

Ref< Type > Type::IntegerType ( size_t  width,
const Confidence< bool > &  sign,
const std::string &  altName = "" 
)
static

◆ IsArray()

bool BinaryNinja::Type::IsArray ( ) const
inline

◆ IsBool()

bool BinaryNinja::Type::IsBool ( ) const
inline

◆ IsClassReference()

bool BinaryNinja::Type::IsClassReference ( )
inline

◆ IsConst()

Confidence< bool > Type::IsConst ( ) const

◆ IsEnumeration()

bool BinaryNinja::Type::IsEnumeration ( ) const
inline

◆ IsEnumReference()

bool BinaryNinja::Type::IsEnumReference ( )
inline

◆ IsFloat()

bool BinaryNinja::Type::IsFloat ( ) const
inline

◆ IsFunction()

bool BinaryNinja::Type::IsFunction ( ) const
inline

◆ IsInteger()

bool BinaryNinja::Type::IsInteger ( ) const
inline

◆ IsNamedTypeRefer()

bool BinaryNinja::Type::IsNamedTypeRefer ( ) const
inline

◆ IsPointer()

bool BinaryNinja::Type::IsPointer ( ) const
inline

◆ IsReferenceOfType()

bool Type::IsReferenceOfType ( BNNamedTypeReferenceClass  refType)

◆ IsSigned()

Confidence< bool > Type::IsSigned ( ) const

◆ IsStructOrClassReference()

bool BinaryNinja::Type::IsStructOrClassReference ( )
inline

◆ IsStructReference()

bool BinaryNinja::Type::IsStructReference ( )
inline

◆ IsStructure()

bool BinaryNinja::Type::IsStructure ( ) const
inline

◆ IsSystemCall()

bool Type::IsSystemCall ( ) const

◆ IsTypedefReference()

bool BinaryNinja::Type::IsTypedefReference ( )
inline

◆ IsUnionReference()

bool BinaryNinja::Type::IsUnionReference ( )
inline

◆ IsValue()

bool BinaryNinja::Type::IsValue ( ) const
inline

◆ IsVarArgs()

bool BinaryNinja::Type::IsVarArgs ( ) const
inline

◆ IsVoid()

bool BinaryNinja::Type::IsVoid ( ) const
inline

◆ IsVolatile()

Confidence< bool > BinaryNinja::Type::IsVolatile ( ) const

◆ IsWideChar()

bool BinaryNinja::Type::IsWideChar ( ) const
inline

◆ NamedType() [1/4]

Ref< Type > Type::NamedType ( BinaryView view,
const QualifiedName name 
)
static

◆ NamedType() [2/4]

Ref< Type > Type::NamedType ( const QualifiedName name,
Type type 
)
static

◆ NamedType() [3/4]

static Ref< Type > BinaryNinja::Type::NamedType ( const std::string &  id,
const QualifiedName name,
Type type 
)
static

◆ NamedType() [4/4]

Ref< Type > Type::NamedType ( NamedTypeReference ref,
size_t  width = 0,
size_t  align = 1,
const Confidence< bool > &  cnst = Confidence<bool>(false, 0),
const Confidence< bool > &  vltl = Confidence<bool>(false, 0) 
)
static

◆ operator!=()

bool Type::operator!= ( const Type other)

◆ operator==()

bool Type::operator== ( const Type other)

◆ PointerType() [1/2]

Ref< Type > Type::PointerType ( Architecture arch,
const Confidence< Ref< Type > > &  type,
const Confidence< bool > &  cnst = Confidence<bool>(false, 0),
const Confidence< bool > &  vltl = Confidence<bool>(false, 0),
BNReferenceType  refType = PointerReferenceType 
)
static

◆ PointerType() [2/2]

Ref< Type > Type::PointerType ( size_t  width,
const Confidence< Ref< Type > > &  type,
const Confidence< bool > &  cnst = Confidence<bool>(false, 0),
const Confidence< bool > &  vltl = Confidence<bool>(false, 0),
BNReferenceType  refType = PointerReferenceType 
)
static

◆ StructureType()

Ref< Type > Type::StructureType ( Structure strct)
static

◆ VoidType()

Ref< Type > Type::VoidType ( )
static

◆ WideCharType()

Ref< Type > Type::WideCharType ( size_t  width,
const std::string &  altName = "" 
)
static

◆ WithConfidence()

Confidence< Ref< Type > > Type::WithConfidence ( uint8_t  conf)

◆ WithReplacedEnumeration()

Ref< Type > Type::WithReplacedEnumeration ( Enumeration from,
Enumeration to 
)

◆ WithReplacedNamedTypeReference()

Ref< Type > Type::WithReplacedNamedTypeReference ( NamedTypeReference from,
NamedTypeReference to 
)

◆ WithReplacedStructure()

Ref< Type > Type::WithReplacedStructure ( Structure from,
Structure to 
)

The documentation for this class was generated from the following files: