BinaryNinja::Architecture Class Referenceabstract

Detailed Description

The Architecture class is the base class for all CPU architectures.

This provides disassembly, assembly, patching, and IL translation lifting for a given architecture.

Public Member Functions

 Architecture (const std::string &name)
 
std::string GetName () const
 
virtual BNEndianness GetEndianness () const =0
 
virtual size_t GetAddressSize () const =0
 
virtual size_t GetDefaultIntegerSize () const
 
virtual size_t GetInstructionAlignment () const
 
virtual size_t GetMaxInstructionLength () const
 
virtual size_t GetOpcodeDisplayLength () const
 
virtual Ref< ArchitectureGetAssociatedArchitectureByAddress (uint64_t &addr)
 
virtual bool GetInstructionInfo (const uint8_t *data, uint64_t addr, size_t maxLen, InstructionInfo &result)=0
 
virtual bool GetInstructionText (const uint8_t *data, uint64_t addr, size_t &len, std::vector< InstructionTextToken > &result)=0
 
virtual bool GetInstructionLowLevelIL (const uint8_t *data, uint64_t addr, size_t &len, LowLevelILFunction &il)
 GetInstructionLowLevelIL Translates an instruction at addr and appends it onto the LowLevelILFunction& il. More...
 
virtual std::string GetRegisterName (uint32_t reg)
 
virtual std::string GetFlagName (uint32_t flag)
 
virtual std::string GetFlagWriteTypeName (uint32_t flags)
 
virtual std::string GetSemanticFlagClassName (uint32_t semClass)
 
virtual std::string GetSemanticFlagGroupName (uint32_t semGroup)
 
virtual std::vector< uint32_t > GetFullWidthRegisters ()
 
virtual std::vector< uint32_t > GetAllRegisters ()
 
virtual std::vector< uint32_t > GetAllFlags ()
 
virtual std::vector< uint32_t > GetAllFlagWriteTypes ()
 
virtual std::vector< uint32_t > GetAllSemanticFlagClasses ()
 
virtual std::vector< uint32_t > GetAllSemanticFlagGroups ()
 
virtual BNFlagRole GetFlagRole (uint32_t flag, uint32_t semClass=0)
 
virtual std::vector< uint32_t > GetFlagsRequiredForFlagCondition (BNLowLevelILFlagCondition cond, uint32_t semClass=0)
 
virtual std::vector< uint32_t > GetFlagsRequiredForSemanticFlagGroup (uint32_t semGroup)
 
virtual std::map< uint32_t, BNLowLevelILFlagConditionGetFlagConditionsForSemanticFlagGroup (uint32_t semGroup)
 
virtual std::vector< uint32_t > GetFlagsWrittenByFlagWriteType (uint32_t writeType)
 
virtual uint32_t GetSemanticClassForFlagWriteType (uint32_t writeType)
 
virtual ExprId GetFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, uint32_t flagWriteType, uint32_t flag, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il)
 
ExprId GetDefaultFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, BNFlagRole role, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il)
 
virtual ExprId GetFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il)
 
ExprId GetDefaultFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il)
 
virtual ExprId GetSemanticFlagGroupLowLevelIL (uint32_t semGroup, LowLevelILFunction &il)
 
virtual BNRegisterInfo GetRegisterInfo (uint32_t reg)
 
virtual uint32_t GetStackPointerRegister ()
 
virtual uint32_t GetLinkRegister ()
 
virtual std::vector< uint32_t > GetGlobalRegisters ()
 
bool IsGlobalRegister (uint32_t reg)
 
virtual std::vector< uint32_t > GetSystemRegisters ()
 
bool IsSystemRegister (uint32_t reg)
 
std::vector< uint32_t > GetModifiedRegistersOnWrite (uint32_t reg)
 
uint32_t GetRegisterByName (const std::string &name)
 
virtual std::string GetRegisterStackName (uint32_t regStack)
 
virtual std::vector< uint32_t > GetAllRegisterStacks ()
 
virtual BNRegisterStackInfo GetRegisterStackInfo (uint32_t regStack)
 
uint32_t GetRegisterStackForRegister (uint32_t reg)
 
virtual std::string GetIntrinsicName (uint32_t intrinsic)
 
virtual std::vector< uint32_t > GetAllIntrinsics ()
 
virtual std::vector< NameAndTypeGetIntrinsicInputs (uint32_t intrinsic)
 
virtual std::vector< Confidence< Ref< Type > > > GetIntrinsicOutputs (uint32_t intrinsic)
 
virtual bool CanAssemble ()
 
virtual bool Assemble (const std::string &code, uint64_t addr, DataBuffer &result, std::string &errors)
 
virtual bool IsNeverBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len)
 IsNeverBranchPatchAvailable returns true if the instruction at addr can be patched to never branch. More...
 
virtual bool IsAlwaysBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len)
 IsAlwaysBranchPatchAvailable returns true if the instruction at addr can be patched to always branch. More...
 
virtual bool IsInvertBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len)
 IsInvertBranchPatchAvailable returns true if the instruction at addr can be patched to invert the branch. More...
 
virtual bool IsSkipAndReturnZeroPatchAvailable (const uint8_t *data, uint64_t addr, size_t len)
 IsSkipAndReturnZeroPatchAvailable returns true if the instruction at addr is a call that can be patched to return zero. More...
 
virtual bool IsSkipAndReturnValuePatchAvailable (const uint8_t *data, uint64_t addr, size_t len)
 IsSkipAndReturnValuePatchAvailable returns true if the instruction at addr is a call that can be patched to return a value. More...
 
virtual bool ConvertToNop (uint8_t *data, uint64_t addr, size_t len)
 ConvertToNop converts the instruction at addr to a no-operation instruction. More...
 
virtual bool AlwaysBranch (uint8_t *data, uint64_t addr, size_t len)
 AlwaysBranch converts the conditional branch instruction at addr to an unconditional branch. More...
 
virtual bool InvertBranch (uint8_t *data, uint64_t addr, size_t len)
 InvertBranch converts the conditional branch instruction at addr to its invert. More...
 
virtual bool SkipAndReturnValue (uint8_t *data, uint64_t addr, size_t len, uint64_t value)
 SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value. More...
 
void RegisterFunctionRecognizer (FunctionRecognizer *recog)
 
void RegisterRelocationHandler (const std::string &viewName, RelocationHandler *handler)
 
Ref< RelocationHandlerGetRelocationHandler (const std::string &viewName)
 
bool IsBinaryViewTypeConstantDefined (const std::string &type, const std::string &name)
 
uint64_t GetBinaryViewTypeConstant (const std::string &type, const std::string &name, uint64_t defaultValue=0)
 
void SetBinaryViewTypeConstant (const std::string &type, const std::string &name, uint64_t value)
 
void RegisterCallingConvention (CallingConvention *cc)
 
std::vector< Ref< CallingConvention > > GetCallingConventions ()
 
Ref< CallingConventionGetCallingConventionByName (const std::string &name)
 
void SetDefaultCallingConvention (CallingConvention *cc)
 
void SetCdeclCallingConvention (CallingConvention *cc)
 
void SetStdcallCallingConvention (CallingConvention *cc)
 
void SetFastcallCallingConvention (CallingConvention *cc)
 
Ref< CallingConventionGetDefaultCallingConvention ()
 
Ref< CallingConventionGetCdeclCallingConvention ()
 
Ref< CallingConventionGetStdcallCallingConvention ()
 
Ref< CallingConventionGetFastcallCallingConvention ()
 
Ref< PlatformGetStandalonePlatform ()
 
void AddArchitectureRedirection (Architecture *from, Architecture *to)
 
- Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture >
 StaticCoreRefCountObject ()
 
virtual ~StaticCoreRefCountObject ()
 
BNArchitecture * GetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 

Static Public Member Functions

static void Register (Architecture *arch)
 
static Ref< ArchitectureGetByName (const std::string &name)
 
static std::vector< Ref< Architecture > > GetList ()
 
- Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture >
static BNArchitecture * GetObject (StaticCoreRefCountObject *obj)
 

Protected Member Functions

 Architecture (BNArchitecture *arch)
 
virtual void Register (BNCustomArchitecture *callbacks)
 

Static Protected Member Functions

static void InitCallback (void *ctxt, BNArchitecture *obj)
 
static BNEndianness GetEndiannessCallback (void *ctxt)
 
static size_t GetAddressSizeCallback (void *ctxt)
 
static size_t GetDefaultIntegerSizeCallback (void *ctxt)
 
static size_t GetInstructionAlignmentCallback (void *ctxt)
 
static size_t GetMaxInstructionLengthCallback (void *ctxt)
 
static size_t GetOpcodeDisplayLengthCallback (void *ctxt)
 
static BNArchitecture * GetAssociatedArchitectureByAddressCallback (void *ctxt, uint64_t *addr)
 
static bool GetInstructionInfoCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t maxLen, BNInstructionInfo *result)
 
static bool GetInstructionTextCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t *len, BNInstructionTextToken **result, size_t *count)
 
static void FreeInstructionTextCallback (BNInstructionTextToken *tokens, size_t count)
 
static bool GetInstructionLowLevelILCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t *len, BNLowLevelILFunction *il)
 
static char * GetRegisterNameCallback (void *ctxt, uint32_t reg)
 
static char * GetFlagNameCallback (void *ctxt, uint32_t flag)
 
static char * GetFlagWriteTypeNameCallback (void *ctxt, uint32_t flags)
 
static char * GetSemanticFlagClassNameCallback (void *ctxt, uint32_t semClass)
 
static char * GetSemanticFlagGroupNameCallback (void *ctxt, uint32_t semGroup)
 
static uint32_t * GetFullWidthRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetAllRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetAllFlagsCallback (void *ctxt, size_t *count)
 
static uint32_t * GetAllFlagWriteTypesCallback (void *ctxt, size_t *count)
 
static uint32_t * GetAllSemanticFlagClassesCallback (void *ctxt, size_t *count)
 
static uint32_t * GetAllSemanticFlagGroupsCallback (void *ctxt, size_t *count)
 
static BNFlagRole GetFlagRoleCallback (void *ctxt, uint32_t flag, uint32_t semClass)
 
static uint32_t * GetFlagsRequiredForFlagConditionCallback (void *ctxt, BNLowLevelILFlagCondition cond, uint32_t semClass, size_t *count)
 
static uint32_t * GetFlagsRequiredForSemanticFlagGroupCallback (void *ctxt, uint32_t semGroup, size_t *count)
 
static BNFlagConditionForSemanticClassGetFlagConditionsForSemanticFlagGroupCallback (void *ctxt, uint32_t semGroup, size_t *count)
 
static void FreeFlagConditionsForSemanticFlagGroupCallback (void *ctxt, BNFlagConditionForSemanticClass *conditions)
 
static uint32_t * GetFlagsWrittenByFlagWriteTypeCallback (void *ctxt, uint32_t writeType, size_t *count)
 
static uint32_t GetSemanticClassForFlagWriteTypeCallback (void *ctxt, uint32_t writeType)
 
static size_t GetFlagWriteLowLevelILCallback (void *ctxt, BNLowLevelILOperation op, size_t size, uint32_t flagWriteType, uint32_t flag, BNRegisterOrConstant *operands, size_t operandCount, BNLowLevelILFunction *il)
 
static size_t GetFlagConditionLowLevelILCallback (void *ctxt, BNLowLevelILFlagCondition cond, uint32_t semClass, BNLowLevelILFunction *il)
 
static size_t GetSemanticFlagGroupLowLevelILCallback (void *ctxt, uint32_t semGroup, BNLowLevelILFunction *il)
 
static void FreeRegisterListCallback (void *ctxt, uint32_t *regs)
 
static void GetRegisterInfoCallback (void *ctxt, uint32_t reg, BNRegisterInfo *result)
 
static uint32_t GetStackPointerRegisterCallback (void *ctxt)
 
static uint32_t GetLinkRegisterCallback (void *ctxt)
 
static uint32_t * GetGlobalRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetSystemRegistersCallback (void *ctxt, size_t *count)
 
static char * GetRegisterStackNameCallback (void *ctxt, uint32_t regStack)
 
static uint32_t * GetAllRegisterStacksCallback (void *ctxt, size_t *count)
 
static void GetRegisterStackInfoCallback (void *ctxt, uint32_t regStack, BNRegisterStackInfo *result)
 
static char * GetIntrinsicNameCallback (void *ctxt, uint32_t intrinsic)
 
static uint32_t * GetAllIntrinsicsCallback (void *ctxt, size_t *count)
 
static BNNameAndTypeGetIntrinsicInputsCallback (void *ctxt, uint32_t intrinsic, size_t *count)
 
static void FreeNameAndTypeListCallback (void *ctxt, BNNameAndType *nt, size_t count)
 
static BNTypeWithConfidenceGetIntrinsicOutputsCallback (void *ctxt, uint32_t intrinsic, size_t *count)
 
static void FreeTypeListCallback (void *ctxt, BNTypeWithConfidence *types, size_t count)
 
static bool CanAssembleCallback (void *ctxt)
 
static bool AssembleCallback (void *ctxt, const char *code, uint64_t addr, BNDataBuffer *result, char **errors)
 
static bool IsNeverBranchPatchAvailableCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t len)
 
static bool IsAlwaysBranchPatchAvailableCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t len)
 
static bool IsInvertBranchPatchAvailableCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t len)
 
static bool IsSkipAndReturnZeroPatchAvailableCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t len)
 
static bool IsSkipAndReturnValuePatchAvailableCallback (void *ctxt, const uint8_t *data, uint64_t addr, size_t len)
 
static bool ConvertToNopCallback (void *ctxt, uint8_t *data, uint64_t addr, size_t len)
 
static bool AlwaysBranchCallback (void *ctxt, uint8_t *data, uint64_t addr, size_t len)
 
static bool InvertBranchCallback (void *ctxt, uint8_t *data, uint64_t addr, size_t len)
 
static bool SkipAndReturnValueCallback (void *ctxt, uint8_t *data, uint64_t addr, size_t len, uint64_t value)
 

Protected Attributes

std::string m_nameForRegister
 

Additional Inherited Members

- Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture >
std::atomic< int > m_refs
 
BNArchitecture * m_object
 

Constructor & Destructor Documentation

◆ Architecture() [1/2]

Architecture::Architecture ( BNArchitecture *  arch)
protected

◆ Architecture() [2/2]

BinaryNinja::Architecture::Architecture ( const std::string &  name)

Member Function Documentation

◆ AddArchitectureRedirection()

void Architecture::AddArchitectureRedirection ( Architecture from,
Architecture to 
)

◆ AlwaysBranch()

bool Architecture::AlwaysBranch ( uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

AlwaysBranch converts the conditional branch instruction at addr to an unconditional branch.

This is called when the right-click context menu item "always branch" is selected in the UI.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ AlwaysBranchCallback()

bool Architecture::AlwaysBranchCallback ( void *  ctxt,
uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ Assemble()

bool Architecture::Assemble ( const std::string &  code,
uint64_t  addr,
DataBuffer result,
std::string &  errors 
)
virtual

◆ AssembleCallback()

bool Architecture::AssembleCallback ( void *  ctxt,
const char *  code,
uint64_t  addr,
BNDataBuffer *  result,
char **  errors 
)
staticprotected

◆ CanAssemble()

bool Architecture::CanAssemble ( )
virtual

◆ CanAssembleCallback()

bool Architecture::CanAssembleCallback ( void *  ctxt)
staticprotected

◆ ConvertToNop()

bool Architecture::ConvertToNop ( uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

ConvertToNop converts the instruction at addr to a no-operation instruction.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ ConvertToNopCallback()

bool Architecture::ConvertToNopCallback ( void *  ctxt,
uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ FreeFlagConditionsForSemanticFlagGroupCallback()

void Architecture::FreeFlagConditionsForSemanticFlagGroupCallback ( void *  ctxt,
BNFlagConditionForSemanticClass conditions 
)
staticprotected

◆ FreeInstructionTextCallback()

void Architecture::FreeInstructionTextCallback ( BNInstructionTextToken tokens,
size_t  count 
)
staticprotected

◆ FreeNameAndTypeListCallback()

void Architecture::FreeNameAndTypeListCallback ( void *  ctxt,
BNNameAndType nt,
size_t  count 
)
staticprotected

◆ FreeRegisterListCallback()

void Architecture::FreeRegisterListCallback ( void *  ctxt,
uint32_t *  regs 
)
staticprotected

◆ FreeTypeListCallback()

void Architecture::FreeTypeListCallback ( void *  ctxt,
BNTypeWithConfidence types,
size_t  count 
)
staticprotected

◆ GetAddressSize()

virtual size_t BinaryNinja::Architecture::GetAddressSize ( ) const
pure virtual

◆ GetAddressSizeCallback()

size_t Architecture::GetAddressSizeCallback ( void *  ctxt)
staticprotected

◆ GetAllFlags()

vector< uint32_t > Architecture::GetAllFlags ( )
virtual

◆ GetAllFlagsCallback()

uint32_t * Architecture::GetAllFlagsCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetAllFlagWriteTypes()

vector< uint32_t > Architecture::GetAllFlagWriteTypes ( )
virtual

◆ GetAllFlagWriteTypesCallback()

uint32_t * Architecture::GetAllFlagWriteTypesCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetAllIntrinsics()

vector< uint32_t > Architecture::GetAllIntrinsics ( )
virtual

◆ GetAllIntrinsicsCallback()

uint32_t * Architecture::GetAllIntrinsicsCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetAllRegisters()

vector< uint32_t > Architecture::GetAllRegisters ( )
virtual

◆ GetAllRegistersCallback()

uint32_t * Architecture::GetAllRegistersCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetAllRegisterStacks()

vector< uint32_t > Architecture::GetAllRegisterStacks ( )
virtual

◆ GetAllRegisterStacksCallback()

uint32_t * Architecture::GetAllRegisterStacksCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetAllSemanticFlagClasses()

vector< uint32_t > Architecture::GetAllSemanticFlagClasses ( )
virtual

◆ GetAllSemanticFlagClassesCallback()

uint32_t * Architecture::GetAllSemanticFlagClassesCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetAllSemanticFlagGroups()

vector< uint32_t > Architecture::GetAllSemanticFlagGroups ( )
virtual

◆ GetAllSemanticFlagGroupsCallback()

uint32_t * Architecture::GetAllSemanticFlagGroupsCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetAssociatedArchitectureByAddress()

Ref< Architecture > Architecture::GetAssociatedArchitectureByAddress ( uint64_t &  addr)
virtual

◆ GetAssociatedArchitectureByAddressCallback()

BNArchitecture * Architecture::GetAssociatedArchitectureByAddressCallback ( void *  ctxt,
uint64_t *  addr 
)
staticprotected

◆ GetBinaryViewTypeConstant()

uint64_t Architecture::GetBinaryViewTypeConstant ( const std::string &  type,
const std::string &  name,
uint64_t  defaultValue = 0 
)

◆ GetByName()

Ref< Architecture > Architecture::GetByName ( const std::string &  name)
static

◆ GetCallingConventionByName()

Ref< CallingConvention > Architecture::GetCallingConventionByName ( const std::string &  name)

◆ GetCallingConventions()

vector< Ref< CallingConvention > > Architecture::GetCallingConventions ( )

◆ GetCdeclCallingConvention()

Ref< CallingConvention > Architecture::GetCdeclCallingConvention ( )

◆ GetDefaultCallingConvention()

Ref< CallingConvention > Architecture::GetDefaultCallingConvention ( )

◆ GetDefaultFlagConditionLowLevelIL()

ExprId Architecture::GetDefaultFlagConditionLowLevelIL ( BNLowLevelILFlagCondition  cond,
uint32_t  semClass,
LowLevelILFunction il 
)

◆ GetDefaultFlagWriteLowLevelIL()

size_t Architecture::GetDefaultFlagWriteLowLevelIL ( BNLowLevelILOperation  op,
size_t  size,
BNFlagRole  role,
BNRegisterOrConstant operands,
size_t  operandCount,
LowLevelILFunction il 
)

◆ GetDefaultIntegerSize()

size_t Architecture::GetDefaultIntegerSize ( ) const
virtual

◆ GetDefaultIntegerSizeCallback()

size_t Architecture::GetDefaultIntegerSizeCallback ( void *  ctxt)
staticprotected

◆ GetEndianness()

virtual BNEndianness BinaryNinja::Architecture::GetEndianness ( ) const
pure virtual

◆ GetEndiannessCallback()

BNEndianness Architecture::GetEndiannessCallback ( void *  ctxt)
staticprotected

◆ GetFastcallCallingConvention()

Ref< CallingConvention > Architecture::GetFastcallCallingConvention ( )

◆ GetFlagConditionLowLevelIL()

ExprId Architecture::GetFlagConditionLowLevelIL ( BNLowLevelILFlagCondition  cond,
uint32_t  semClass,
LowLevelILFunction il 
)
virtual

◆ GetFlagConditionLowLevelILCallback()

size_t Architecture::GetFlagConditionLowLevelILCallback ( void *  ctxt,
BNLowLevelILFlagCondition  cond,
uint32_t  semClass,
BNLowLevelILFunction *  il 
)
staticprotected

◆ GetFlagConditionsForSemanticFlagGroup()

map< uint32_t, BNLowLevelILFlagCondition > Architecture::GetFlagConditionsForSemanticFlagGroup ( uint32_t  semGroup)
virtual

◆ GetFlagConditionsForSemanticFlagGroupCallback()

BNFlagConditionForSemanticClass * Architecture::GetFlagConditionsForSemanticFlagGroupCallback ( void *  ctxt,
uint32_t  semGroup,
size_t *  count 
)
staticprotected

◆ GetFlagName()

string Architecture::GetFlagName ( uint32_t  flag)
virtual

◆ GetFlagNameCallback()

char * Architecture::GetFlagNameCallback ( void *  ctxt,
uint32_t  flag 
)
staticprotected

◆ GetFlagRole()

BNFlagRole Architecture::GetFlagRole ( uint32_t  flag,
uint32_t  semClass = 0 
)
virtual

◆ GetFlagRoleCallback()

BNFlagRole Architecture::GetFlagRoleCallback ( void *  ctxt,
uint32_t  flag,
uint32_t  semClass 
)
staticprotected

◆ GetFlagsRequiredForFlagCondition()

vector< uint32_t > Architecture::GetFlagsRequiredForFlagCondition ( BNLowLevelILFlagCondition  cond,
uint32_t  semClass = 0 
)
virtual

◆ GetFlagsRequiredForFlagConditionCallback()

uint32_t * Architecture::GetFlagsRequiredForFlagConditionCallback ( void *  ctxt,
BNLowLevelILFlagCondition  cond,
uint32_t  semClass,
size_t *  count 
)
staticprotected

◆ GetFlagsRequiredForSemanticFlagGroup()

vector< uint32_t > Architecture::GetFlagsRequiredForSemanticFlagGroup ( uint32_t  semGroup)
virtual

◆ GetFlagsRequiredForSemanticFlagGroupCallback()

uint32_t * Architecture::GetFlagsRequiredForSemanticFlagGroupCallback ( void *  ctxt,
uint32_t  semGroup,
size_t *  count 
)
staticprotected

◆ GetFlagsWrittenByFlagWriteType()

vector< uint32_t > Architecture::GetFlagsWrittenByFlagWriteType ( uint32_t  writeType)
virtual

◆ GetFlagsWrittenByFlagWriteTypeCallback()

uint32_t * Architecture::GetFlagsWrittenByFlagWriteTypeCallback ( void *  ctxt,
uint32_t  writeType,
size_t *  count 
)
staticprotected

◆ GetFlagWriteLowLevelIL()

size_t Architecture::GetFlagWriteLowLevelIL ( BNLowLevelILOperation  op,
size_t  size,
uint32_t  flagWriteType,
uint32_t  flag,
BNRegisterOrConstant operands,
size_t  operandCount,
LowLevelILFunction il 
)
virtual

◆ GetFlagWriteLowLevelILCallback()

size_t Architecture::GetFlagWriteLowLevelILCallback ( void *  ctxt,
BNLowLevelILOperation  op,
size_t  size,
uint32_t  flagWriteType,
uint32_t  flag,
BNRegisterOrConstant operands,
size_t  operandCount,
BNLowLevelILFunction *  il 
)
staticprotected

◆ GetFlagWriteTypeName()

string Architecture::GetFlagWriteTypeName ( uint32_t  flags)
virtual

◆ GetFlagWriteTypeNameCallback()

char * Architecture::GetFlagWriteTypeNameCallback ( void *  ctxt,
uint32_t  flags 
)
staticprotected

◆ GetFullWidthRegisters()

vector< uint32_t > Architecture::GetFullWidthRegisters ( )
virtual

◆ GetFullWidthRegistersCallback()

uint32_t * Architecture::GetFullWidthRegistersCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetGlobalRegisters()

vector< uint32_t > Architecture::GetGlobalRegisters ( )
virtual

◆ GetGlobalRegistersCallback()

uint32_t * Architecture::GetGlobalRegistersCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ GetInstructionAlignment()

size_t Architecture::GetInstructionAlignment ( ) const
virtual

◆ GetInstructionAlignmentCallback()

size_t Architecture::GetInstructionAlignmentCallback ( void *  ctxt)
staticprotected

◆ GetInstructionInfo()

virtual bool BinaryNinja::Architecture::GetInstructionInfo ( const uint8_t *  data,
uint64_t  addr,
size_t  maxLen,
InstructionInfo result 
)
pure virtual

◆ GetInstructionInfoCallback()

bool Architecture::GetInstructionInfoCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t  maxLen,
BNInstructionInfo result 
)
staticprotected

◆ GetInstructionLowLevelIL()

bool Architecture::GetInstructionLowLevelIL ( const uint8_t *  data,
uint64_t  addr,
size_t &  len,
LowLevelILFunction il 
)
virtual

GetInstructionLowLevelIL Translates an instruction at addr and appends it onto the LowLevelILFunction& il.

Parameters
datapointer to the instruction data to be translated
addraddress of the instruction data to be translated
lenlength of the instruction data to be translated
ilthe LowLevelILFunction which

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ GetInstructionLowLevelILCallback()

bool Architecture::GetInstructionLowLevelILCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t *  len,
BNLowLevelILFunction *  il 
)
staticprotected

◆ GetInstructionText()

virtual bool BinaryNinja::Architecture::GetInstructionText ( const uint8_t *  data,
uint64_t  addr,
size_t &  len,
std::vector< InstructionTextToken > &  result 
)
pure virtual

◆ GetInstructionTextCallback()

bool Architecture::GetInstructionTextCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t *  len,
BNInstructionTextToken **  result,
size_t *  count 
)
staticprotected

◆ GetIntrinsicInputs()

vector< NameAndType > Architecture::GetIntrinsicInputs ( uint32_t  intrinsic)
virtual

◆ GetIntrinsicInputsCallback()

BNNameAndType * Architecture::GetIntrinsicInputsCallback ( void *  ctxt,
uint32_t  intrinsic,
size_t *  count 
)
staticprotected

◆ GetIntrinsicName()

string Architecture::GetIntrinsicName ( uint32_t  intrinsic)
virtual

◆ GetIntrinsicNameCallback()

char * Architecture::GetIntrinsicNameCallback ( void *  ctxt,
uint32_t  intrinsic 
)
staticprotected

◆ GetIntrinsicOutputs()

vector< Confidence< Ref< Type > > > Architecture::GetIntrinsicOutputs ( uint32_t  intrinsic)
virtual

◆ GetIntrinsicOutputsCallback()

BNTypeWithConfidence * Architecture::GetIntrinsicOutputsCallback ( void *  ctxt,
uint32_t  intrinsic,
size_t *  count 
)
staticprotected

◆ GetLinkRegister()

uint32_t Architecture::GetLinkRegister ( )
virtual

◆ GetLinkRegisterCallback()

uint32_t Architecture::GetLinkRegisterCallback ( void *  ctxt)
staticprotected

◆ GetList()

vector< Ref< Architecture > > Architecture::GetList ( )
static

◆ GetMaxInstructionLength()

size_t Architecture::GetMaxInstructionLength ( ) const
virtual

◆ GetMaxInstructionLengthCallback()

size_t Architecture::GetMaxInstructionLengthCallback ( void *  ctxt)
staticprotected

◆ GetModifiedRegistersOnWrite()

vector< uint32_t > Architecture::GetModifiedRegistersOnWrite ( uint32_t  reg)

◆ GetName()

string Architecture::GetName ( ) const

◆ GetOpcodeDisplayLength()

size_t Architecture::GetOpcodeDisplayLength ( ) const
virtual

◆ GetOpcodeDisplayLengthCallback()

size_t Architecture::GetOpcodeDisplayLengthCallback ( void *  ctxt)
staticprotected

◆ GetRegisterByName()

uint32_t Architecture::GetRegisterByName ( const std::string &  name)

◆ GetRegisterInfo()

BNRegisterInfo Architecture::GetRegisterInfo ( uint32_t  reg)
virtual

◆ GetRegisterInfoCallback()

void Architecture::GetRegisterInfoCallback ( void *  ctxt,
uint32_t  reg,
BNRegisterInfo result 
)
staticprotected

◆ GetRegisterName()

string Architecture::GetRegisterName ( uint32_t  reg)
virtual

◆ GetRegisterNameCallback()

char * Architecture::GetRegisterNameCallback ( void *  ctxt,
uint32_t  reg 
)
staticprotected

◆ GetRegisterStackForRegister()

uint32_t Architecture::GetRegisterStackForRegister ( uint32_t  reg)

◆ GetRegisterStackInfo()

BNRegisterStackInfo Architecture::GetRegisterStackInfo ( uint32_t  regStack)
virtual

◆ GetRegisterStackInfoCallback()

void Architecture::GetRegisterStackInfoCallback ( void *  ctxt,
uint32_t  regStack,
BNRegisterStackInfo result 
)
staticprotected

◆ GetRegisterStackName()

string Architecture::GetRegisterStackName ( uint32_t  regStack)
virtual

◆ GetRegisterStackNameCallback()

char * Architecture::GetRegisterStackNameCallback ( void *  ctxt,
uint32_t  regStack 
)
staticprotected

◆ GetRelocationHandler()

Ref< RelocationHandler > Architecture::GetRelocationHandler ( const std::string &  viewName)

◆ GetSemanticClassForFlagWriteType()

uint32_t Architecture::GetSemanticClassForFlagWriteType ( uint32_t  writeType)
virtual

◆ GetSemanticClassForFlagWriteTypeCallback()

uint32_t Architecture::GetSemanticClassForFlagWriteTypeCallback ( void *  ctxt,
uint32_t  writeType 
)
staticprotected

◆ GetSemanticFlagClassName()

string Architecture::GetSemanticFlagClassName ( uint32_t  semClass)
virtual

◆ GetSemanticFlagClassNameCallback()

char * Architecture::GetSemanticFlagClassNameCallback ( void *  ctxt,
uint32_t  semClass 
)
staticprotected

◆ GetSemanticFlagGroupLowLevelIL()

ExprId Architecture::GetSemanticFlagGroupLowLevelIL ( uint32_t  semGroup,
LowLevelILFunction il 
)
virtual

◆ GetSemanticFlagGroupLowLevelILCallback()

size_t Architecture::GetSemanticFlagGroupLowLevelILCallback ( void *  ctxt,
uint32_t  semGroup,
BNLowLevelILFunction *  il 
)
staticprotected

◆ GetSemanticFlagGroupName()

string Architecture::GetSemanticFlagGroupName ( uint32_t  semGroup)
virtual

◆ GetSemanticFlagGroupNameCallback()

char * Architecture::GetSemanticFlagGroupNameCallback ( void *  ctxt,
uint32_t  semGroup 
)
staticprotected

◆ GetStackPointerRegister()

uint32_t Architecture::GetStackPointerRegister ( )
virtual

◆ GetStackPointerRegisterCallback()

uint32_t Architecture::GetStackPointerRegisterCallback ( void *  ctxt)
staticprotected

◆ GetStandalonePlatform()

Ref< Platform > Architecture::GetStandalonePlatform ( )

◆ GetStdcallCallingConvention()

Ref< CallingConvention > Architecture::GetStdcallCallingConvention ( )

◆ GetSystemRegisters()

vector< uint32_t > Architecture::GetSystemRegisters ( )
virtual

◆ GetSystemRegistersCallback()

uint32_t * Architecture::GetSystemRegistersCallback ( void *  ctxt,
size_t *  count 
)
staticprotected

◆ InitCallback()

void Architecture::InitCallback ( void *  ctxt,
BNArchitecture *  obj 
)
staticprotected

◆ InvertBranch()

bool Architecture::InvertBranch ( uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

InvertBranch converts the conditional branch instruction at addr to its invert.

This is called when the right-click context menu item "invert branch" is selected in the UI.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ InvertBranchCallback()

bool Architecture::InvertBranchCallback ( void *  ctxt,
uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ IsAlwaysBranchPatchAvailable()

bool Architecture::IsAlwaysBranchPatchAvailable ( const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

IsAlwaysBranchPatchAvailable returns true if the instruction at addr can be patched to always branch.

This is used in the UI to determine if "always branch" should be displayed in the right-click context menu when right-clicking on an instruction.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ IsAlwaysBranchPatchAvailableCallback()

bool Architecture::IsAlwaysBranchPatchAvailableCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ IsBinaryViewTypeConstantDefined()

bool Architecture::IsBinaryViewTypeConstantDefined ( const std::string &  type,
const std::string &  name 
)

◆ IsGlobalRegister()

bool Architecture::IsGlobalRegister ( uint32_t  reg)

◆ IsInvertBranchPatchAvailable()

bool Architecture::IsInvertBranchPatchAvailable ( const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

IsInvertBranchPatchAvailable returns true if the instruction at addr can be patched to invert the branch.

This is used in the UI to determine if "invert branch" should be displayed in the right-click context menu when right-clicking on an instruction.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ IsInvertBranchPatchAvailableCallback()

bool Architecture::IsInvertBranchPatchAvailableCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ IsNeverBranchPatchAvailable()

bool Architecture::IsNeverBranchPatchAvailable ( const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

IsNeverBranchPatchAvailable returns true if the instruction at addr can be patched to never branch.

This is used in the UI to determine if "never branch" should be displayed in the right-click context menu when right-clicking on an instruction.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ IsNeverBranchPatchAvailableCallback()

bool Architecture::IsNeverBranchPatchAvailableCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ IsSkipAndReturnValuePatchAvailable()

bool Architecture::IsSkipAndReturnValuePatchAvailable ( const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

IsSkipAndReturnValuePatchAvailable returns true if the instruction at addr is a call that can be patched to return a value.

This is used in the UI to determine if "skip and return value" should be displayed in the right-click context menu when right-clicking on an instruction.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ IsSkipAndReturnValuePatchAvailableCallback()

bool Architecture::IsSkipAndReturnValuePatchAvailableCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ IsSkipAndReturnZeroPatchAvailable()

bool Architecture::IsSkipAndReturnZeroPatchAvailable ( const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
virtual

IsSkipAndReturnZeroPatchAvailable returns true if the instruction at addr is a call that can be patched to return zero.

This is used in the UI to determine if "skip and return zero" should be displayed in the right-click context menu when right-clicking on an instruction.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ IsSkipAndReturnZeroPatchAvailableCallback()

bool Architecture::IsSkipAndReturnZeroPatchAvailableCallback ( void *  ctxt,
const uint8_t *  data,
uint64_t  addr,
size_t  len 
)
staticprotected

◆ IsSystemRegister()

bool Architecture::IsSystemRegister ( uint32_t  reg)

◆ Register() [1/2]

void Architecture::Register ( Architecture arch)
static

◆ Register() [2/2]

void Architecture::Register ( BNCustomArchitecture callbacks)
protectedvirtual

◆ RegisterCallingConvention()

void Architecture::RegisterCallingConvention ( CallingConvention cc)

◆ RegisterFunctionRecognizer()

void Architecture::RegisterFunctionRecognizer ( FunctionRecognizer recog)

◆ RegisterRelocationHandler()

void Architecture::RegisterRelocationHandler ( const std::string &  viewName,
RelocationHandler handler 
)

◆ SetBinaryViewTypeConstant()

void Architecture::SetBinaryViewTypeConstant ( const std::string &  type,
const std::string &  name,
uint64_t  value 
)

◆ SetCdeclCallingConvention()

void Architecture::SetCdeclCallingConvention ( CallingConvention cc)

◆ SetDefaultCallingConvention()

void Architecture::SetDefaultCallingConvention ( CallingConvention cc)

◆ SetFastcallCallingConvention()

void Architecture::SetFastcallCallingConvention ( CallingConvention cc)

◆ SetStdcallCallingConvention()

void Architecture::SetStdcallCallingConvention ( CallingConvention cc)

◆ SkipAndReturnValue()

bool Architecture::SkipAndReturnValue ( uint8_t *  data,
uint64_t  addr,
size_t  len,
uint64_t  value 
)
virtual

SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value.

This is called when the right-click context menu item "skip and return value" is selected in the UI.

Parameters
archthe architecture of the instruction
addrthe address of the instruction in question

Reimplemented in BinaryNinja::CoreArchitecture, and BinaryNinja::ArchitectureExtension.

◆ SkipAndReturnValueCallback()

bool Architecture::SkipAndReturnValueCallback ( void *  ctxt,
uint8_t *  data,
uint64_t  addr,
size_t  len,
uint64_t  value 
)
staticprotected

Member Data Documentation

◆ m_nameForRegister

std::string BinaryNinja::Architecture::m_nameForRegister
protected

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