Classes | |
class | BinaryNinja::Symbol |
class | BinaryNinja::Type |
class | BinaryNinja::TypeBuilder |
class | BinaryNinja::NamedTypeReference |
class | BinaryNinja::NamedTypeReferenceBuilder |
struct | BinaryNinja::StructureMember |
struct | BinaryNinja::InheritedStructureMember |
struct | BinaryNinja::BaseStructure |
class | BinaryNinja::Structure |
Structure is a class that wraps built structures and retrieves info about them. More... | |
class | BinaryNinja::StructureBuilder |
StructureBuilder is a convenience class used for building Structure Types. More... | |
struct | BinaryNinja::EnumerationMember |
class | BinaryNinja::Enumeration |
class | BinaryNinja::EnumerationBuilder |
EnumerationBuilder is a convenience class used for building Enumeration Types. More... | |
class | BinaryNinja::TypeContainer |
A TypeContainer is a generic interface to access various Binary Ninja models that contain types. More... | |
class BinaryNinja::Symbol |
Public Member Functions | |
Symbol (BNSymbolType type, const std::string &shortName, const std::string &fullName, const std::string &rawName, uint64_t addr, BNSymbolBinding binding=NoBinding, const NameSpace &nameSpace=NameSpace("BNINTERNALNAMESPACE"), uint64_t ordinal=0) | |
Symbol (BNSymbolType type, const std::string &name, uint64_t addr, BNSymbolBinding binding=NoBinding, const NameSpace &nameSpace=NameSpace("BNINTERNALNAMESPACE"), uint64_t ordinal=0) | |
Symbol (BNSymbol *sym) | |
BNSymbolType | GetType () const |
Symbols are defined as one of the following types: | |
BNSymbolBinding | GetBinding () const |
std::string | GetShortName () const |
std::string | GetFullName () const |
std::string | GetRawName () const |
uint64_t | GetAddress () const |
uint64_t | GetOrdinal () const |
bool | IsAutoDefined () const |
NameSpace | GetNameSpace () const |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSymbol, BNNewSymbolReference, BNFreeSymbol > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNSymbol * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Static Public Member Functions | |
static Ref< Symbol > | ImportedFunctionFromImportAddressSymbol (Symbol *sym, uint64_t addr) |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNSymbol, BNNewSymbolReference, BNFreeSymbol > | |
static BNSymbol * | GetObject (CoreRefCountObject *obj) |
static BNSymbol * | GetObject (const CoreRefCountObject *obj) |
Additional Inherited Members | |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNSymbol, BNNewSymbolReference, BNFreeSymbol > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNSymbol * | m_object |
BinaryNinja::Symbol::Symbol | ( | BNSymbolType | type, |
const std::string & | shortName, | ||
const std::string & | fullName, | ||
const std::string & | rawName, | ||
uint64_t | addr, | ||
BNSymbolBinding | binding = NoBinding, | ||
const NameSpace & | nameSpace = NameSpace("BNINTERNALNAMESPACE"), | ||
uint64_t | ordinal = 0 ) |
Symbol::Symbol | ( | BNSymbolType | type, |
const std::string & | name, | ||
uint64_t | addr, | ||
BNSymbolBinding | binding = NoBinding, | ||
const NameSpace & | nameSpace = NameSpace( "BNINTERNALNAMESPACE" ), | ||
uint64_t | ordinal = 0 ) |
Symbol::Symbol | ( | BNSymbol * | sym | ) |
BNSymbolType Symbol::GetType | ( | ) | const |
Symbols are defined as one of the following types:
=========================== ================================================================= BNSymbolType Description =========================== ================================================================= FunctionSymbol Symbol for function that exists in the current binary ImportAddressSymbol Symbol defined in the Import Address Table ImportedFunctionSymbol Symbol for a function that is not defined in the current binary DataSymbol Symbol for data in the current binary ImportedDataSymbol Symbol for data that is not defined in the current binary ExternalSymbol Symbols for data and code that reside outside the BinaryView LibraryFunctionSymbol Symbols for functions identified as belonging to a shared library SymbolicFunctionSymbol Symbols for functions without a concrete implementation or which have been abstractly represented LocalLabelSymbol Symbol for a local label in the current binary =========================== =================================================================
BNSymbolBinding Symbol::GetBinding | ( | ) | const |
string Symbol::GetShortName | ( | ) | const |
string Symbol::GetFullName | ( | ) | const |
string Symbol::GetRawName | ( | ) | const |
uint64_t Symbol::GetAddress | ( | ) | const |
uint64_t Symbol::GetOrdinal | ( | ) | const |
bool Symbol::IsAutoDefined | ( | ) | const |
class BinaryNinja::Type |
Public Member Functions | |
Type (BNType *type) | |
bool | operator== (const Type &other) |
bool | operator!= (const Type &other) |
BNTypeClass | GetClass () const |
Retrieve the Type Class for this Structure. | |
uint64_t | GetWidth () const |
Get the width in bytes of the Type. | |
size_t | GetAlignment () const |
QualifiedName | GetTypeName () const |
Get the QualifiedName for the Type. | |
Confidence< bool > | IsSigned () const |
Whether the type is signed. | |
Confidence< bool > | IsConst () const |
Whether the type is constant. | |
Confidence< bool > | IsVolatile () const |
bool | IsSystemCall () const |
Confidence< Ref< Type > > | GetChildType () const |
Get the child type for this Type if one exists. | |
Confidence< Ref< CallingConvention > > | GetCallingConvention () const |
For Function Types, get the calling convention. | |
BNCallingConventionName | GetCallingConventionName () const |
For Function Types, get the calling convention name. | |
std::vector< FunctionParameter > | GetParameters () const |
For Function Types, get a list of parameters. | |
Confidence< bool > | HasVariableArguments () const |
For Function Types, whether the Function has variadic arguments. | |
bool | HasTemplateArguments () const |
Has no effect currently, just used by the demangler. | |
Confidence< bool > | CanReturn () const |
For Function Types, whether a function can return (is not marked noreturn) | |
Confidence< bool > | IsPure () const |
For Function Types, whether a function is pure (has no observable side-effects) | |
Ref< Structure > | GetStructure () const |
For Structure Types, the underlying Structure. | |
Ref< Enumeration > | GetEnumeration () const |
For Enumeration Types, the underlying Enumeration. | |
Ref< NamedTypeReference > | GetNamedTypeReference () const |
For NamedTypeReference Types, the underlying NamedTypeReference. | |
Confidence< BNMemberScope > | GetScope () const |
Confidence< int64_t > | GetStackAdjustment () const |
QualifiedName | GetStructureName () const |
Ref< NamedTypeReference > | GetRegisteredName () const |
std::string | GetAlternateName () const |
uint32_t | GetSystemCallNumber () const |
BNIntegerDisplayType | GetIntegerTypeDisplayType () const |
BNNameType | GetNameType () const |
bool | ShouldDisplayReturnType () const |
uint64_t | GetElementCount () const |
uint64_t | GetOffset () const |
BNPointerBaseType | GetPointerBaseType () const |
int64_t | GetPointerBaseOffset () const |
std::set< BNPointerSuffix > | GetPointerSuffix () const |
std::string | GetPointerSuffixString () const |
std::vector< InstructionTextToken > | GetPointerSuffixTokens (uint8_t baseConfidence=255) 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< InstructionTextToken > | GetTokens (Platform *platform=nullptr, uint8_t baseConfidence=255, BNTokenEscapingType escaping=NoTokenEscapingType) const |
std::vector< InstructionTextToken > | GetTokensBeforeName (Platform *platform=nullptr, uint8_t baseConfidence=255, BNTokenEscapingType escaping=NoTokenEscapingType) const |
std::vector< InstructionTextToken > | GetTokensAfterName (Platform *platform=nullptr, uint8_t baseConfidence=255, BNTokenEscapingType escaping=NoTokenEscapingType) const |
Ref< Type > | Duplicate () const |
Confidence< Ref< Type > > | WithConfidence (uint8_t conf) |
Get this type wrapped in a Confidence template. | |
bool | IsReferenceOfType (BNNamedTypeReferenceClass refType) |
If this Type is a NamedTypeReference, check whether it is reference to a specific Type. | |
bool | IsStructReference () |
If this Type is a NamedTypeReference, check whether it refers to a Struct Type. | |
bool | IsEnumReference () |
If this Type is a NamedTypeReference, check whether it refers to an Enum Type. | |
bool | IsUnionReference () |
If this Type is a NamedTypeReference, check whether it refers to a Union Type. | |
bool | IsClassReference () |
If this Type is a NamedTypeReference, check whether it refers to a Class Type. | |
bool | IsTypedefReference () |
If this Type is a NamedTypeReference, check whether it refers to a Typedef type. | |
bool | IsStructOrClassReference () |
If this Type is a NamedTypeReference, check whether it refers to a Struct or Class Type. | |
bool | IsVoid () const |
Check whether this type is a Void type. | |
bool | IsBool () const |
Check whether this type is a Boolean type. | |
bool | IsInteger () const |
Check whether this type is an Integer type. | |
bool | IsFloat () const |
Check whether this type is a Float type. | |
bool | IsStructure () const |
Check whether this type is a Structure type. | |
bool | IsEnumeration () const |
Check whether this type is an Enumeration type. | |
bool | IsPointer () const |
Check whether this type is a Pointer type. | |
bool | IsArray () const |
Check whether this type is an Array type. | |
bool | IsFunction () const |
Check whether this type is a Function type. | |
bool | IsVarArgs () const |
Check whether this type is a Variadic Arguments type. | |
bool | IsValue () const |
Check whether this type is a Value type. | |
bool | IsNamedTypeRefer () const |
Check whether this type is a Named Type Reference type. | |
bool | IsWideChar () const |
Check whether this type is a Wide Char type. | |
Ref< Type > | WithReplacedStructure (Structure *from, Structure *to) |
Ref< Type > | WithReplacedEnumeration (Enumeration *from, Enumeration *to) |
Ref< Type > | WithReplacedNamedTypeReference (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< TypeDefinitionLine > | GetLines (const TypeContainer &types, const std::string &name, int paddingCols=64, 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 () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Static Public Member Functions | |
static Ref< Type > | VoidType () |
Create a "void" type. | |
static Ref< Type > | BoolType () |
Create a "bool" type. | |
static Ref< Type > | IntegerType (size_t width, const Confidence< bool > &sign, const std::string &altName="") |
Create a signed or unsigned integer with a set width. | |
static Ref< Type > | FloatType (size_t width, const std::string &altName="") |
Create a float or double Type with a specified width. | |
static Ref< Type > | WideCharType (size_t width, const std::string &altName="") |
static Ref< Type > | StructureType (Structure *strct) |
Create a Type object from a Structure object. | |
static Ref< 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 Ref< Type > | NamedType (const QualifiedName &name, Type *type) |
static Ref< Type > | NamedType (const std::string &id, const QualifiedName &name, Type *type) |
static Ref< Type > | NamedType (BinaryView *view, const QualifiedName &name) |
static Ref< Type > | EnumerationType (Architecture *arch, Enumeration *enm, size_t width=0, const Confidence< bool > &isSigned=Confidence< bool >(false, 0)) |
static Ref< Type > | EnumerationType (Enumeration *enm, size_t width, const Confidence< bool > &isSigned=Confidence< bool >(false, 0)) |
static Ref< 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) |
Create a Pointer type, which points to another Type. | |
static Ref< 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) |
Create a Pointer type, which points to another Type. | |
static Ref< Type > | ArrayType (const Confidence< Ref< Type > > &type, uint64_t elem) |
Create an Array Type. | |
static Ref< Type > | FunctionType (const Confidence< Ref< Type > > &returnValue, const Confidence< Ref< CallingConvention > > &callingConvention, const std::vector< FunctionParameter > ¶ms, const Confidence< bool > &varArg=Confidence< bool >(false, 0), const Confidence< int64_t > &stackAdjust=Confidence< int64_t >(0, 0)) |
Create a Function Type. | |
static Ref< Type > | FunctionType (const Confidence< Ref< Type > > &returnValue, const Confidence< Ref< CallingConvention > > &callingConvention, const std::vector< FunctionParameter > ¶ms, const Confidence< bool > &hasVariableArguments, const Confidence< bool > &canReturn, const Confidence< int64_t > &stackAdjust, const std::map< uint32_t, Confidence< int32_t > > ®StackAdjust=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, const Confidence< bool > &pure=Confidence< bool >(false, 0)) |
Create a Function Type. | |
static Ref< Type > | VarArgsType () |
static Ref< Type > | ValueType (const std::string &value) |
static std::string | GetNameTypeString (BNNameType classFunctionType) |
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) |
static BNType * | GetObject (const 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 |
Type::Type | ( | BNType * | type | ) |
bool Type::operator== | ( | const Type & | other | ) |
bool Type::operator!= | ( | const Type & | other | ) |
BNTypeClass Type::GetClass | ( | ) | const |
uint64_t Type::GetWidth | ( | ) | const |
Get the width in bytes of the Type.
size_t Type::GetAlignment | ( | ) | const |
QualifiedName Type::GetTypeName | ( | ) | const |
Get the QualifiedName for the Type.
Confidence< bool > Type::IsSigned | ( | ) | const |
Whether the type is signed.
Confidence< bool > Type::IsConst | ( | ) | const |
Whether the type is constant.
Confidence< bool > Type::IsVolatile | ( | ) | const |
bool Type::IsSystemCall | ( | ) | const |
Confidence< Ref< Type > > Type::GetChildType | ( | ) | const |
Get the child type for this Type if one exists.
Confidence< Ref< CallingConvention > > Type::GetCallingConvention | ( | ) | const |
For Function Types, get the calling convention.
BNCallingConventionName Type::GetCallingConventionName | ( | ) | const |
For Function Types, get the calling convention name.
vector< FunctionParameter > Type::GetParameters | ( | ) | const |
For Function Types, get a list of parameters.
Confidence< bool > Type::HasVariableArguments | ( | ) | const |
bool Type::HasTemplateArguments | ( | ) | const |
Has no effect currently, just used by the demangler.
Confidence< bool > Type::CanReturn | ( | ) | const |
For Function Types, whether a function can return (is not marked noreturn)
Confidence< bool > Type::IsPure | ( | ) | const |
For Function Types, whether a function is pure (has no observable side-effects)
Ref< Enumeration > Type::GetEnumeration | ( | ) | const |
For Enumeration Types, the underlying Enumeration.
Ref< NamedTypeReference > Type::GetNamedTypeReference | ( | ) | const |
For NamedTypeReference Types, the underlying NamedTypeReference.
Confidence< BNMemberScope > BinaryNinja::Type::GetScope | ( | ) | const |
Confidence< int64_t > Type::GetStackAdjustment | ( | ) | const |
QualifiedName Type::GetStructureName | ( | ) | const |
Ref< NamedTypeReference > Type::GetRegisteredName | ( | ) | const |
string Type::GetAlternateName | ( | ) | const |
uint32_t Type::GetSystemCallNumber | ( | ) | const |
BNIntegerDisplayType Type::GetIntegerTypeDisplayType | ( | ) | const |
BNNameType Type::GetNameType | ( | ) | const |
bool Type::ShouldDisplayReturnType | ( | ) | const |
uint64_t Type::GetElementCount | ( | ) | const |
uint64_t Type::GetOffset | ( | ) | const |
BNPointerBaseType Type::GetPointerBaseType | ( | ) | const |
int64_t Type::GetPointerBaseOffset | ( | ) | const |
std::set< BNPointerSuffix > Type::GetPointerSuffix | ( | ) | const |
std::string Type::GetPointerSuffixString | ( | ) | const |
std::vector< InstructionTextToken > Type::GetPointerSuffixTokens | ( | uint8_t | baseConfidence = 255 | ) | const |
string Type::GetString | ( | Platform * | platform = nullptr, |
BNTokenEscapingType | escaping = NoTokenEscapingType ) const |
string Type::GetTypeAndName | ( | const QualifiedName & | name, |
BNTokenEscapingType | escaping = NoTokenEscapingType ) const |
string Type::GetStringBeforeName | ( | Platform * | platform = nullptr, |
BNTokenEscapingType | escaping = NoTokenEscapingType ) const |
string Type::GetStringAfterName | ( | Platform * | platform = nullptr, |
BNTokenEscapingType | escaping = NoTokenEscapingType ) const |
vector< InstructionTextToken > Type::GetTokens | ( | Platform * | platform = nullptr, |
uint8_t | baseConfidence = 255, | ||
BNTokenEscapingType | escaping = NoTokenEscapingType ) const |
vector< InstructionTextToken > Type::GetTokensBeforeName | ( | Platform * | platform = nullptr, |
uint8_t | baseConfidence = 255, | ||
BNTokenEscapingType | escaping = NoTokenEscapingType ) const |
vector< InstructionTextToken > Type::GetTokensAfterName | ( | Platform * | platform = nullptr, |
uint8_t | baseConfidence = 255, | ||
BNTokenEscapingType | escaping = NoTokenEscapingType ) const |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Create a Pointer type, which points to another Type.
arch | Architecture, used to calculate the proper pointer width |
type | Type that this Type points to |
cnst | Whether this type is const |
vltl | Whether this type is volatile |
refType | Reference Type, one of "PointerReferenceType", "ReferenceReferenceType", "RValueReferenceType", "NoReference" |
|
static |
Create a Pointer type, which points to another Type.
width | Width of the pointer in bytes |
type | Type that this type points to |
cnst | Whether this type is const |
vltl | Whether this type is volatile |
refType | Reference Type, one of "PointerReferenceType", "ReferenceReferenceType", "RValueReferenceType", "NoReference" |
|
static |
|
static |
returnValue | Return value Type |
callingConvention | Calling convention for the function |
params | list of FunctionParameter s |
varArg | Whether this function has variadic arguments, default false |
stackAdjust | Stack adjustment for this function, default 0 |
|
static |
returnValue | Return value Type |
callingConvention | Calling convention for the function |
params | list of FunctionParameters |
varArg | Whether this function has variadic arguments, default false |
stackAdjust | Stack adjustment for this function, default 0 |
regStackAdjust | Register stack adjustmemt |
returnRegs | Return registers |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Confidence< Ref< Type > > Type::WithConfidence | ( | uint8_t | conf | ) |
Get this type wrapped in a Confidence template.
conf | Confidence value between 0 and 255 |
bool Type::IsReferenceOfType | ( | BNNamedTypeReferenceClass | refType | ) |
If this Type is a NamedTypeReference, check whether it is reference to a specific Type.
refType | BNNamedTypeReference to check it against |
|
inline |
If this Type is a NamedTypeReference, check whether it refers to a Struct Type.
|
inline |
If this Type is a NamedTypeReference, check whether it refers to an Enum Type.
|
inline |
If this Type is a NamedTypeReference, check whether it refers to a Union Type.
|
inline |
If this Type is a NamedTypeReference, check whether it refers to a Class Type.
|
inline |
If this Type is a NamedTypeReference, check whether it refers to a Typedef type.
|
inline |
If this Type is a NamedTypeReference, check whether it refers to a Struct or Class Type.
|
inline |
Check whether this type is a Void type.
|
inline |
Check whether this type is a Boolean type.
|
inline |
Check whether this type is an Integer type.
|
inline |
Check whether this type is a Float type.
|
inline |
Check whether this type is a Structure type.
|
inline |
Check whether this type is an Enumeration type.
|
inline |
Check whether this type is a Pointer type.
|
inline |
Check whether this type is an Array type.
|
inline |
Check whether this type is a Function type.
|
inline |
Check whether this type is a Variadic Arguments type.
|
inline |
Check whether this type is a Value type.
|
inline |
Check whether this type is a Named Type Reference type.
|
inline |
Check whether this type is a Wide Char type.
Ref< Type > Type::WithReplacedEnumeration | ( | Enumeration * | from, |
Enumeration * | to ) |
Ref< Type > Type::WithReplacedNamedTypeReference | ( | NamedTypeReference * | from, |
NamedTypeReference * | to ) |
bool Type::AddTypeMemberTokens | ( | BinaryView * | data, |
std::vector< InstructionTextToken > & | tokens, | ||
int64_t | offset, | ||
std::vector< std::string > & | nameList, | ||
size_t | size = 0, | ||
bool | indirect = false ) |
std::vector< TypeDefinitionLine > Type::GetLines | ( | const TypeContainer & | types, |
const std::string & | name, | ||
int | paddingCols = 64, | ||
bool | collapsed = false, | ||
BNTokenEscapingType | escaping = NoTokenEscapingType ) |
|
static |
class BinaryNinja::TypeBuilder |
Public Member Functions | |
TypeBuilder () | |
~TypeBuilder () | |
TypeBuilder (BNTypeBuilder *type) | |
TypeBuilder (const TypeBuilder &type) | |
TypeBuilder (TypeBuilder &&type) | |
TypeBuilder (Type *type) | |
TypeBuilder & | operator= (const TypeBuilder &type) |
TypeBuilder & | operator= (TypeBuilder &&type) |
TypeBuilder & | operator= (Type *type) |
Ref< Type > | Finalize () |
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 |
void | SetIntegerTypeDisplayType (BNIntegerDisplayType displayType) |
Confidence< Ref< Type > > | GetChildType () const |
Confidence< Ref< CallingConvention > > | GetCallingConvention () const |
BNCallingConventionName | GetCallingConventionName () const |
std::vector< FunctionParameter > | GetParameters () const |
Confidence< bool > | HasVariableArguments () const |
Confidence< bool > | CanReturn () const |
Confidence< bool > | IsPure () const |
Ref< Structure > | GetStructure () const |
Ref< Enumeration > | GetEnumeration () const |
Ref< NamedTypeReference > | GetNamedTypeReference () const |
Confidence< BNMemberScope > | GetScope () const |
BNNameType | GetNameType () const |
bool | HasTemplateArguments () const |
TypeBuilder & | SetWidth (size_t width) |
TypeBuilder & | SetAlignment (size_t alignment) |
TypeBuilder & | SetNamedTypeReference (NamedTypeReference *ntr) |
TypeBuilder & | SetScope (const Confidence< BNMemberScope > &scope) |
TypeBuilder & | SetConst (const Confidence< bool > &cnst) |
TypeBuilder & | SetVolatile (const Confidence< bool > &vltl) |
TypeBuilder & | SetChildType (const Confidence< Ref< Type > > &child) |
TypeBuilder & | SetCallingConvention (const Confidence< Ref< CallingConvention > > &cc) |
TypeBuilder & | SetCallingConventionName (BNCallingConventionName cc) |
TypeBuilder & | SetSigned (const Confidence< bool > &vltl) |
TypeBuilder & | SetTypeName (const QualifiedName &name) |
TypeBuilder & | SetAlternateName (const std::string &name) |
TypeBuilder & | SetSystemCall (bool sc, uint32_t n=0) |
TypeBuilder & | SetNameType (BNNameType type) |
TypeBuilder & | SetHasTemplateArguments (bool hasTemplateArguments) |
Confidence< int64_t > | GetStackAdjustment () const |
QualifiedName | GetStructureName () const |
uint64_t | GetElementCount () const |
uint64_t | GetOffset () const |
uint32_t | GetSystemCallNumber () const |
BNPointerBaseType | GetPointerBaseType () const |
int64_t | GetPointerBaseOffset () const |
TypeBuilder & | SetOffset (uint64_t offset) |
TypeBuilder & | SetFunctionCanReturn (const Confidence< bool > &canReturn) |
TypeBuilder & | SetPure (const Confidence< bool > &pure) |
TypeBuilder & | SetParameters (const std::vector< FunctionParameter > ¶ms) |
TypeBuilder & | SetPointerBase (BNPointerBaseType baseType, int64_t baseOffset) |
std::set< BNPointerSuffix > | GetPointerSuffix () const |
std::string | GetPointerSuffixString () const |
std::vector< InstructionTextToken > | GetPointerSuffixTokens (uint8_t baseConfidence=255) const |
TypeBuilder & | AddPointerSuffix (BNPointerSuffix ps) |
TypeBuilder & | SetPointerSuffix (const std::set< BNPointerSuffix > &suffix) |
std::string | GetString (Platform *platform=nullptr) const |
std::string | GetTypeAndName (const QualifiedName &name) const |
std::string | GetStringBeforeName (Platform *platform=nullptr) const |
std::string | GetStringAfterName (Platform *platform=nullptr) const |
std::vector< InstructionTextToken > | GetTokens (Platform *platform=nullptr, uint8_t baseConfidence=255) const |
std::vector< InstructionTextToken > | GetTokensBeforeName (Platform *platform=nullptr, uint8_t baseConfidence=255) const |
std::vector< InstructionTextToken > | GetTokensAfterName (Platform *platform=nullptr, uint8_t baseConfidence=255) const |
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 |
Static Public Member Functions | |
static TypeBuilder | VoidType () |
static TypeBuilder | BoolType () |
static TypeBuilder | IntegerType (size_t width, const Confidence< bool > &sign, const std::string &altName="") |
static TypeBuilder | FloatType (size_t width, const std::string &typeName="") |
static TypeBuilder | WideCharType (size_t width, const std::string &typeName="") |
static TypeBuilder | StructureType (Structure *strct) |
static TypeBuilder | StructureType (StructureBuilder *strct) |
static TypeBuilder | 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 TypeBuilder | NamedType (NamedTypeReferenceBuilder *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 TypeBuilder | NamedType (const QualifiedName &name, Type *type) |
static TypeBuilder | NamedType (const std::string &id, const QualifiedName &name, Type *type) |
static TypeBuilder | NamedType (BinaryView *view, const QualifiedName &name) |
static TypeBuilder | EnumerationType (Architecture *arch, Enumeration *enm, size_t width=0, const Confidence< bool > &issigned=Confidence< bool >(false, 0)) |
static TypeBuilder | EnumerationType (Architecture *arch, EnumerationBuilder *enm, size_t width=0, const Confidence< bool > &issigned=Confidence< bool >(false, 0)) |
static TypeBuilder | 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 TypeBuilder | 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 TypeBuilder | ArrayType (const Confidence< Ref< Type > > &type, uint64_t elem) |
static TypeBuilder | FunctionType (const Confidence< Ref< Type > > &returnValue, const Confidence< Ref< CallingConvention > > &callingConvention, const std::vector< FunctionParameter > ¶ms, const Confidence< bool > &varArg=Confidence< bool >(false, 0), const Confidence< int64_t > &stackAdjust=Confidence< int64_t >(0, 0)) |
static TypeBuilder | FunctionType (const Confidence< Ref< Type > > &returnValue, const Confidence< Ref< CallingConvention > > &callingConvention, const std::vector< FunctionParameter > ¶ms, const Confidence< bool > &hasVariableArguments, const Confidence< bool > &canReturn, const Confidence< int64_t > &stackAdjust, const std::map< uint32_t, Confidence< int32_t > > ®StackAdjust=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, const Confidence< bool > &pure=Confidence< bool >(false, 0)) |
static TypeBuilder | VarArgsType () |
static TypeBuilder | ValueType (const std::string &value) |
TypeBuilder::TypeBuilder | ( | ) |
TypeBuilder::~TypeBuilder | ( | ) |
TypeBuilder::TypeBuilder | ( | BNTypeBuilder * | type | ) |
TypeBuilder::TypeBuilder | ( | const TypeBuilder & | type | ) |
TypeBuilder::TypeBuilder | ( | TypeBuilder && | type | ) |
TypeBuilder::TypeBuilder | ( | Type * | type | ) |
TypeBuilder & TypeBuilder::operator= | ( | const TypeBuilder & | type | ) |
TypeBuilder & TypeBuilder::operator= | ( | TypeBuilder && | type | ) |
TypeBuilder & TypeBuilder::operator= | ( | Type * | type | ) |
BNTypeClass TypeBuilder::GetClass | ( | ) | const |
uint64_t TypeBuilder::GetWidth | ( | ) | const |
size_t TypeBuilder::GetAlignment | ( | ) | const |
QualifiedName TypeBuilder::GetTypeName | ( | ) | const |
Confidence< bool > TypeBuilder::IsSigned | ( | ) | const |
Confidence< bool > TypeBuilder::IsConst | ( | ) | const |
Confidence< bool > TypeBuilder::IsVolatile | ( | ) | const |
bool TypeBuilder::IsSystemCall | ( | ) | const |
void TypeBuilder::SetIntegerTypeDisplayType | ( | BNIntegerDisplayType | displayType | ) |
Confidence< Ref< Type > > TypeBuilder::GetChildType | ( | ) | const |
Confidence< Ref< CallingConvention > > TypeBuilder::GetCallingConvention | ( | ) | const |
BNCallingConventionName TypeBuilder::GetCallingConventionName | ( | ) | const |
vector< FunctionParameter > TypeBuilder::GetParameters | ( | ) | const |
Confidence< bool > TypeBuilder::HasVariableArguments | ( | ) | const |
Confidence< bool > TypeBuilder::CanReturn | ( | ) | const |
Confidence< bool > TypeBuilder::IsPure | ( | ) | const |
Ref< Enumeration > TypeBuilder::GetEnumeration | ( | ) | const |
Ref< NamedTypeReference > TypeBuilder::GetNamedTypeReference | ( | ) | const |
Confidence< BNMemberScope > BinaryNinja::TypeBuilder::GetScope | ( | ) | const |
BNNameType TypeBuilder::GetNameType | ( | ) | const |
bool TypeBuilder::HasTemplateArguments | ( | ) | const |
TypeBuilder & TypeBuilder::SetWidth | ( | size_t | width | ) |
TypeBuilder & TypeBuilder::SetAlignment | ( | size_t | alignment | ) |
TypeBuilder & TypeBuilder::SetNamedTypeReference | ( | NamedTypeReference * | ntr | ) |
TypeBuilder & BinaryNinja::TypeBuilder::SetScope | ( | const Confidence< BNMemberScope > & | scope | ) |
TypeBuilder & TypeBuilder::SetConst | ( | const Confidence< bool > & | cnst | ) |
TypeBuilder & TypeBuilder::SetVolatile | ( | const Confidence< bool > & | vltl | ) |
TypeBuilder & TypeBuilder::SetChildType | ( | const Confidence< Ref< Type > > & | child | ) |
TypeBuilder & TypeBuilder::SetCallingConvention | ( | const Confidence< Ref< CallingConvention > > & | cc | ) |
TypeBuilder & TypeBuilder::SetCallingConventionName | ( | BNCallingConventionName | cc | ) |
TypeBuilder & TypeBuilder::SetSigned | ( | const Confidence< bool > & | vltl | ) |
TypeBuilder & TypeBuilder::SetTypeName | ( | const QualifiedName & | name | ) |
TypeBuilder & TypeBuilder::SetAlternateName | ( | const std::string & | name | ) |
TypeBuilder & TypeBuilder::SetSystemCall | ( | bool | sc, |
uint32_t | n = 0 ) |
TypeBuilder & TypeBuilder::SetNameType | ( | BNNameType | type | ) |
TypeBuilder & TypeBuilder::SetHasTemplateArguments | ( | bool | hasTemplateArguments | ) |
Confidence< int64_t > TypeBuilder::GetStackAdjustment | ( | ) | const |
QualifiedName TypeBuilder::GetStructureName | ( | ) | const |
uint64_t TypeBuilder::GetElementCount | ( | ) | const |
uint64_t TypeBuilder::GetOffset | ( | ) | const |
uint32_t TypeBuilder::GetSystemCallNumber | ( | ) | const |
BNPointerBaseType TypeBuilder::GetPointerBaseType | ( | ) | const |
int64_t TypeBuilder::GetPointerBaseOffset | ( | ) | const |
TypeBuilder & TypeBuilder::SetOffset | ( | uint64_t | offset | ) |
TypeBuilder & TypeBuilder::SetFunctionCanReturn | ( | const Confidence< bool > & | canReturn | ) |
TypeBuilder & TypeBuilder::SetPure | ( | const Confidence< bool > & | pure | ) |
TypeBuilder & TypeBuilder::SetParameters | ( | const std::vector< FunctionParameter > & | params | ) |
TypeBuilder & TypeBuilder::SetPointerBase | ( | BNPointerBaseType | baseType, |
int64_t | baseOffset ) |
std::set< BNPointerSuffix > TypeBuilder::GetPointerSuffix | ( | ) | const |
std::string TypeBuilder::GetPointerSuffixString | ( | ) | const |
std::vector< InstructionTextToken > TypeBuilder::GetPointerSuffixTokens | ( | uint8_t | baseConfidence = 255 | ) | const |
TypeBuilder & TypeBuilder::AddPointerSuffix | ( | BNPointerSuffix | ps | ) |
TypeBuilder & TypeBuilder::SetPointerSuffix | ( | const std::set< BNPointerSuffix > & | suffix | ) |
string TypeBuilder::GetString | ( | Platform * | platform = nullptr | ) | const |
string TypeBuilder::GetTypeAndName | ( | const QualifiedName & | name | ) | const |
string TypeBuilder::GetStringBeforeName | ( | Platform * | platform = nullptr | ) | const |
string TypeBuilder::GetStringAfterName | ( | Platform * | platform = nullptr | ) | const |
vector< InstructionTextToken > TypeBuilder::GetTokens | ( | Platform * | platform = nullptr, |
uint8_t | baseConfidence = 255 ) const |
vector< InstructionTextToken > TypeBuilder::GetTokensBeforeName | ( | Platform * | platform = nullptr, |
uint8_t | baseConfidence = 255 ) const |
vector< InstructionTextToken > TypeBuilder::GetTokensAfterName | ( | Platform * | platform = nullptr, |
uint8_t | baseConfidence = 255 ) const |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool BinaryNinja::TypeBuilder::IsReferenceOfType | ( | BNNamedTypeReferenceClass | refType | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
class BinaryNinja::NamedTypeReference |
Additional Inherited Members | |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNNamedTypeReference, BNNewNamedTypeReference, BNFreeNamedTypeReference > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNNamedTypeReference * | m_object |
NamedTypeReference::NamedTypeReference | ( | BNNamedTypeReference * | nt | ) |
BinaryNinja::NamedTypeReference::NamedTypeReference | ( | BNNamedTypeReferenceClass | cls = UnknownNamedTypeClass, |
const std::string & | id = "", | ||
const QualifiedName & | name = QualifiedName() ) |
BNNamedTypeReferenceClass NamedTypeReference::GetTypeReferenceClass | ( | ) | const |
string NamedTypeReference::GetTypeId | ( | ) | const |
QualifiedName NamedTypeReference::GetName | ( | ) | const |
|
static |
|
static |
|
static |
class BinaryNinja::NamedTypeReferenceBuilder |
Public Member Functions | |
NamedTypeReferenceBuilder (BNNamedTypeReferenceBuilder *nt) | |
NamedTypeReferenceBuilder (BNNamedTypeReferenceClass cls=UnknownNamedTypeClass, const std::string &id="", const QualifiedName &name=QualifiedName()) | |
~NamedTypeReferenceBuilder () | |
BNNamedTypeReferenceBuilder * | GetObject () |
BNNamedTypeReferenceClass | GetTypeReferenceClass () const |
std::string | GetTypeId () const |
QualifiedName | GetName () const |
void | SetTypeReferenceClass (BNNamedTypeReferenceClass type) |
void | SetTypeId (const std::string &id) |
void | SetName (const QualifiedName &name) |
Ref< NamedTypeReference > | Finalize () |
NamedTypeReferenceBuilder::NamedTypeReferenceBuilder | ( | BNNamedTypeReferenceBuilder * | nt | ) |
NamedTypeReferenceBuilder::NamedTypeReferenceBuilder | ( | BNNamedTypeReferenceClass | cls = UnknownNamedTypeClass, |
const std::string & | id = "", | ||
const QualifiedName & | name = QualifiedName() ) |
NamedTypeReferenceBuilder::~NamedTypeReferenceBuilder | ( | ) |
|
inline |
BNNamedTypeReferenceClass NamedTypeReferenceBuilder::GetTypeReferenceClass | ( | ) | const |
std::string NamedTypeReferenceBuilder::GetTypeId | ( | ) | const |
QualifiedName NamedTypeReferenceBuilder::GetName | ( | ) | const |
void NamedTypeReferenceBuilder::SetTypeReferenceClass | ( | BNNamedTypeReferenceClass | type | ) |
void NamedTypeReferenceBuilder::SetTypeId | ( | const std::string & | id | ) |
void NamedTypeReferenceBuilder::SetName | ( | const QualifiedName & | name | ) |
Ref< NamedTypeReference > NamedTypeReferenceBuilder::Finalize | ( | ) |
struct BinaryNinja::StructureMember |
Class Members | ||
---|---|---|
Confidence< Ref< Type > > | type | |
string | name | |
uint64_t | offset | |
BNMemberAccess | access | |
BNMemberScope | scope |
struct BinaryNinja::InheritedStructureMember |
Class Members | ||
---|---|---|
Ref< NamedTypeReference > | base | |
uint64_t | baseOffset | |
StructureMember | member | |
size_t | memberIndex |
struct BinaryNinja::BaseStructure |
Public Member Functions | |
BaseStructure (NamedTypeReference *type, uint64_t offset, uint64_t width) | |
BaseStructure (Type *type, uint64_t offset) | |
Public Attributes | |
Ref< NamedTypeReference > | type |
uint64_t | offset |
uint64_t | width |
BaseStructure::BaseStructure | ( | NamedTypeReference * | type, |
uint64_t | offset, | ||
uint64_t | width ) |
BaseStructure::BaseStructure | ( | Type * | type, |
uint64_t | offset ) |
Ref<NamedTypeReference> BinaryNinja::BaseStructure::type |
uint64_t BinaryNinja::BaseStructure::offset |
uint64_t BinaryNinja::BaseStructure::width |
class BinaryNinja::Structure |
Structure is a class that wraps built structures and retrieves info about them.
Public Member Functions | |
Structure (BNStructure *s) | |
std::vector< BaseStructure > | GetBaseStructures () const |
Get a list of base structures. | |
std::vector< StructureMember > | GetMembers () const |
Get a list of Structure members, excluding those inherited from base structures. | |
std::vector< InheritedStructureMember > | GetMembersIncludingInherited (const TypeContainer &types) const |
Get a list of Structure members, including those inherited from base structures. | |
bool | GetMemberIncludingInheritedAtOffset (BinaryView *view, int64_t offset, InheritedStructureMember &result) const |
Get a structure member (including inherited members) at a certain offset. | |
bool | GetMemberByName (const std::string &name, StructureMember &result) const |
Get a structure member by name. | |
bool | GetMemberAtOffset (int64_t offset, StructureMember &result) const |
Get a structure member at a certain offset. | |
bool | GetMemberAtOffset (int64_t offset, StructureMember &result, size_t &idx) const |
Get a structure member and its index at a certain offset. | |
uint64_t | GetWidth () const |
Get the structure width in bytes. | |
int64_t | GetPointerOffset () const |
Get the structure pointer offset in bytes. | |
size_t | GetAlignment () const |
Get the structure alignment. | |
bool | IsPacked () const |
Whether the structure is packed. | |
bool | IsUnion () const |
Whether the structure is a union. | |
bool | PropagateDataVariableReferences () const |
Whether structure field references propagate the references to data variable field values. | |
BNStructureVariant | GetStructureType () const |
Get the structure type. | |
Ref< Structure > | WithReplacedStructure (Structure *from, Structure *to) |
Ref< Structure > | WithReplacedEnumeration (Enumeration *from, Enumeration *to) |
Ref< Structure > | WithReplacedNamedTypeReference (NamedTypeReference *from, NamedTypeReference *to) |
bool | ResolveMemberOrBaseMember (BinaryView *data, uint64_t offset, size_t size, const std::function< void(NamedTypeReference *baseName, Structure *s, size_t memberIndex, uint64_t structOffset, uint64_t adjustedOffset, const StructureMember &member)> &resolveFunc, std::optional< size_t > memberIndexHint=std::nullopt) |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNStructure, BNNewStructureReference, BNFreeStructure > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNStructure * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNStructure, BNNewStructureReference, BNFreeStructure > | |
static BNStructure * | GetObject (CoreRefCountObject *obj) |
static BNStructure * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNStructure, BNNewStructureReference, BNFreeStructure > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNStructure * | m_object |
Structure::Structure | ( | BNStructure * | s | ) |
vector< BaseStructure > Structure::GetBaseStructures | ( | ) | const |
Get a list of base structures.
Offsets that are not defined by this structure will be filled in by the fields of the base structure(s).
vector< StructureMember > Structure::GetMembers | ( | ) | const |
Get a list of Structure members, excluding those inherited from base structures.
vector< InheritedStructureMember > Structure::GetMembersIncludingInherited | ( | const TypeContainer & | types | ) | const |
Get a list of Structure members, including those inherited from base structures.
bool Structure::GetMemberIncludingInheritedAtOffset | ( | BinaryView * | view, |
int64_t | offset, | ||
InheritedStructureMember & | result ) const |
Get a structure member (including inherited members) at a certain offset.
view | The relevant binary view |
offset | Offset to check |
result | Reference to a InheritedStructureMember to copy the result to |
bool Structure::GetMemberByName | ( | const std::string & | name, |
StructureMember & | result ) const |
Get a structure member by name.
name | Name of the member to retrieve |
result | Reference to a StructureMember to copy the result to |
bool Structure::GetMemberAtOffset | ( | int64_t | offset, |
StructureMember & | result ) const |
Get a structure member at a certain offset.
offset | Offset to check |
result | Reference to a StructureMember to copy the result to |
bool Structure::GetMemberAtOffset | ( | int64_t | offset, |
StructureMember & | result, | ||
size_t & | idx ) const |
Get a structure member and its index at a certain offset.
offset | Offset to check |
result | Reference to a StructureMember to copy the result to |
idx | Reference to a size_t to copy the index to |
uint64_t Structure::GetWidth | ( | ) | const |
Get the structure width in bytes.
int64_t Structure::GetPointerOffset | ( | ) | const |
Get the structure pointer offset in bytes.
Pointers to this structure will implicitly have this offset subtracted from the pointer to arrive at the start of the structure. Effectively, the pointer offset becomes the new start of the structure, and fields before it are accessed using negative offsets from the pointer.
size_t Structure::GetAlignment | ( | ) | const |
Get the structure alignment.
bool Structure::IsPacked | ( | ) | const |
Whether the structure is packed.
bool Structure::IsUnion | ( | ) | const |
Whether the structure is a union.
bool Structure::PropagateDataVariableReferences | ( | ) | const |
Whether structure field references propagate the references to data variable field values.
BNStructureVariant Structure::GetStructureType | ( | ) | const |
Get the structure type.
Ref< Structure > Structure::WithReplacedEnumeration | ( | Enumeration * | from, |
Enumeration * | to ) |
Ref< Structure > Structure::WithReplacedNamedTypeReference | ( | NamedTypeReference * | from, |
NamedTypeReference * | to ) |
bool Structure::ResolveMemberOrBaseMember | ( | BinaryView * | data, |
uint64_t | offset, | ||
size_t | size, | ||
const std::function< void(NamedTypeReference *baseName, Structure *s, size_t memberIndex, uint64_t structOffset, uint64_t adjustedOffset, const StructureMember &member)> & | resolveFunc, | ||
std::optional< size_t > | memberIndexHint = std::nullopt ) |
class BinaryNinja::StructureBuilder |
StructureBuilder is a convenience class used for building Structure Types.
Example:
Public Member Functions | |
StructureBuilder () | |
StructureBuilder (BNStructureBuilder *s) | |
StructureBuilder (BNStructureVariant type, bool packed=false) | |
StructureBuilder (const StructureBuilder &s) | |
StructureBuilder (StructureBuilder &&s) | |
StructureBuilder (Structure *s) | |
~StructureBuilder () | |
StructureBuilder & | operator= (const StructureBuilder &s) |
StructureBuilder & | operator= (StructureBuilder &&s) |
StructureBuilder & | operator= (Structure *s) |
BNStructureBuilder * | GetObject () |
Ref< Structure > | Finalize () const |
Complete the structure building process and return a Structure object. | |
std::vector< BaseStructure > | GetBaseStructures () const |
StructureBuilder & | SetBaseStructures (const std::vector< BaseStructure > &bases) |
std::vector< StructureMember > | GetMembers () const |
GetMembers returns a list of structure members. | |
bool | GetMemberByName (const std::string &name, StructureMember &result) const |
GetMemberByName retrieves a structure member by name. | |
bool | GetMemberAtOffset (int64_t offset, StructureMember &result) const |
bool | GetMemberAtOffset (int64_t offset, StructureMember &result, size_t &idx) const |
uint64_t | GetWidth () const |
StructureBuilder & | SetWidth (size_t width) |
int64_t | GetPointerOffset () const |
StructureBuilder & | SetPointerOffset (int64_t offset) |
size_t | GetAlignment () const |
StructureBuilder & | SetAlignment (size_t align) |
bool | IsPacked () const |
StructureBuilder & | SetPacked (bool packed) |
bool | IsUnion () const |
bool | PropagateDataVariableReferences () const |
StructureBuilder & | SetPropagateDataVariableReferences (bool value) |
StructureBuilder & | SetStructureType (BNStructureVariant type) |
Set the structure type. | |
BNStructureVariant | GetStructureType () const |
Get the Structure Type. | |
StructureBuilder & | AddMember (const Confidence< Ref< Type > > &type, const std::string &name, BNMemberAccess access=NoAccess, BNMemberScope scope=NoScope) |
AddMember adds a member (field) to a structure. | |
StructureBuilder & | AddMemberAtOffset (const Confidence< Ref< Type > > &type, const std::string &name, uint64_t offset, bool overwriteExisting=true, BNMemberAccess access=NoAccess, BNMemberScope scope=NoScope) |
AddMemberAtOffset adds a member at a specific offset within the struct. | |
StructureBuilder & | RemoveMember (size_t idx) |
RemoveMember removes a member at a specified index. | |
StructureBuilder & | ReplaceMember (size_t idx, const Confidence< Ref< Type > > &type, const std::string &name, bool overwriteExisting=true) |
ReplaceMember replaces a member at an index. | |
StructureBuilder::StructureBuilder | ( | ) |
StructureBuilder::StructureBuilder | ( | BNStructureBuilder * | s | ) |
StructureBuilder::StructureBuilder | ( | BNStructureVariant | type, |
bool | packed = false ) |
StructureBuilder::StructureBuilder | ( | const StructureBuilder & | s | ) |
StructureBuilder::StructureBuilder | ( | StructureBuilder && | s | ) |
StructureBuilder::StructureBuilder | ( | Structure * | s | ) |
StructureBuilder::~StructureBuilder | ( | ) |
StructureBuilder & StructureBuilder::operator= | ( | const StructureBuilder & | s | ) |
StructureBuilder & StructureBuilder::operator= | ( | StructureBuilder && | s | ) |
StructureBuilder & StructureBuilder::operator= | ( | Structure * | s | ) |
|
inline |
vector< BaseStructure > StructureBuilder::GetBaseStructures | ( | ) | const |
StructureBuilder & StructureBuilder::SetBaseStructures | ( | const std::vector< BaseStructure > & | bases | ) |
vector< StructureMember > StructureBuilder::GetMembers | ( | ) | const |
GetMembers returns a list of structure members.
bool StructureBuilder::GetMemberByName | ( | const std::string & | name, |
StructureMember & | result ) const |
GetMemberByName retrieves a structure member by name.
name | Name of the member (field) |
result | Reference to a StructureMember object the field will be passed to |
bool StructureBuilder::GetMemberAtOffset | ( | int64_t | offset, |
StructureMember & | result ) const |
bool StructureBuilder::GetMemberAtOffset | ( | int64_t | offset, |
StructureMember & | result, | ||
size_t & | idx ) const |
uint64_t StructureBuilder::GetWidth | ( | ) | const |
StructureBuilder & StructureBuilder::SetWidth | ( | size_t | width | ) |
int64_t StructureBuilder::GetPointerOffset | ( | ) | const |
StructureBuilder & StructureBuilder::SetPointerOffset | ( | int64_t | offset | ) |
size_t StructureBuilder::GetAlignment | ( | ) | const |
StructureBuilder & StructureBuilder::SetAlignment | ( | size_t | align | ) |
bool StructureBuilder::IsPacked | ( | ) | const |
StructureBuilder & StructureBuilder::SetPacked | ( | bool | packed | ) |
bool StructureBuilder::IsUnion | ( | ) | const |
bool StructureBuilder::PropagateDataVariableReferences | ( | ) | const |
StructureBuilder & StructureBuilder::SetPropagateDataVariableReferences | ( | bool | value | ) |
StructureBuilder & StructureBuilder::SetStructureType | ( | BNStructureVariant | type | ) |
Set the structure type.
type | One of: ClassStructureType, StructStructureType, UnionStructureType |
BNStructureVariant StructureBuilder::GetStructureType | ( | ) | const |
StructureBuilder & StructureBuilder::AddMember | ( | const Confidence< Ref< Type > > & | type, |
const std::string & | name, | ||
BNMemberAccess | access = NoAccess, | ||
BNMemberScope | scope = NoScope ) |
AddMember adds a member (field) to a structure.
type | Type of the Field |
name | Name of the field |
access | Optional, One of NoAccess, PrivateAccess, ProtectedAccess, PublicAccess |
scope | Optional, One of NoScope, StaticScope, VirtualScope, ThunkScope, FriendScope |
StructureBuilder & StructureBuilder::AddMemberAtOffset | ( | const Confidence< Ref< Type > > & | type, |
const std::string & | name, | ||
uint64_t | offset, | ||
bool | overwriteExisting = true, | ||
BNMemberAccess | access = NoAccess, | ||
BNMemberScope | scope = NoScope ) |
AddMemberAtOffset adds a member at a specific offset within the struct.
type | Type of the Field |
name | Name of the field |
offset | Offset to add the member within the struct |
overwriteExisting | Whether to overwrite an existing member at that offset, Optional, default true |
access | One of NoAccess, PrivateAccess, ProtectedAccess, PublicAccess |
scope | One of NoScope, StaticScope, VirtualScope, ThunkScope, FriendScope |
StructureBuilder & StructureBuilder::RemoveMember | ( | size_t | idx | ) |
RemoveMember removes a member at a specified index.
idx | Index to remove |
StructureBuilder & StructureBuilder::ReplaceMember | ( | size_t | idx, |
const Confidence< Ref< Type > > & | type, | ||
const std::string & | name, | ||
bool | overwriteExisting = true ) |
ReplaceMember replaces a member at an index.
idx | Index of the StructureMember to be replaced |
type | Type of the new Member |
name | Name of the new Member |
overwriteExisting | Whether to overwrite the existing member, default true |
class BinaryNinja::Enumeration |
Public Member Functions | |
Enumeration (BNEnumeration *e) | |
std::vector< InstructionTextToken > | GetTokensForValue (uint64_t value, size_t width, Ref< Type > type) |
std::vector< EnumerationMember > | GetMembers () const |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNEnumeration, BNNewEnumerationReference, BNFreeEnumeration > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNEnumeration * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNEnumeration, BNNewEnumerationReference, BNFreeEnumeration > | |
static BNEnumeration * | GetObject (CoreRefCountObject *obj) |
static BNEnumeration * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNEnumeration, BNNewEnumerationReference, BNFreeEnumeration > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNEnumeration * | m_object |
Enumeration::Enumeration | ( | BNEnumeration * | e | ) |
vector< InstructionTextToken > Enumeration::GetTokensForValue | ( | uint64_t | value, |
size_t | width, | ||
Ref< Type > | type ) |
vector< EnumerationMember > Enumeration::GetMembers | ( | ) | const |
class BinaryNinja::EnumerationBuilder |
EnumerationBuilder is a convenience class used for building Enumeration Types.
Example:
Public Member Functions | |
EnumerationBuilder () | |
EnumerationBuilder (BNEnumerationBuilder *e) | |
EnumerationBuilder (const EnumerationBuilder &e) | |
EnumerationBuilder (EnumerationBuilder &&e) | |
EnumerationBuilder (Enumeration *e) | |
~EnumerationBuilder () | |
BNEnumerationBuilder * | GetObject () |
EnumerationBuilder & | operator= (const EnumerationBuilder &e) |
EnumerationBuilder & | operator= (EnumerationBuilder &&e) |
EnumerationBuilder & | operator= (Enumeration *e) |
Ref< Enumeration > | Finalize () const |
Finalize the building process and return the built Enumeration. | |
std::vector< EnumerationMember > | GetMembers () const |
Get a list of members in this enum. | |
EnumerationBuilder & | AddMember (const std::string &name) |
Add a member to the enum. | |
EnumerationBuilder & | AddMemberWithValue (const std::string &name, uint64_t value) |
Add a member to the enum with a set value. | |
EnumerationBuilder & | RemoveMember (size_t idx) |
Remove a member from the enum. | |
EnumerationBuilder & | ReplaceMember (size_t idx, const std::string &name, uint64_t value) |
Replace a member at an index. | |
EnumerationBuilder::EnumerationBuilder | ( | ) |
EnumerationBuilder::EnumerationBuilder | ( | BNEnumerationBuilder * | e | ) |
EnumerationBuilder::EnumerationBuilder | ( | const EnumerationBuilder & | e | ) |
EnumerationBuilder::EnumerationBuilder | ( | EnumerationBuilder && | e | ) |
EnumerationBuilder::EnumerationBuilder | ( | Enumeration * | e | ) |
EnumerationBuilder::~EnumerationBuilder | ( | ) |
|
inline |
EnumerationBuilder & EnumerationBuilder::operator= | ( | const EnumerationBuilder & | e | ) |
EnumerationBuilder & EnumerationBuilder::operator= | ( | EnumerationBuilder && | e | ) |
EnumerationBuilder & EnumerationBuilder::operator= | ( | Enumeration * | e | ) |
Ref< Enumeration > EnumerationBuilder::Finalize | ( | ) | const |
Finalize the building process and return the built Enumeration.
vector< EnumerationMember > EnumerationBuilder::GetMembers | ( | ) | const |
Get a list of members in this enum.
EnumerationBuilder & EnumerationBuilder::AddMember | ( | const std::string & | name | ) |
Add a member to the enum.
name | Name of the enum member |
EnumerationBuilder & EnumerationBuilder::AddMemberWithValue | ( | const std::string & | name, |
uint64_t | value ) |
Add a member to the enum with a set value.
name | Name of the enum member |
value | Value of th enum member |
EnumerationBuilder & EnumerationBuilder::RemoveMember | ( | size_t | idx | ) |
Remove a member from the enum.
idx | Index to remove |
EnumerationBuilder & EnumerationBuilder::ReplaceMember | ( | size_t | idx, |
const std::string & | name, | ||
uint64_t | value ) |
Replace a member at an index.
idx | Index to replace |
name | Name of the new member |
value | Value of the new member |
class BinaryNinja::TypeContainer |
A TypeContainer is a generic interface to access various Binary Ninja models that contain types.
Types are stored with both a unique id and a unique name.
Public Member Functions | |
TypeContainer (BNTypeContainer *container) | |
TypeContainer (Ref< BinaryView > data) | |
Get the Type Container for a given BinaryView. | |
TypeContainer (Ref< TypeLibrary > library) | |
Get the Type Container for a Type Library. | |
TypeContainer (Ref< TypeArchive > archive) | |
Get the Type Container for a Type Archive. | |
TypeContainer (Ref< Platform > platform) | |
Get the Type Container for a Platform. | |
~TypeContainer () | |
TypeContainer (const TypeContainer &other) | |
TypeContainer (TypeContainer &&other) | |
TypeContainer & | operator= (const TypeContainer &other) |
TypeContainer & | operator= (TypeContainer &&other) |
bool | operator== (const TypeContainer &other) const |
bool | operator!= (const TypeContainer &other) const |
BNTypeContainer * | GetObject () const |
std::string | GetId () const |
Get an id string for the Type Container. | |
std::string | GetName () const |
Get a user-friendly name for the Type Container. | |
BNTypeContainerType | GetType () const |
Get the type of underlying model the Type Container is accessing. | |
bool | IsMutable () const |
Test if the Type Container supports mutable operations (add, rename, delete) | |
Ref< Platform > | GetPlatform () const |
Get the Platform object associated with this Type Container. | |
std::optional< std::string > | AddType (QualifiedName name, Ref< Type > type) |
Add or update a single type in the Type Container. | |
std::optional< std::unordered_map< QualifiedName, std::string > > | AddTypes (const std::vector< std::pair< QualifiedName, Ref< Type > > > &types, std::function< bool(size_t, size_t)> progress={}) |
Add or update types to a Type Container. | |
bool | RenameType (const std::string &typeId, const QualifiedName &newName) |
Rename a type in the Type Container. | |
bool | DeleteType (const std::string &typeId) |
Delete a type in the Type Container. | |
std::optional< std::string > | GetTypeId (const QualifiedName &typeName) const |
Get the unique id of the type in the Type Container with the given name. | |
std::optional< QualifiedName > | GetTypeName (const std::string &typeId) const |
Get the unique name of the type in the Type Container with the given id. | |
std::optional< Ref< Type > > | GetTypeById (const std::string &typeId) const |
Get the definition of the type in the Type Container with the given id. | |
std::optional< std::unordered_map< std::string, std::pair< QualifiedName, Ref< Type > > > > | GetTypes () const |
Get a mapping of all types in a Type Container. | |
std::optional< Ref< Type > > | GetTypeByName (const QualifiedName &typeName) const |
Get the definition of the type in the Type Container with the given name. | |
std::optional< std::unordered_set< std::string > > | GetTypeIds () const |
Get all type ids in a Type Container. | |
std::optional< std::unordered_set< QualifiedName > > | GetTypeNames () const |
Get all type names in a Type Container. | |
std::optional< std::unordered_map< std::string, QualifiedName > > | GetTypeNamesAndIds () const |
Get a mapping of all type ids and type names in a Type Container. | |
bool | ParseTypeString (const std::string &source, bool importDependencies, QualifiedNameAndType &result, std::vector< TypeParserError > &errors) |
Parse a single type and name from a string containing their definition, with knowledge of the types in the Type Container. | |
bool | ParseTypeString (const std::string &source, QualifiedNameAndType &result, std::vector< TypeParserError > &errors) |
bool | ParseTypesFromSource (const std::string &text, const std::string &fileName, const std::vector< std::string > &options, const std::vector< std::string > &includeDirs, const std::string &autoTypeSource, bool importDependencies, TypeParserResult &result, std::vector< TypeParserError > &errors) |
Parse an entire block of source into types, variables, and functions, with knowledge of the types in the Type Container. | |
bool | ParseTypesFromSource (const std::string &text, const std::string &fileName, const std::vector< std::string > &options, const std::vector< std::string > &includeDirs, const std::string &autoTypeSource, TypeParserResult &result, std::vector< TypeParserError > &errors) |
|
explicit |
TypeContainer::TypeContainer | ( | Ref< BinaryView > | data | ) |
Get the Type Container for a given BinaryView.
data | BinaryView source |
TypeContainer::TypeContainer | ( | Ref< TypeLibrary > | library | ) |
TypeContainer::TypeContainer | ( | Ref< TypeArchive > | archive | ) |
Get the Type Container for a Type Archive.
archive | TypeArchive source |
TypeContainer::~TypeContainer | ( | ) |
TypeContainer::TypeContainer | ( | const TypeContainer & | other | ) |
TypeContainer::TypeContainer | ( | TypeContainer && | other | ) |
TypeContainer & TypeContainer::operator= | ( | const TypeContainer & | other | ) |
TypeContainer & TypeContainer::operator= | ( | TypeContainer && | other | ) |
|
inline |
|
inline |
|
inline |
std::string TypeContainer::GetId | ( | ) | const |
Get an id string for the Type Container.
This will be unique within a given analysis session, but may not be globally unique.
std::string TypeContainer::GetName | ( | ) | const |
Get a user-friendly name for the Type Container.
BNTypeContainerType TypeContainer::GetType | ( | ) | const |
Get the type of underlying model the Type Container is accessing.
bool TypeContainer::IsMutable | ( | ) | const |
Test if the Type Container supports mutable operations (add, rename, delete)
std::optional< std::string > TypeContainer::AddType | ( | QualifiedName | name, |
Ref< Type > | type ) |
Add or update a single type in the Type Container.
If the Type Container already contains a type with the same name as a type being added, the existing type will be replaced with the definition given to this function, and references will be updated in the source model.
name | Name of type to add |
type | Definition of type to add |
std::optional< std::unordered_map< QualifiedName, std::string > > TypeContainer::AddTypes | ( | const std::vector< std::pair< QualifiedName, Ref< Type > > > & | types, |
std::function< bool(size_t, size_t)> | progress = {} ) |
Add or update types to a Type Container.
If the Type Container already contains a type with the same name as a type being added, the existing type will be replaced with the definition given to this function, and references will be updated in the source model.
An optional progress callback is included because adding many types can be a slow operation.
types | List of (name, definition) pairs of new types to add |
progress | Optional function to call for progress updates |
bool TypeContainer::RenameType | ( | const std::string & | typeId, |
const QualifiedName & | newName ) |
Rename a type in the Type Container.
All references to this type will be updated (by id) to use the new name.
typeId | Id of type to update |
newName | New name for the type |
bool TypeContainer::DeleteType | ( | const std::string & | typeId | ) |
Delete a type in the Type Container.
Behavior of references to this type is not specified and you may end up with broken references if any still exist.
typeId | Id of type to delete |
std::optional< std::string > TypeContainer::GetTypeId | ( | const QualifiedName & | typeName | ) | const |
std::optional< QualifiedName > TypeContainer::GetTypeName | ( | const std::string & | typeId | ) | const |
std::optional< std::unordered_map< std::string, std::pair< QualifiedName, Ref< Type > > > > TypeContainer::GetTypes | ( | ) | const |
Get a mapping of all types in a Type Container.
std::optional< Ref< Type > > TypeContainer::GetTypeByName | ( | const QualifiedName & | typeName | ) | const |
std::optional< std::unordered_set< std::string > > TypeContainer::GetTypeIds | ( | ) | const |
Get all type ids in a Type Container.
std::optional< std::unordered_set< QualifiedName > > TypeContainer::GetTypeNames | ( | ) | const |
Get all type names in a Type Container.
std::optional< std::unordered_map< std::string, QualifiedName > > TypeContainer::GetTypeNamesAndIds | ( | ) | const |
Get a mapping of all type ids and type names in a Type Container.
bool TypeContainer::ParseTypeString | ( | const std::string & | source, |
bool | importDependencies, | ||
BinaryNinja::QualifiedNameAndType & | result, | ||
std::vector< TypeParserError > & | errors ) |
Parse a single type and name from a string containing their definition, with knowledge of the types in the Type Container.
source | Source code to parse |
importDependencies | If Type Library / Type Archive types should be imported during parsing |
result | Reference into which the resulting type and name will be written |
errors | Reference to a list into which any parse errors will be written |
bool TypeContainer::ParseTypeString | ( | const std::string & | source, |
BinaryNinja::QualifiedNameAndType & | result, | ||
std::vector< TypeParserError > & | errors ) |
bool TypeContainer::ParseTypesFromSource | ( | const std::string & | text, |
const std::string & | fileName, | ||
const std::vector< std::string > & | options, | ||
const std::vector< std::string > & | includeDirs, | ||
const std::string & | autoTypeSource, | ||
bool | importDependencies, | ||
BinaryNinja::TypeParserResult & | result, | ||
std::vector< TypeParserError > & | errors ) |
Parse an entire block of source into types, variables, and functions, with knowledge of the types in the Type Container.
text | Source code to parse |
fileName | Name of the file containing the source (optional: exists on disk) |
options | Optional string arguments to pass as options, e.g. command line arguments |
includeDirs | Optional list of directories to include in the header search path |
autoTypeSource | Optional source of types if used for automatically generated types |
importDependencies | If Type Library / Type Archive types should be imported during parsing |
result | Reference to structure into which the results will be written |
errors | Reference to a list into which any parse errors will be written |
bool TypeContainer::ParseTypesFromSource | ( | const std::string & | text, |
const std::string & | fileName, | ||
const std::vector< std::string > & | options, | ||
const std::vector< std::string > & | includeDirs, | ||
const std::string & | autoTypeSource, | ||
BinaryNinja::TypeParserResult & | result, | ||
std::vector< TypeParserError > & | errors ) |