Loading...
Searching...
No Matches
CallingConvention

Detailed Description

Classes

class  BinaryNinja::CallingConvention
 
class  BinaryNinja::CoreCallingConvention
 

Class Documentation

◆ BinaryNinja::CallingConvention

class BinaryNinja::CallingConvention

Public Member Functions

Ref< ArchitectureGetArchitecture () const
 
std::string GetName () const
 
virtual std::vector< uint32_t > GetCallerSavedRegisters ()
 
virtual std::vector< uint32_t > GetCalleeSavedRegisters ()
 
virtual std::vector< uint32_t > GetIntegerArgumentRegisters ()
 
virtual std::vector< uint32_t > GetFloatArgumentRegisters ()
 
virtual bool AreArgumentRegistersSharedIndex ()
 
virtual bool AreArgumentRegistersUsedForVarArgs ()
 
virtual bool IsStackReservedForArgumentRegisters ()
 
virtual bool IsStackAdjustedOnReturn ()
 
virtual bool IsEligibleForHeuristics ()
 
virtual uint32_t GetIntegerReturnValueRegister ()=0
 
virtual uint32_t GetHighIntegerReturnValueRegister ()
 
virtual uint32_t GetFloatReturnValueRegister ()
 
virtual uint32_t GetGlobalPointerRegister ()
 
virtual std::vector< uint32_t > GetImplicitlyDefinedRegisters ()
 
virtual RegisterValue GetIncomingRegisterValue (uint32_t reg, Function *func)
 
virtual RegisterValue GetIncomingFlagValue (uint32_t flag, Function *func)
 
virtual Variable GetIncomingVariableForParameterVariable (const Variable &var, Function *func)
 
virtual Variable GetParameterVariableForIncomingVariable (const Variable &var, Function *func)
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNCallingConvention, BNNewCallingConventionReference, BNFreeCallingConvention >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNCallingConventionGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Protected Member Functions

 CallingConvention (BNCallingConvention *cc)
 
 CallingConvention (Architecture *arch, const std::string &name)
 

Static Protected Member Functions

static void FreeCallback (void *ctxt)
 
static uint32_t * GetCallerSavedRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetCalleeSavedRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetIntegerArgumentRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetFloatArgumentRegistersCallback (void *ctxt, size_t *count)
 
static void FreeRegisterListCallback (void *ctxt, uint32_t *regs)
 
static bool AreArgumentRegistersSharedIndexCallback (void *ctxt)
 
static bool AreArgumentRegistersUsedForVarArgsCallback (void *ctxt)
 
static bool IsStackReservedForArgumentRegistersCallback (void *ctxt)
 
static bool IsStackAdjustedOnReturnCallback (void *ctxt)
 
static bool IsEligibleForHeuristicsCallback (void *ctxt)
 
static uint32_t GetIntegerReturnValueRegisterCallback (void *ctxt)
 
static uint32_t GetHighIntegerReturnValueRegisterCallback (void *ctxt)
 
static uint32_t GetFloatReturnValueRegisterCallback (void *ctxt)
 
static uint32_t GetGlobalPointerRegisterCallback (void *ctxt)
 
static uint32_t * GetImplicitlyDefinedRegistersCallback (void *ctxt, size_t *count)
 
static void GetIncomingRegisterValueCallback (void *ctxt, uint32_t reg, BNFunction *func, BNRegisterValue *result)
 
static void GetIncomingFlagValueCallback (void *ctxt, uint32_t reg, BNFunction *func, BNRegisterValue *result)
 
static void GetIncomingVariableForParameterVariableCallback (void *ctxt, const BNVariable *var, BNFunction *func, BNVariable *result)
 
static void GetParameterVariableForIncomingVariableCallback (void *ctxt, const BNVariable *var, BNFunction *func, BNVariable *result)
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNCallingConvention, BNNewCallingConventionReference, BNFreeCallingConvention >
static BNCallingConventionGetObject (CoreRefCountObject *obj)
 
static BNCallingConventionGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNCallingConvention, BNNewCallingConventionReference, BNFreeCallingConvention >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNCallingConventionm_object
 

Constructor & Destructor Documentation

◆ CallingConvention() [1/2]

CallingConvention::CallingConvention ( BNCallingConvention * cc)
protected

◆ CallingConvention() [2/2]

BinaryNinja::CallingConvention::CallingConvention ( Architecture * arch,
const std::string & name )
protected

Member Function Documentation

◆ FreeCallback()

void CallingConvention::FreeCallback ( void * ctxt)
staticprotected

◆ GetCallerSavedRegistersCallback()

uint32_t * CallingConvention::GetCallerSavedRegistersCallback ( void * ctxt,
size_t * count )
staticprotected

◆ GetCalleeSavedRegistersCallback()

uint32_t * CallingConvention::GetCalleeSavedRegistersCallback ( void * ctxt,
size_t * count )
staticprotected

◆ GetIntegerArgumentRegistersCallback()

uint32_t * CallingConvention::GetIntegerArgumentRegistersCallback ( void * ctxt,
size_t * count )
staticprotected

◆ GetFloatArgumentRegistersCallback()

uint32_t * CallingConvention::GetFloatArgumentRegistersCallback ( void * ctxt,
size_t * count )
staticprotected

◆ FreeRegisterListCallback()

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

◆ AreArgumentRegistersSharedIndexCallback()

bool CallingConvention::AreArgumentRegistersSharedIndexCallback ( void * ctxt)
staticprotected

◆ AreArgumentRegistersUsedForVarArgsCallback()

bool CallingConvention::AreArgumentRegistersUsedForVarArgsCallback ( void * ctxt)
staticprotected

◆ IsStackReservedForArgumentRegistersCallback()

bool CallingConvention::IsStackReservedForArgumentRegistersCallback ( void * ctxt)
staticprotected

◆ IsStackAdjustedOnReturnCallback()

bool CallingConvention::IsStackAdjustedOnReturnCallback ( void * ctxt)
staticprotected

◆ IsEligibleForHeuristicsCallback()

bool CallingConvention::IsEligibleForHeuristicsCallback ( void * ctxt)
staticprotected

◆ GetIntegerReturnValueRegisterCallback()

uint32_t CallingConvention::GetIntegerReturnValueRegisterCallback ( void * ctxt)
staticprotected

◆ GetHighIntegerReturnValueRegisterCallback()

uint32_t CallingConvention::GetHighIntegerReturnValueRegisterCallback ( void * ctxt)
staticprotected

◆ GetFloatReturnValueRegisterCallback()

uint32_t CallingConvention::GetFloatReturnValueRegisterCallback ( void * ctxt)
staticprotected

◆ GetGlobalPointerRegisterCallback()

uint32_t CallingConvention::GetGlobalPointerRegisterCallback ( void * ctxt)
staticprotected

◆ GetImplicitlyDefinedRegistersCallback()

uint32_t * CallingConvention::GetImplicitlyDefinedRegistersCallback ( void * ctxt,
size_t * count )
staticprotected

◆ GetIncomingRegisterValueCallback()

void CallingConvention::GetIncomingRegisterValueCallback ( void * ctxt,
uint32_t reg,
BNFunction * func,
BNRegisterValue * result )
staticprotected

◆ GetIncomingFlagValueCallback()

void CallingConvention::GetIncomingFlagValueCallback ( void * ctxt,
uint32_t reg,
BNFunction * func,
BNRegisterValue * result )
staticprotected

◆ GetIncomingVariableForParameterVariableCallback()

void CallingConvention::GetIncomingVariableForParameterVariableCallback ( void * ctxt,
const BNVariable * var,
BNFunction * func,
BNVariable * result )
staticprotected

◆ GetParameterVariableForIncomingVariableCallback()

void CallingConvention::GetParameterVariableForIncomingVariableCallback ( void * ctxt,
const BNVariable * var,
BNFunction * func,
BNVariable * result )
staticprotected

◆ GetArchitecture()

Ref< Architecture > CallingConvention::GetArchitecture ( ) const

◆ GetName()

string CallingConvention::GetName ( ) const

◆ GetCallerSavedRegisters()

vector< uint32_t > CallingConvention::GetCallerSavedRegisters ( )
virtual

◆ GetCalleeSavedRegisters()

vector< uint32_t > CallingConvention::GetCalleeSavedRegisters ( )
virtual

◆ GetIntegerArgumentRegisters()

vector< uint32_t > CallingConvention::GetIntegerArgumentRegisters ( )
virtual

◆ GetFloatArgumentRegisters()

vector< uint32_t > CallingConvention::GetFloatArgumentRegisters ( )
virtual

◆ AreArgumentRegistersSharedIndex()

bool CallingConvention::AreArgumentRegistersSharedIndex ( )
virtual

◆ AreArgumentRegistersUsedForVarArgs()

bool CallingConvention::AreArgumentRegistersUsedForVarArgs ( )
virtual

◆ IsStackReservedForArgumentRegisters()

bool CallingConvention::IsStackReservedForArgumentRegisters ( )
virtual

◆ IsStackAdjustedOnReturn()

bool CallingConvention::IsStackAdjustedOnReturn ( )
virtual

◆ IsEligibleForHeuristics()

bool CallingConvention::IsEligibleForHeuristics ( )
virtual

◆ GetIntegerReturnValueRegister()

virtual uint32_t BinaryNinja::CallingConvention::GetIntegerReturnValueRegister ( )
pure virtual

◆ GetHighIntegerReturnValueRegister()

uint32_t CallingConvention::GetHighIntegerReturnValueRegister ( )
virtual

◆ GetFloatReturnValueRegister()

uint32_t CallingConvention::GetFloatReturnValueRegister ( )
virtual

◆ GetGlobalPointerRegister()

uint32_t CallingConvention::GetGlobalPointerRegister ( )
virtual

◆ GetImplicitlyDefinedRegisters()

vector< uint32_t > CallingConvention::GetImplicitlyDefinedRegisters ( )
virtual

◆ GetIncomingRegisterValue()

RegisterValue CallingConvention::GetIncomingRegisterValue ( uint32_t reg,
Function * func )
virtual

◆ GetIncomingFlagValue()

RegisterValue CallingConvention::GetIncomingFlagValue ( uint32_t flag,
Function * func )
virtual

◆ GetIncomingVariableForParameterVariable()

Variable CallingConvention::GetIncomingVariableForParameterVariable ( const Variable & var,
Function * func )
virtual

◆ GetParameterVariableForIncomingVariable()

Variable CallingConvention::GetParameterVariableForIncomingVariable ( const Variable & var,
Function * func )
virtual

◆ BinaryNinja::CoreCallingConvention

class BinaryNinja::CoreCallingConvention

Public Member Functions

 CoreCallingConvention (BNCallingConvention *cc)
 
virtual std::vector< uint32_t > GetCallerSavedRegisters () override
 
virtual std::vector< uint32_t > GetCalleeSavedRegisters () override
 
virtual std::vector< uint32_t > GetIntegerArgumentRegisters () override
 
virtual std::vector< uint32_t > GetFloatArgumentRegisters () override
 
virtual bool AreArgumentRegistersSharedIndex () override
 
virtual bool AreArgumentRegistersUsedForVarArgs () override
 
virtual bool IsStackReservedForArgumentRegisters () override
 
virtual bool IsStackAdjustedOnReturn () override
 
virtual bool IsEligibleForHeuristics () override
 
virtual uint32_t GetIntegerReturnValueRegister () override
 
virtual uint32_t GetHighIntegerReturnValueRegister () override
 
virtual uint32_t GetFloatReturnValueRegister () override
 
virtual uint32_t GetGlobalPointerRegister () override
 
virtual std::vector< uint32_t > GetImplicitlyDefinedRegisters () override
 
virtual RegisterValue GetIncomingRegisterValue (uint32_t reg, Function *func) override
 
virtual RegisterValue GetIncomingFlagValue (uint32_t flag, Function *func) override
 
virtual Variable GetIncomingVariableForParameterVariable (const Variable &var, Function *func) override
 
virtual Variable GetParameterVariableForIncomingVariable (const Variable &var, Function *func) override
 
- Public Member Functions inherited from BinaryNinja::CallingConvention
Ref< ArchitectureGetArchitecture () const
 
std::string GetName () const
 
- Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNCallingConvention, BNNewCallingConventionReference, BNFreeCallingConvention >
 CoreRefCountObject ()
 
virtual ~CoreRefCountObject ()
 
BNCallingConventionGetObject () const
 
void AddRef ()
 
void Release ()
 
void AddRefForRegistration ()
 
void ReleaseForRegistration ()
 
void AddRefForCallback ()
 
void ReleaseForCallback ()
 

Additional Inherited Members

- Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNCallingConvention, BNNewCallingConventionReference, BNFreeCallingConvention >
static BNCallingConventionGetObject (CoreRefCountObject *obj)
 
static BNCallingConventionGetObject (const CoreRefCountObject *obj)
 
- Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNCallingConvention, BNNewCallingConventionReference, BNFreeCallingConvention >
std::atomic< int > m_refs
 
bool m_registeredRef
 
BNCallingConventionm_object
 
- Protected Member Functions inherited from BinaryNinja::CallingConvention
 CallingConvention (BNCallingConvention *cc)
 
 CallingConvention (Architecture *arch, const std::string &name)
 
- Static Protected Member Functions inherited from BinaryNinja::CallingConvention
static void FreeCallback (void *ctxt)
 
static uint32_t * GetCallerSavedRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetCalleeSavedRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetIntegerArgumentRegistersCallback (void *ctxt, size_t *count)
 
static uint32_t * GetFloatArgumentRegistersCallback (void *ctxt, size_t *count)
 
static void FreeRegisterListCallback (void *ctxt, uint32_t *regs)
 
static bool AreArgumentRegistersSharedIndexCallback (void *ctxt)
 
static bool AreArgumentRegistersUsedForVarArgsCallback (void *ctxt)
 
static bool IsStackReservedForArgumentRegistersCallback (void *ctxt)
 
static bool IsStackAdjustedOnReturnCallback (void *ctxt)
 
static bool IsEligibleForHeuristicsCallback (void *ctxt)
 
static uint32_t GetIntegerReturnValueRegisterCallback (void *ctxt)
 
static uint32_t GetHighIntegerReturnValueRegisterCallback (void *ctxt)
 
static uint32_t GetFloatReturnValueRegisterCallback (void *ctxt)
 
static uint32_t GetGlobalPointerRegisterCallback (void *ctxt)
 
static uint32_t * GetImplicitlyDefinedRegistersCallback (void *ctxt, size_t *count)
 
static void GetIncomingRegisterValueCallback (void *ctxt, uint32_t reg, BNFunction *func, BNRegisterValue *result)
 
static void GetIncomingFlagValueCallback (void *ctxt, uint32_t reg, BNFunction *func, BNRegisterValue *result)
 
static void GetIncomingVariableForParameterVariableCallback (void *ctxt, const BNVariable *var, BNFunction *func, BNVariable *result)
 
static void GetParameterVariableForIncomingVariableCallback (void *ctxt, const BNVariable *var, BNFunction *func, BNVariable *result)
 

Constructor & Destructor Documentation

◆ CoreCallingConvention()

CoreCallingConvention::CoreCallingConvention ( BNCallingConvention * cc)

Member Function Documentation

◆ GetCallerSavedRegisters()

vector< uint32_t > CoreCallingConvention::GetCallerSavedRegisters ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetCalleeSavedRegisters()

vector< uint32_t > CoreCallingConvention::GetCalleeSavedRegisters ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetIntegerArgumentRegisters()

vector< uint32_t > CoreCallingConvention::GetIntegerArgumentRegisters ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetFloatArgumentRegisters()

vector< uint32_t > CoreCallingConvention::GetFloatArgumentRegisters ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ AreArgumentRegistersSharedIndex()

bool CoreCallingConvention::AreArgumentRegistersSharedIndex ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ AreArgumentRegistersUsedForVarArgs()

bool CoreCallingConvention::AreArgumentRegistersUsedForVarArgs ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ IsStackReservedForArgumentRegisters()

bool CoreCallingConvention::IsStackReservedForArgumentRegisters ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ IsStackAdjustedOnReturn()

bool CoreCallingConvention::IsStackAdjustedOnReturn ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ IsEligibleForHeuristics()

bool CoreCallingConvention::IsEligibleForHeuristics ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetIntegerReturnValueRegister()

uint32_t CoreCallingConvention::GetIntegerReturnValueRegister ( )
overridevirtual

◆ GetHighIntegerReturnValueRegister()

uint32_t CoreCallingConvention::GetHighIntegerReturnValueRegister ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetFloatReturnValueRegister()

uint32_t CoreCallingConvention::GetFloatReturnValueRegister ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetGlobalPointerRegister()

uint32_t CoreCallingConvention::GetGlobalPointerRegister ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetImplicitlyDefinedRegisters()

vector< uint32_t > CoreCallingConvention::GetImplicitlyDefinedRegisters ( )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetIncomingRegisterValue()

RegisterValue CoreCallingConvention::GetIncomingRegisterValue ( uint32_t reg,
Function * func )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetIncomingFlagValue()

RegisterValue CoreCallingConvention::GetIncomingFlagValue ( uint32_t flag,
Function * func )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetIncomingVariableForParameterVariable()

Variable CoreCallingConvention::GetIncomingVariableForParameterVariable ( const Variable & var,
Function * func )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.

◆ GetParameterVariableForIncomingVariable()

Variable CoreCallingConvention::GetParameterVariableForIncomingVariable ( const Variable & var,
Function * func )
overridevirtual

Reimplemented from BinaryNinja::CallingConvention.