Classes related to interacting with, hooking, and implementing Architectures . More...
Classes related to interacting with, hooking, and implementing Architectures .
Classes | |
| class | BinaryNinja::Architecture |
| The Architecture class is the base class for all CPU architectures. More... | |
| class | BinaryNinja::CoreArchitecture |
| class | BinaryNinja::ArchitectureExtension |
| class | BinaryNinja::ArchitectureHook |
| class BinaryNinja::Architecture |
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 |
| Get the name of this architecture. | |
| virtual BNEndianness | GetEndianness () const =0 |
| Get the default endianness for this architecture. | |
| virtual size_t | GetAddressSize () const =0 |
| Get the address size for this architecture. | |
| virtual size_t | GetDefaultIntegerSize () const |
| Get the default integer size for this architecture. | |
| virtual size_t | GetInstructionAlignment () const |
| virtual size_t | GetMaxInstructionLength () const |
| Get the maximum instruction length. | |
| virtual size_t | GetOpcodeDisplayLength () const |
| virtual Ref< Architecture > | GetAssociatedArchitectureByAddress (uint64_t &addr) |
| virtual bool | GetInstructionInfo (const uint8_t *data, uint64_t addr, size_t maxLen, InstructionInfo &result)=0 |
| Retrieves an InstructionInfo struct for the instruction at the given virtual address. | |
| virtual bool | GetInstructionText (const uint8_t *data, uint64_t addr, size_t &len, std::vector< InstructionTextToken > &result)=0 |
| Retrieves a list of InstructionTextTokens. | |
| virtual bool | GetInstructionLowLevelIL (const uint8_t *data, uint64_t addr, size_t &len, LowLevelILFunction &il) |
| Translates an instruction at addr and appends it onto the LowLevelILFunction& il. | |
| virtual void | AnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) |
| Analyze the basic blocks of a function. | |
| virtual std::string | GetRegisterName (uint32_t reg) |
| Gets a register name from a register index. | |
| virtual std::string | GetFlagName (uint32_t flag) |
| Gets a flag name from a flag index. | |
| virtual std::string | GetFlagWriteTypeName (uint32_t flags) |
| Gets the flag write type name for the given flag. | |
| virtual std::string | GetSemanticFlagClassName (uint32_t semClass) |
| Gets the name of a semantic flag class from the index. | |
| virtual std::string | GetSemanticFlagGroupName (uint32_t semGroup) |
| Gets the name of a semantic flag group from the index. | |
| virtual std::vector< uint32_t > | GetFullWidthRegisters () |
| Get the list of full width register indices. | |
| virtual std::vector< uint32_t > | GetAllRegisters () |
| Get the list of all register indices. | |
| virtual std::vector< uint32_t > | GetAllFlags () |
| Get the list of all flag indices. | |
| virtual std::vector< uint32_t > | GetAllFlagWriteTypes () |
| Get the list of all flag write type indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagClasses () |
| Get the list of all semantic flag class indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagGroups () |
| Get the list of all semantic flag group indices. | |
| virtual BNFlagRole | GetFlagRole (uint32_t flag, uint32_t semClass=0) |
| Get the role of a given flag. | |
| 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, BNLowLevelILFlagCondition > | GetFlagConditionsForSemanticFlagGroup (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) |
| Get the register info for a given register index. | |
| virtual uint32_t | GetStackPointerRegister () |
| Get the register index corresponding to the stack pointer (SP) | |
| virtual uint32_t | GetLinkRegister () |
| Get the register index corresponding to the link register (LR) | |
| virtual std::vector< uint32_t > | GetGlobalRegisters () |
| bool | IsGlobalRegister (uint32_t reg) |
| virtual std::vector< uint32_t > | GetSystemRegisters () |
| Get the list of system register indices. | |
| bool | IsSystemRegister (uint32_t reg) |
| Check whether a register is a system register. | |
| std::vector< uint32_t > | GetModifiedRegistersOnWrite (uint32_t reg) |
Returns a list of register indices that are modified when reg is written to. | |
| uint32_t | GetRegisterByName (const std::string &name) |
| Get a register index by its name. | |
| virtual std::string | GetRegisterStackName (uint32_t regStack) |
| Get a register stack name from a register stack number. | |
| virtual std::vector< uint32_t > | GetAllRegisterStacks () |
| virtual BNRegisterStackInfo | GetRegisterStackInfo (uint32_t regStack) |
| uint32_t | GetRegisterStackForRegister (uint32_t reg) |
| virtual BNIntrinsicClass | GetIntrinsicClass (uint32_t intrinsic) |
| virtual std::string | GetIntrinsicName (uint32_t intrinsic) |
| virtual std::vector< uint32_t > | GetAllIntrinsics () |
| virtual std::vector< NameAndType > | GetIntrinsicInputs (uint32_t intrinsic) |
| virtual std::vector< Confidence< Ref< Type > > > | GetIntrinsicOutputs (uint32_t intrinsic) |
| virtual bool | CanAssemble () |
| Check whether this architecture can assemble instructions. | |
| virtual bool | Assemble (const std::string &code, uint64_t addr, DataBuffer &result, std::string &errors) |
Converts the string of assembly instructions code loaded at virtual address addr to the byte representation of those instructions. | |
| virtual bool | IsNeverBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) |
Returns true if the instruction at addr can be patched to never branch. | |
| virtual bool | IsAlwaysBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) |
| Returns true if the instruction at addr can be patched to always branch. | |
| virtual bool | IsInvertBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) |
| Returns true if the instruction at addr can be patched to invert the branch. | |
| virtual bool | IsSkipAndReturnZeroPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) |
| Checks if the instruction at addr is a call that can be patched to return zero. | |
| virtual bool | IsSkipAndReturnValuePatchAvailable (const uint8_t *data, uint64_t addr, size_t len) |
| Checks if the instruction at addr is a call that can be patched to return a value. | |
| virtual bool | ConvertToNop (uint8_t *data, uint64_t addr, size_t len) |
| Converts the instruction at addr to a no-operation instruction. | |
| virtual bool | AlwaysBranch (uint8_t *data, uint64_t addr, size_t len) |
| Converts the conditional branch instruction at addr to an unconditional branch. | |
| virtual bool | InvertBranch (uint8_t *data, uint64_t addr, size_t len) |
| InvertBranch converts the conditional branch instruction at addr to its invert. | |
| 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. | |
| void | RegisterFunctionRecognizer (FunctionRecognizer *recog) |
| void | RegisterRelocationHandler (const std::string &viewName, RelocationHandler *handler) |
| Ref< RelocationHandler > | GetRelocationHandler (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) |
| Register a calling convention with this architecture. | |
| std::vector< Ref< CallingConvention > > | GetCallingConventions () |
| List of registered calling conventions. | |
| Ref< CallingConvention > | GetCallingConventionByName (const std::string &name) |
| Get a calling convention by name. | |
| void | SetDefaultCallingConvention (CallingConvention *cc) |
| Set the default calling convention. | |
| void | SetCdeclCallingConvention (CallingConvention *cc) |
| Set the cdecl calling convention. | |
| void | SetStdcallCallingConvention (CallingConvention *cc) |
| Set the stdcall calling convention. | |
| void | SetFastcallCallingConvention (CallingConvention *cc) |
| Set the fastcall calling convention. | |
| Ref< CallingConvention > | GetDefaultCallingConvention () |
| Get the default calling convention. | |
| Ref< CallingConvention > | GetCdeclCallingConvention () |
| Get the cdecl calling convention. | |
| Ref< CallingConvention > | GetStdcallCallingConvention () |
| Get the stdcall calling convention. | |
| Ref< CallingConvention > | GetFastcallCallingConvention () |
| Get the fastcall calling convention. | |
| Ref< Platform > | GetStandalonePlatform () |
| Get the Architecture standalone platform. | |
| std::vector< Ref< TypeLibrary > > | GetTypeLibraries () |
| 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 () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Static Public Member Functions | |
| static void | Register (Architecture *arch) |
| Register an architecture. | |
| static void | DefaultAnalyzeBasicBlocksCallback (BNFunction *function, BNBasicBlockAnalysisContext *context) |
| static void | DefaultAnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) |
| Default implementation of AnalyzeBasicBlocks. | |
| static Ref< Architecture > | GetByName (const std::string &name) |
| Get an Architecture by name. | |
| static std::vector< Ref< Architecture > > | GetList () |
| Get the list of registered Architectures. | |
Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture > | |
| static BNArchitecture * | GetObject (const 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 void | AnalyzeBasicBlocksCallback (void *ctxt, BNFunction *function, BNBasicBlockAnalysisContext *context) |
| 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 BNFlagConditionForSemanticClass * | GetFlagConditionsForSemanticFlagGroupCallback (void *ctxt, uint32_t semGroup, size_t *count) |
| static void | FreeFlagConditionsForSemanticFlagGroupCallback (void *ctxt, BNFlagConditionForSemanticClass *conditions, size_t count) |
| 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, size_t len) |
| 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 BNIntrinsicClass | GetIntrinsicClassCallback (void *ctxt, uint32_t intrinsic) |
| static char * | GetIntrinsicNameCallback (void *ctxt, uint32_t intrinsic) |
| static uint32_t * | GetAllIntrinsicsCallback (void *ctxt, size_t *count) |
| static BNNameAndType * | GetIntrinsicInputsCallback (void *ctxt, uint32_t intrinsic, size_t *count) |
| static void | FreeNameAndTypeListCallback (void *ctxt, BNNameAndType *nt, size_t count) |
| static BNTypeWithConfidence * | GetIntrinsicOutputsCallback (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 |
|
protected |
| BinaryNinja::Architecture::Architecture | ( | const std::string & | name | ) |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protectedvirtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::ArchitectureHook.
|
static |
Register an architecture.
| arch | Architecture to register |
|
static |
|
static |
Default implementation of AnalyzeBasicBlocks.
| function | Function to analyze |
| context | Context for the analysis |
|
static |
Get an Architecture by name.
| name | Name of the architecture |
|
static |
Get the list of registered Architectures.
| string Architecture::GetName | ( | ) | const |
Get the name of this architecture.
|
pure virtual |
Get the default endianness for this architecture.
Implemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
pure virtual |
Get the address size for this architecture.
Implemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the default integer size for this architecture.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the maximum instruction length.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
pure virtual |
Retrieves an InstructionInfo struct for the instruction at the given virtual address.
If the instruction is a branch instruction architecture plugins should add a branch of the proper type:
===================== =================================================== BNBranchType Description ===================== =================================================== UnconditionalBranch Branch will always be taken FalseBranch False branch condition TrueBranch True branch condition CallDestination Branch is a call instruction (Branch with Link) FunctionReturn Branch returns from a function SystemCall System call instruction IndirectBranch Branch destination is a memory address or register UnresolvedBranch Branch destination is an unknown address ===================== ===================================================
| [in] | data | pointer to the instruction data to retrieve info for |
| [in] | addr | address of the instruction data to retrieve info for |
| [in] | maxLen | Maximum length of the instruction data to read |
| [out] | result | Retrieved instruction info |
Implemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
pure virtual |
Retrieves a list of InstructionTextTokens.
| [in] | data | pointer to the instruction data to retrieve text for |
| [in] | addr | address of the instruction data to retrieve text for |
| [out] | len | will be written to with the length of the instruction data which was translated |
| [out] | result |
Implemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Translates an instruction at addr and appends it onto the LowLevelILFunction& il.
| [in] | data | pointer to the instruction data to be translated |
| [in] | addr | address of the instruction data to be translated |
| [out] | len | will be written to with the length of the instruction data which was translated |
| [in,out] | il | the LowLevelILFunction to appended to. |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Analyze the basic blocks of a function.
| function | Function to analyze |
| context | Context for the analysis |
Reimplemented in BinaryNinja::CoreArchitecture.
|
virtual |
Gets a register name from a register index.
| reg | Register index |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Gets a flag name from a flag index.
| flag | Flag index |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Gets the flag write type name for the given flag.
| flags | flag |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Gets the name of a semantic flag class from the index.
| semClass | Semantic class index |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Gets the name of a semantic flag group from the index.
| semGroup | Semantic flag group index |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the list of full width register indices.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the list of all register indices.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the list of all flag indices.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the list of all flag write type indices.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the list of all semantic flag class indices.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the list of all semantic flag group indices.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the role of a given flag.
| flag | Flag index |
| semClass | Optional semantic flag class |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
| size_t Architecture::GetDefaultFlagWriteLowLevelIL | ( | BNLowLevelILOperation | op, |
| size_t | size, | ||
| BNFlagRole | role, | ||
| BNRegisterOrConstant * | operands, | ||
| size_t | operandCount, | ||
| LowLevelILFunction & | il ) |
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
| ExprId Architecture::GetDefaultFlagConditionLowLevelIL | ( | BNLowLevelILFlagCondition | cond, |
| uint32_t | semClass, | ||
| LowLevelILFunction & | il ) |
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the register info for a given register index.
| reg | Register index |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the register index corresponding to the stack pointer (SP)
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Get the register index corresponding to the link register (LR)
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
| bool Architecture::IsGlobalRegister | ( | uint32_t | reg | ) |
|
virtual |
Get the list of system register indices.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
| bool Architecture::IsSystemRegister | ( | uint32_t | reg | ) |
Check whether a register is a system register.
| reg | Register index |
| vector< uint32_t > Architecture::GetModifiedRegistersOnWrite | ( | uint32_t | reg | ) |
Returns a list of register indices that are modified when reg is written to.
| reg | Register index |
| uint32_t Architecture::GetRegisterByName | ( | const std::string & | name | ) |
Get a register index by its name.
| name | Name of the register |
|
virtual |
Get a register stack name from a register stack number.
| regStack | Register stack number |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
| uint32_t Architecture::GetRegisterStackForRegister | ( | uint32_t | reg | ) |
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Check whether this architecture can assemble instructions.
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Converts the string of assembly instructions code loaded at virtual address addr to the byte representation of those instructions.
| [in] | code | String representation of the instructions to be assembled |
| [in] | addr | Address of the instructions |
| [out] | result | DataBuffer containing the compiled bytes |
| [out] | errors | Any errors that occurred during assembly |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Returns true if the instruction at addr can be patched to never branch.
| data | Buffer of bytes to check |
| addr | the virtual address of the bytes, to be used when assembling |
| len | amount of bytes to be checked |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Returns true if the instruction at addr can be patched to always branch.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Returns true if the instruction at addr can be patched to invert the branch.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Checks if the instruction at addr is a call that can be patched to return zero.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Checks if the instruction at addr is a call that can be patched to return a value.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Converts the instruction at addr to a no-operation instruction.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
Converts the conditional branch instruction at addr to an unconditional branch.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
InvertBranch converts the conditional branch instruction at addr to its invert.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
|
virtual |
SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
| [in] | value | Value to be returned |
Reimplemented in BinaryNinja::ArchitectureExtension, and BinaryNinja::CoreArchitecture.
| void Architecture::RegisterFunctionRecognizer | ( | FunctionRecognizer * | recog | ) |
| void Architecture::RegisterRelocationHandler | ( | const std::string & | viewName, |
| RelocationHandler * | handler ) |
| Ref< RelocationHandler > Architecture::GetRelocationHandler | ( | const std::string & | viewName | ) |
| bool Architecture::IsBinaryViewTypeConstantDefined | ( | const std::string & | type, |
| const std::string & | name ) |
| uint64_t Architecture::GetBinaryViewTypeConstant | ( | const std::string & | type, |
| const std::string & | name, | ||
| uint64_t | defaultValue = 0 ) |
| void Architecture::SetBinaryViewTypeConstant | ( | const std::string & | type, |
| const std::string & | name, | ||
| uint64_t | value ) |
| void Architecture::RegisterCallingConvention | ( | CallingConvention * | cc | ) |
Register a calling convention with this architecture.
| cc | calling convention to register |
| vector< Ref< CallingConvention > > Architecture::GetCallingConventions | ( | ) |
List of registered calling conventions.
| Ref< CallingConvention > Architecture::GetCallingConventionByName | ( | const std::string & | name | ) |
Get a calling convention by name.
| name | Name of the calling convention |
| void Architecture::SetDefaultCallingConvention | ( | CallingConvention * | cc | ) |
Set the default calling convention.
| cc | The default calling convention |
| void Architecture::SetCdeclCallingConvention | ( | CallingConvention * | cc | ) |
Set the cdecl calling convention.
| cc | The cdecl calling convention |
| void Architecture::SetStdcallCallingConvention | ( | CallingConvention * | cc | ) |
Set the stdcall calling convention.
| cc | The stdcall calling convention |
| void Architecture::SetFastcallCallingConvention | ( | CallingConvention * | cc | ) |
Set the fastcall calling convention.
| cc | The fastcall calling convention |
| Ref< CallingConvention > Architecture::GetDefaultCallingConvention | ( | ) |
Get the default calling convention.
| Ref< CallingConvention > Architecture::GetCdeclCallingConvention | ( | ) |
Get the cdecl calling convention.
| Ref< CallingConvention > Architecture::GetStdcallCallingConvention | ( | ) |
Get the stdcall calling convention.
| Ref< CallingConvention > Architecture::GetFastcallCallingConvention | ( | ) |
Get the fastcall calling convention.
Get the Architecture standalone platform.
| vector< Ref< TypeLibrary > > Architecture::GetTypeLibraries | ( | ) |
| void Architecture::AddArchitectureRedirection | ( | Architecture * | from, |
| Architecture * | to ) |
|
protected |
| class BinaryNinja::CoreArchitecture |
Public Member Functions | |
| CoreArchitecture (BNArchitecture *arch) | |
| virtual BNEndianness | GetEndianness () const override |
| Get the default endianness for this architecture. | |
| virtual size_t | GetAddressSize () const override |
| Get the address size for this architecture. | |
| virtual size_t | GetDefaultIntegerSize () const override |
| Get the default integer size for this architecture. | |
| virtual size_t | GetInstructionAlignment () const override |
| virtual size_t | GetMaxInstructionLength () const override |
| Get the maximum instruction length. | |
| virtual size_t | GetOpcodeDisplayLength () const override |
| virtual Ref< Architecture > | GetAssociatedArchitectureByAddress (uint64_t &addr) override |
| virtual bool | GetInstructionInfo (const uint8_t *data, uint64_t addr, size_t maxLen, InstructionInfo &result) override |
| Retrieves an InstructionInfo struct for the instruction at the given virtual address. | |
| virtual bool | GetInstructionText (const uint8_t *data, uint64_t addr, size_t &len, std::vector< InstructionTextToken > &result) override |
| Retrieves a list of InstructionTextTokens. | |
| virtual bool | GetInstructionLowLevelIL (const uint8_t *data, uint64_t addr, size_t &len, LowLevelILFunction &il) override |
| Translates an instruction at addr and appends it onto the LowLevelILFunction& il. | |
| virtual void | AnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) override |
| Analyze the basic blocks of a function. | |
| virtual std::string | GetRegisterName (uint32_t reg) override |
| Gets a register name from a register index. | |
| virtual std::string | GetFlagName (uint32_t flag) override |
| Gets a flag name from a flag index. | |
| virtual std::string | GetFlagWriteTypeName (uint32_t flags) override |
| Gets the flag write type name for the given flag. | |
| virtual std::string | GetSemanticFlagClassName (uint32_t semClass) override |
| Gets the name of a semantic flag class from the index. | |
| virtual std::string | GetSemanticFlagGroupName (uint32_t semGroup) override |
| Gets the name of a semantic flag group from the index. | |
| virtual std::vector< uint32_t > | GetFullWidthRegisters () override |
| Get the list of full width register indices. | |
| virtual std::vector< uint32_t > | GetAllRegisters () override |
| Get the list of all register indices. | |
| virtual std::vector< uint32_t > | GetAllFlags () override |
| Get the list of all flag indices. | |
| virtual std::vector< uint32_t > | GetAllFlagWriteTypes () override |
| Get the list of all flag write type indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagClasses () override |
| Get the list of all semantic flag class indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagGroups () override |
| Get the list of all semantic flag group indices. | |
| virtual BNFlagRole | GetFlagRole (uint32_t flag, uint32_t semClass=0) override |
| Get the role of a given flag. | |
| virtual std::vector< uint32_t > | GetFlagsRequiredForFlagCondition (BNLowLevelILFlagCondition cond, uint32_t semClass=0) override |
| virtual std::vector< uint32_t > | GetFlagsRequiredForSemanticFlagGroup (uint32_t semGroup) override |
| virtual std::map< uint32_t, BNLowLevelILFlagCondition > | GetFlagConditionsForSemanticFlagGroup (uint32_t semGroup) override |
| virtual std::vector< uint32_t > | GetFlagsWrittenByFlagWriteType (uint32_t writeType) override |
| virtual uint32_t | GetSemanticClassForFlagWriteType (uint32_t writeType) override |
| virtual ExprId | GetFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, uint32_t flagWriteType, uint32_t flag, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il) override |
| virtual ExprId | GetFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il) override |
| virtual ExprId | GetSemanticFlagGroupLowLevelIL (uint32_t semGroup, LowLevelILFunction &il) override |
| virtual BNRegisterInfo | GetRegisterInfo (uint32_t reg) override |
| Get the register info for a given register index. | |
| virtual uint32_t | GetStackPointerRegister () override |
| Get the register index corresponding to the stack pointer (SP) | |
| virtual uint32_t | GetLinkRegister () override |
| Get the register index corresponding to the link register (LR) | |
| virtual std::vector< uint32_t > | GetGlobalRegisters () override |
| virtual std::vector< uint32_t > | GetSystemRegisters () override |
| Get the list of system register indices. | |
| virtual std::string | GetRegisterStackName (uint32_t regStack) override |
| Get a register stack name from a register stack number. | |
| virtual std::vector< uint32_t > | GetAllRegisterStacks () override |
| virtual BNRegisterStackInfo | GetRegisterStackInfo (uint32_t regStack) override |
| virtual BNIntrinsicClass | GetIntrinsicClass (uint32_t intrinsic) override |
| virtual std::string | GetIntrinsicName (uint32_t intrinsic) override |
| virtual std::vector< uint32_t > | GetAllIntrinsics () override |
| virtual std::vector< NameAndType > | GetIntrinsicInputs (uint32_t intrinsic) override |
| virtual std::vector< Confidence< Ref< Type > > > | GetIntrinsicOutputs (uint32_t intrinsic) override |
| virtual bool | CanAssemble () override |
| Check whether this architecture can assemble instructions. | |
| virtual bool | Assemble (const std::string &code, uint64_t addr, DataBuffer &result, std::string &errors) override |
Converts the string of assembly instructions code loaded at virtual address addr to the byte representation of those instructions. | |
| virtual bool | IsNeverBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
Returns true if the instruction at addr can be patched to never branch. | |
| virtual bool | IsAlwaysBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Returns true if the instruction at addr can be patched to always branch. | |
| virtual bool | IsInvertBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Returns true if the instruction at addr can be patched to invert the branch. | |
| virtual bool | IsSkipAndReturnZeroPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Checks if the instruction at addr is a call that can be patched to return zero. | |
| virtual bool | IsSkipAndReturnValuePatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Checks if the instruction at addr is a call that can be patched to return a value. | |
| virtual bool | ConvertToNop (uint8_t *data, uint64_t addr, size_t len) override |
| Converts the instruction at addr to a no-operation instruction. | |
| virtual bool | AlwaysBranch (uint8_t *data, uint64_t addr, size_t len) override |
| Converts the conditional branch instruction at addr to an unconditional branch. | |
| virtual bool | InvertBranch (uint8_t *data, uint64_t addr, size_t len) override |
| InvertBranch converts the conditional branch instruction at addr to its invert. | |
| virtual bool | SkipAndReturnValue (uint8_t *data, uint64_t addr, size_t len, uint64_t value) override |
| SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value. | |
Public Member Functions inherited from BinaryNinja::Architecture | |
| Architecture (const std::string &name) | |
| std::string | GetName () const |
| Get the name of this architecture. | |
| ExprId | GetDefaultFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, BNFlagRole role, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il) |
| ExprId | GetDefaultFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il) |
| bool | IsGlobalRegister (uint32_t reg) |
| bool | IsSystemRegister (uint32_t reg) |
| Check whether a register is a system register. | |
| std::vector< uint32_t > | GetModifiedRegistersOnWrite (uint32_t reg) |
Returns a list of register indices that are modified when reg is written to. | |
| uint32_t | GetRegisterByName (const std::string &name) |
| Get a register index by its name. | |
| uint32_t | GetRegisterStackForRegister (uint32_t reg) |
| void | RegisterFunctionRecognizer (FunctionRecognizer *recog) |
| void | RegisterRelocationHandler (const std::string &viewName, RelocationHandler *handler) |
| Ref< RelocationHandler > | GetRelocationHandler (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) |
| Register a calling convention with this architecture. | |
| std::vector< Ref< CallingConvention > > | GetCallingConventions () |
| List of registered calling conventions. | |
| Ref< CallingConvention > | GetCallingConventionByName (const std::string &name) |
| Get a calling convention by name. | |
| void | SetDefaultCallingConvention (CallingConvention *cc) |
| Set the default calling convention. | |
| void | SetCdeclCallingConvention (CallingConvention *cc) |
| Set the cdecl calling convention. | |
| void | SetStdcallCallingConvention (CallingConvention *cc) |
| Set the stdcall calling convention. | |
| void | SetFastcallCallingConvention (CallingConvention *cc) |
| Set the fastcall calling convention. | |
| Ref< CallingConvention > | GetDefaultCallingConvention () |
| Get the default calling convention. | |
| Ref< CallingConvention > | GetCdeclCallingConvention () |
| Get the cdecl calling convention. | |
| Ref< CallingConvention > | GetStdcallCallingConvention () |
| Get the stdcall calling convention. | |
| Ref< CallingConvention > | GetFastcallCallingConvention () |
| Get the fastcall calling convention. | |
| Ref< Platform > | GetStandalonePlatform () |
| Get the Architecture standalone platform. | |
| std::vector< Ref< TypeLibrary > > | GetTypeLibraries () |
| 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 () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::Architecture | |
| static void | Register (Architecture *arch) |
| Register an architecture. | |
| static void | DefaultAnalyzeBasicBlocksCallback (BNFunction *function, BNBasicBlockAnalysisContext *context) |
| static void | DefaultAnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) |
| Default implementation of AnalyzeBasicBlocks. | |
| static Ref< Architecture > | GetByName (const std::string &name) |
| Get an Architecture by name. | |
| static std::vector< Ref< Architecture > > | GetList () |
| Get the list of registered Architectures. | |
Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture > | |
| static BNArchitecture * | GetObject (const StaticCoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture > | |
| std::atomic< int > | m_refs |
| BNArchitecture * | m_object |
Protected Member Functions inherited from BinaryNinja::Architecture | |
| Architecture (BNArchitecture *arch) | |
| virtual void | Register (BNCustomArchitecture *callbacks) |
Static Protected Member Functions inherited from BinaryNinja::Architecture | |
| 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 void | AnalyzeBasicBlocksCallback (void *ctxt, BNFunction *function, BNBasicBlockAnalysisContext *context) |
| 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 BNFlagConditionForSemanticClass * | GetFlagConditionsForSemanticFlagGroupCallback (void *ctxt, uint32_t semGroup, size_t *count) |
| static void | FreeFlagConditionsForSemanticFlagGroupCallback (void *ctxt, BNFlagConditionForSemanticClass *conditions, size_t count) |
| 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, size_t len) |
| 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 BNIntrinsicClass | GetIntrinsicClassCallback (void *ctxt, uint32_t intrinsic) |
| static char * | GetIntrinsicNameCallback (void *ctxt, uint32_t intrinsic) |
| static uint32_t * | GetAllIntrinsicsCallback (void *ctxt, size_t *count) |
| static BNNameAndType * | GetIntrinsicInputsCallback (void *ctxt, uint32_t intrinsic, size_t *count) |
| static void | FreeNameAndTypeListCallback (void *ctxt, BNNameAndType *nt, size_t count) |
| static BNTypeWithConfidence * | GetIntrinsicOutputsCallback (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 inherited from BinaryNinja::Architecture | |
| std::string | m_nameForRegister |
| CoreArchitecture::CoreArchitecture | ( | BNArchitecture * | arch | ) |
|
overridevirtual |
Get the default endianness for this architecture.
Implements BinaryNinja::Architecture.
|
overridevirtual |
Get the address size for this architecture.
Implements BinaryNinja::Architecture.
|
overridevirtual |
Get the default integer size for this architecture.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the maximum instruction length.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Retrieves an InstructionInfo struct for the instruction at the given virtual address.
If the instruction is a branch instruction architecture plugins should add a branch of the proper type:
===================== =================================================== BNBranchType Description ===================== =================================================== UnconditionalBranch Branch will always be taken FalseBranch False branch condition TrueBranch True branch condition CallDestination Branch is a call instruction (Branch with Link) FunctionReturn Branch returns from a function SystemCall System call instruction IndirectBranch Branch destination is a memory address or register UnresolvedBranch Branch destination is an unknown address ===================== ===================================================
| [in] | data | pointer to the instruction data to retrieve info for |
| [in] | addr | address of the instruction data to retrieve info for |
| [in] | maxLen | Maximum length of the instruction data to read |
| [out] | result | Retrieved instruction info |
Implements BinaryNinja::Architecture.
|
overridevirtual |
Retrieves a list of InstructionTextTokens.
| [in] | data | pointer to the instruction data to retrieve text for |
| [in] | addr | address of the instruction data to retrieve text for |
| [out] | len | will be written to with the length of the instruction data which was translated |
| [out] | result |
Implements BinaryNinja::Architecture.
|
overridevirtual |
Translates an instruction at addr and appends it onto the LowLevelILFunction& il.
| [in] | data | pointer to the instruction data to be translated |
| [in] | addr | address of the instruction data to be translated |
| [out] | len | will be written to with the length of the instruction data which was translated |
| [in,out] | il | the LowLevelILFunction to appended to. |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Analyze the basic blocks of a function.
| function | Function to analyze |
| context | Context for the analysis |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets a register name from a register index.
| reg | Register index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets a flag name from a flag index.
| flag | Flag index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets the flag write type name for the given flag.
| flags | flag |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets the name of a semantic flag class from the index.
| semClass | Semantic class index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets the name of a semantic flag group from the index.
| semGroup | Semantic flag group index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of full width register indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all register indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all flag indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all flag write type indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all semantic flag class indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all semantic flag group indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the role of a given flag.
| flag | Flag index |
| semClass | Optional semantic flag class |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the register info for a given register index.
| reg | Register index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the register index corresponding to the stack pointer (SP)
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the register index corresponding to the link register (LR)
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of system register indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get a register stack name from a register stack number.
| regStack | Register stack number |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Check whether this architecture can assemble instructions.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Converts the string of assembly instructions code loaded at virtual address addr to the byte representation of those instructions.
| [in] | code | String representation of the instructions to be assembled |
| [in] | addr | Address of the instructions |
| [out] | result | DataBuffer containing the compiled bytes |
| [out] | errors | Any errors that occurred during assembly |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Returns true if the instruction at addr can be patched to never branch.
| data | Buffer of bytes to check |
| addr | the virtual address of the bytes, to be used when assembling |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Returns true if the instruction at addr can be patched to always branch.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Returns true if the instruction at addr can be patched to invert the branch.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Checks if the instruction at addr is a call that can be patched to return zero.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Checks if the instruction at addr is a call that can be patched to return a value.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Converts the instruction at addr to a no-operation instruction.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Converts the conditional branch instruction at addr to an unconditional branch.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
InvertBranch converts the conditional branch instruction at addr to its invert.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
| [in] | value | Value to be returned |
Reimplemented from BinaryNinja::Architecture.
| class BinaryNinja::ArchitectureExtension |
Public Member Functions | |
| ArchitectureExtension (const std::string &name, Architecture *base) | |
| Ref< Architecture > | GetBaseArchitecture () const |
| virtual BNEndianness | GetEndianness () const override |
| Get the default endianness for this architecture. | |
| virtual size_t | GetAddressSize () const override |
| Get the address size for this architecture. | |
| virtual size_t | GetDefaultIntegerSize () const override |
| Get the default integer size for this architecture. | |
| virtual size_t | GetInstructionAlignment () const override |
| virtual size_t | GetMaxInstructionLength () const override |
| Get the maximum instruction length. | |
| virtual size_t | GetOpcodeDisplayLength () const override |
| virtual Ref< Architecture > | GetAssociatedArchitectureByAddress (uint64_t &addr) override |
| virtual bool | GetInstructionInfo (const uint8_t *data, uint64_t addr, size_t maxLen, InstructionInfo &result) override |
| Retrieves an InstructionInfo struct for the instruction at the given virtual address. | |
| virtual bool | GetInstructionText (const uint8_t *data, uint64_t addr, size_t &len, std::vector< InstructionTextToken > &result) override |
| Retrieves a list of InstructionTextTokens. | |
| virtual bool | GetInstructionLowLevelIL (const uint8_t *data, uint64_t addr, size_t &len, LowLevelILFunction &il) override |
| Translates an instruction at addr and appends it onto the LowLevelILFunction& il. | |
| virtual std::string | GetRegisterName (uint32_t reg) override |
| Gets a register name from a register index. | |
| virtual std::string | GetFlagName (uint32_t flag) override |
| Gets a flag name from a flag index. | |
| virtual std::string | GetFlagWriteTypeName (uint32_t flags) override |
| Gets the flag write type name for the given flag. | |
| virtual std::string | GetSemanticFlagClassName (uint32_t semClass) override |
| Gets the name of a semantic flag class from the index. | |
| virtual std::string | GetSemanticFlagGroupName (uint32_t semGroup) override |
| Gets the name of a semantic flag group from the index. | |
| virtual std::vector< uint32_t > | GetFullWidthRegisters () override |
| Get the list of full width register indices. | |
| virtual std::vector< uint32_t > | GetAllRegisters () override |
| Get the list of all register indices. | |
| virtual std::vector< uint32_t > | GetAllFlags () override |
| Get the list of all flag indices. | |
| virtual std::vector< uint32_t > | GetAllFlagWriteTypes () override |
| Get the list of all flag write type indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagClasses () override |
| Get the list of all semantic flag class indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagGroups () override |
| Get the list of all semantic flag group indices. | |
| virtual BNFlagRole | GetFlagRole (uint32_t flag, uint32_t semClass=0) override |
| Get the role of a given flag. | |
| virtual std::vector< uint32_t > | GetFlagsRequiredForFlagCondition (BNLowLevelILFlagCondition cond, uint32_t semClass=0) override |
| virtual std::vector< uint32_t > | GetFlagsRequiredForSemanticFlagGroup (uint32_t semGroup) override |
| virtual std::map< uint32_t, BNLowLevelILFlagCondition > | GetFlagConditionsForSemanticFlagGroup (uint32_t semGroup) override |
| virtual std::vector< uint32_t > | GetFlagsWrittenByFlagWriteType (uint32_t writeType) override |
| virtual uint32_t | GetSemanticClassForFlagWriteType (uint32_t writeType) override |
| virtual ExprId | GetFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, uint32_t flagWriteType, uint32_t flag, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il) override |
| virtual ExprId | GetFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il) override |
| virtual ExprId | GetSemanticFlagGroupLowLevelIL (uint32_t semGroup, LowLevelILFunction &il) override |
| virtual BNRegisterInfo | GetRegisterInfo (uint32_t reg) override |
| Get the register info for a given register index. | |
| virtual uint32_t | GetStackPointerRegister () override |
| Get the register index corresponding to the stack pointer (SP) | |
| virtual uint32_t | GetLinkRegister () override |
| Get the register index corresponding to the link register (LR) | |
| virtual std::vector< uint32_t > | GetGlobalRegisters () override |
| virtual std::vector< uint32_t > | GetSystemRegisters () override |
| Get the list of system register indices. | |
| virtual std::string | GetRegisterStackName (uint32_t regStack) override |
| Get a register stack name from a register stack number. | |
| virtual std::vector< uint32_t > | GetAllRegisterStacks () override |
| virtual BNRegisterStackInfo | GetRegisterStackInfo (uint32_t regStack) override |
| virtual BNIntrinsicClass | GetIntrinsicClass (uint32_t intrinsic) override |
| virtual std::string | GetIntrinsicName (uint32_t intrinsic) override |
| virtual std::vector< uint32_t > | GetAllIntrinsics () override |
| virtual std::vector< NameAndType > | GetIntrinsicInputs (uint32_t intrinsic) override |
| virtual std::vector< Confidence< Ref< Type > > > | GetIntrinsicOutputs (uint32_t intrinsic) override |
| virtual bool | CanAssemble () override |
| Check whether this architecture can assemble instructions. | |
| virtual bool | Assemble (const std::string &code, uint64_t addr, DataBuffer &result, std::string &errors) override |
Converts the string of assembly instructions code loaded at virtual address addr to the byte representation of those instructions. | |
| virtual bool | IsNeverBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
Returns true if the instruction at addr can be patched to never branch. | |
| virtual bool | IsAlwaysBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Returns true if the instruction at addr can be patched to always branch. | |
| virtual bool | IsInvertBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Returns true if the instruction at addr can be patched to invert the branch. | |
| virtual bool | IsSkipAndReturnZeroPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Checks if the instruction at addr is a call that can be patched to return zero. | |
| virtual bool | IsSkipAndReturnValuePatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Checks if the instruction at addr is a call that can be patched to return a value. | |
| virtual bool | ConvertToNop (uint8_t *data, uint64_t addr, size_t len) override |
| Converts the instruction at addr to a no-operation instruction. | |
| virtual bool | AlwaysBranch (uint8_t *data, uint64_t addr, size_t len) override |
| Converts the conditional branch instruction at addr to an unconditional branch. | |
| virtual bool | InvertBranch (uint8_t *data, uint64_t addr, size_t len) override |
| InvertBranch converts the conditional branch instruction at addr to its invert. | |
| virtual bool | SkipAndReturnValue (uint8_t *data, uint64_t addr, size_t len, uint64_t value) override |
| SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value. | |
Public Member Functions inherited from BinaryNinja::Architecture | |
| Architecture (const std::string &name) | |
| std::string | GetName () const |
| Get the name of this architecture. | |
| virtual void | AnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) |
| Analyze the basic blocks of a function. | |
| ExprId | GetDefaultFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, BNFlagRole role, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il) |
| ExprId | GetDefaultFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il) |
| bool | IsGlobalRegister (uint32_t reg) |
| bool | IsSystemRegister (uint32_t reg) |
| Check whether a register is a system register. | |
| std::vector< uint32_t > | GetModifiedRegistersOnWrite (uint32_t reg) |
Returns a list of register indices that are modified when reg is written to. | |
| uint32_t | GetRegisterByName (const std::string &name) |
| Get a register index by its name. | |
| uint32_t | GetRegisterStackForRegister (uint32_t reg) |
| void | RegisterFunctionRecognizer (FunctionRecognizer *recog) |
| void | RegisterRelocationHandler (const std::string &viewName, RelocationHandler *handler) |
| Ref< RelocationHandler > | GetRelocationHandler (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) |
| Register a calling convention with this architecture. | |
| std::vector< Ref< CallingConvention > > | GetCallingConventions () |
| List of registered calling conventions. | |
| Ref< CallingConvention > | GetCallingConventionByName (const std::string &name) |
| Get a calling convention by name. | |
| void | SetDefaultCallingConvention (CallingConvention *cc) |
| Set the default calling convention. | |
| void | SetCdeclCallingConvention (CallingConvention *cc) |
| Set the cdecl calling convention. | |
| void | SetStdcallCallingConvention (CallingConvention *cc) |
| Set the stdcall calling convention. | |
| void | SetFastcallCallingConvention (CallingConvention *cc) |
| Set the fastcall calling convention. | |
| Ref< CallingConvention > | GetDefaultCallingConvention () |
| Get the default calling convention. | |
| Ref< CallingConvention > | GetCdeclCallingConvention () |
| Get the cdecl calling convention. | |
| Ref< CallingConvention > | GetStdcallCallingConvention () |
| Get the stdcall calling convention. | |
| Ref< CallingConvention > | GetFastcallCallingConvention () |
| Get the fastcall calling convention. | |
| Ref< Platform > | GetStandalonePlatform () |
| Get the Architecture standalone platform. | |
| std::vector< Ref< TypeLibrary > > | GetTypeLibraries () |
| 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 () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Protected Member Functions | |
| virtual void | Register (BNCustomArchitecture *callbacks) override |
Protected Member Functions inherited from BinaryNinja::Architecture | |
| Architecture (BNArchitecture *arch) | |
Protected Attributes | |
| Ref< Architecture > | m_base |
Protected Attributes inherited from BinaryNinja::Architecture | |
| std::string | m_nameForRegister |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::Architecture | |
| static void | Register (Architecture *arch) |
| Register an architecture. | |
| static void | DefaultAnalyzeBasicBlocksCallback (BNFunction *function, BNBasicBlockAnalysisContext *context) |
| static void | DefaultAnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) |
| Default implementation of AnalyzeBasicBlocks. | |
| static Ref< Architecture > | GetByName (const std::string &name) |
| Get an Architecture by name. | |
| static std::vector< Ref< Architecture > > | GetList () |
| Get the list of registered Architectures. | |
Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture > | |
| static BNArchitecture * | GetObject (const StaticCoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture > | |
| std::atomic< int > | m_refs |
| BNArchitecture * | m_object |
Static Protected Member Functions inherited from BinaryNinja::Architecture | |
| 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 void | AnalyzeBasicBlocksCallback (void *ctxt, BNFunction *function, BNBasicBlockAnalysisContext *context) |
| 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 BNFlagConditionForSemanticClass * | GetFlagConditionsForSemanticFlagGroupCallback (void *ctxt, uint32_t semGroup, size_t *count) |
| static void | FreeFlagConditionsForSemanticFlagGroupCallback (void *ctxt, BNFlagConditionForSemanticClass *conditions, size_t count) |
| 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, size_t len) |
| 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 BNIntrinsicClass | GetIntrinsicClassCallback (void *ctxt, uint32_t intrinsic) |
| static char * | GetIntrinsicNameCallback (void *ctxt, uint32_t intrinsic) |
| static uint32_t * | GetAllIntrinsicsCallback (void *ctxt, size_t *count) |
| static BNNameAndType * | GetIntrinsicInputsCallback (void *ctxt, uint32_t intrinsic, size_t *count) |
| static void | FreeNameAndTypeListCallback (void *ctxt, BNNameAndType *nt, size_t count) |
| static BNTypeWithConfidence * | GetIntrinsicOutputsCallback (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) |
| ArchitectureExtension::ArchitectureExtension | ( | const std::string & | name, |
| Architecture * | base ) |
|
overrideprotectedvirtual |
Reimplemented from BinaryNinja::Architecture.
|
inline |
|
overridevirtual |
Get the default endianness for this architecture.
Implements BinaryNinja::Architecture.
|
overridevirtual |
Get the address size for this architecture.
Implements BinaryNinja::Architecture.
|
overridevirtual |
Get the default integer size for this architecture.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the maximum instruction length.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Retrieves an InstructionInfo struct for the instruction at the given virtual address.
If the instruction is a branch instruction architecture plugins should add a branch of the proper type:
===================== =================================================== BNBranchType Description ===================== =================================================== UnconditionalBranch Branch will always be taken FalseBranch False branch condition TrueBranch True branch condition CallDestination Branch is a call instruction (Branch with Link) FunctionReturn Branch returns from a function SystemCall System call instruction IndirectBranch Branch destination is a memory address or register UnresolvedBranch Branch destination is an unknown address ===================== ===================================================
| [in] | data | pointer to the instruction data to retrieve info for |
| [in] | addr | address of the instruction data to retrieve info for |
| [in] | maxLen | Maximum length of the instruction data to read |
| [out] | result | Retrieved instruction info |
Implements BinaryNinja::Architecture.
|
overridevirtual |
Retrieves a list of InstructionTextTokens.
| [in] | data | pointer to the instruction data to retrieve text for |
| [in] | addr | address of the instruction data to retrieve text for |
| [out] | len | will be written to with the length of the instruction data which was translated |
| [out] | result |
Implements BinaryNinja::Architecture.
|
overridevirtual |
Translates an instruction at addr and appends it onto the LowLevelILFunction& il.
| [in] | data | pointer to the instruction data to be translated |
| [in] | addr | address of the instruction data to be translated |
| [out] | len | will be written to with the length of the instruction data which was translated |
| [in,out] | il | the LowLevelILFunction to appended to. |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets a register name from a register index.
| reg | Register index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets a flag name from a flag index.
| flag | Flag index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets the flag write type name for the given flag.
| flags | flag |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets the name of a semantic flag class from the index.
| semClass | Semantic class index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Gets the name of a semantic flag group from the index.
| semGroup | Semantic flag group index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of full width register indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all register indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all flag indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all flag write type indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all semantic flag class indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of all semantic flag group indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the role of a given flag.
| flag | Flag index |
| semClass | Optional semantic flag class |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the register info for a given register index.
| reg | Register index |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the register index corresponding to the stack pointer (SP)
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the register index corresponding to the link register (LR)
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get the list of system register indices.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Get a register stack name from a register stack number.
| regStack | Register stack number |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Check whether this architecture can assemble instructions.
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Converts the string of assembly instructions code loaded at virtual address addr to the byte representation of those instructions.
| [in] | code | String representation of the instructions to be assembled |
| [in] | addr | Address of the instructions |
| [out] | result | DataBuffer containing the compiled bytes |
| [out] | errors | Any errors that occurred during assembly |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Returns true if the instruction at addr can be patched to never branch.
| data | Buffer of bytes to check |
| addr | the virtual address of the bytes, to be used when assembling |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Returns true if the instruction at addr can be patched to always branch.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Returns true if the instruction at addr can be patched to invert the branch.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Checks if the instruction at addr is a call that can be patched to return zero.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Checks if the instruction at addr is a call that can be patched to return a value.
| data | Buffer of bytes to check |
| addr | the address of the instruction in question |
| len | amount of bytes to be checked |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Converts the instruction at addr to a no-operation instruction.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
Converts the conditional branch instruction at addr to an unconditional branch.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
InvertBranch converts the conditional branch instruction at addr to its invert.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
Reimplemented from BinaryNinja::Architecture.
|
overridevirtual |
SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value.
| [in,out] | data | Buffer of bytes to convert |
| [in] | addr | the address of the instruction to be converted |
| [in] | len | Length of the bytes to be converted |
| [in] | value | Value to be returned |
Reimplemented from BinaryNinja::Architecture.
|
protected |
| class BinaryNinja::ArchitectureHook |
Public Member Functions | |
| ArchitectureHook (Architecture *base) | |
Public Member Functions inherited from BinaryNinja::CoreArchitecture | |
| CoreArchitecture (BNArchitecture *arch) | |
| virtual BNEndianness | GetEndianness () const override |
| Get the default endianness for this architecture. | |
| virtual size_t | GetAddressSize () const override |
| Get the address size for this architecture. | |
| virtual size_t | GetDefaultIntegerSize () const override |
| Get the default integer size for this architecture. | |
| virtual size_t | GetInstructionAlignment () const override |
| virtual size_t | GetMaxInstructionLength () const override |
| Get the maximum instruction length. | |
| virtual size_t | GetOpcodeDisplayLength () const override |
| virtual Ref< Architecture > | GetAssociatedArchitectureByAddress (uint64_t &addr) override |
| virtual bool | GetInstructionInfo (const uint8_t *data, uint64_t addr, size_t maxLen, InstructionInfo &result) override |
| Retrieves an InstructionInfo struct for the instruction at the given virtual address. | |
| virtual bool | GetInstructionText (const uint8_t *data, uint64_t addr, size_t &len, std::vector< InstructionTextToken > &result) override |
| Retrieves a list of InstructionTextTokens. | |
| virtual bool | GetInstructionLowLevelIL (const uint8_t *data, uint64_t addr, size_t &len, LowLevelILFunction &il) override |
| Translates an instruction at addr and appends it onto the LowLevelILFunction& il. | |
| virtual void | AnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) override |
| Analyze the basic blocks of a function. | |
| virtual std::string | GetRegisterName (uint32_t reg) override |
| Gets a register name from a register index. | |
| virtual std::string | GetFlagName (uint32_t flag) override |
| Gets a flag name from a flag index. | |
| virtual std::string | GetFlagWriteTypeName (uint32_t flags) override |
| Gets the flag write type name for the given flag. | |
| virtual std::string | GetSemanticFlagClassName (uint32_t semClass) override |
| Gets the name of a semantic flag class from the index. | |
| virtual std::string | GetSemanticFlagGroupName (uint32_t semGroup) override |
| Gets the name of a semantic flag group from the index. | |
| virtual std::vector< uint32_t > | GetFullWidthRegisters () override |
| Get the list of full width register indices. | |
| virtual std::vector< uint32_t > | GetAllRegisters () override |
| Get the list of all register indices. | |
| virtual std::vector< uint32_t > | GetAllFlags () override |
| Get the list of all flag indices. | |
| virtual std::vector< uint32_t > | GetAllFlagWriteTypes () override |
| Get the list of all flag write type indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagClasses () override |
| Get the list of all semantic flag class indices. | |
| virtual std::vector< uint32_t > | GetAllSemanticFlagGroups () override |
| Get the list of all semantic flag group indices. | |
| virtual BNFlagRole | GetFlagRole (uint32_t flag, uint32_t semClass=0) override |
| Get the role of a given flag. | |
| virtual std::vector< uint32_t > | GetFlagsRequiredForFlagCondition (BNLowLevelILFlagCondition cond, uint32_t semClass=0) override |
| virtual std::vector< uint32_t > | GetFlagsRequiredForSemanticFlagGroup (uint32_t semGroup) override |
| virtual std::map< uint32_t, BNLowLevelILFlagCondition > | GetFlagConditionsForSemanticFlagGroup (uint32_t semGroup) override |
| virtual std::vector< uint32_t > | GetFlagsWrittenByFlagWriteType (uint32_t writeType) override |
| virtual uint32_t | GetSemanticClassForFlagWriteType (uint32_t writeType) override |
| virtual ExprId | GetFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, uint32_t flagWriteType, uint32_t flag, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il) override |
| virtual ExprId | GetFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il) override |
| virtual ExprId | GetSemanticFlagGroupLowLevelIL (uint32_t semGroup, LowLevelILFunction &il) override |
| virtual BNRegisterInfo | GetRegisterInfo (uint32_t reg) override |
| Get the register info for a given register index. | |
| virtual uint32_t | GetStackPointerRegister () override |
| Get the register index corresponding to the stack pointer (SP) | |
| virtual uint32_t | GetLinkRegister () override |
| Get the register index corresponding to the link register (LR) | |
| virtual std::vector< uint32_t > | GetGlobalRegisters () override |
| virtual std::vector< uint32_t > | GetSystemRegisters () override |
| Get the list of system register indices. | |
| virtual std::string | GetRegisterStackName (uint32_t regStack) override |
| Get a register stack name from a register stack number. | |
| virtual std::vector< uint32_t > | GetAllRegisterStacks () override |
| virtual BNRegisterStackInfo | GetRegisterStackInfo (uint32_t regStack) override |
| virtual BNIntrinsicClass | GetIntrinsicClass (uint32_t intrinsic) override |
| virtual std::string | GetIntrinsicName (uint32_t intrinsic) override |
| virtual std::vector< uint32_t > | GetAllIntrinsics () override |
| virtual std::vector< NameAndType > | GetIntrinsicInputs (uint32_t intrinsic) override |
| virtual std::vector< Confidence< Ref< Type > > > | GetIntrinsicOutputs (uint32_t intrinsic) override |
| virtual bool | CanAssemble () override |
| Check whether this architecture can assemble instructions. | |
| virtual bool | Assemble (const std::string &code, uint64_t addr, DataBuffer &result, std::string &errors) override |
Converts the string of assembly instructions code loaded at virtual address addr to the byte representation of those instructions. | |
| virtual bool | IsNeverBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
Returns true if the instruction at addr can be patched to never branch. | |
| virtual bool | IsAlwaysBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Returns true if the instruction at addr can be patched to always branch. | |
| virtual bool | IsInvertBranchPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Returns true if the instruction at addr can be patched to invert the branch. | |
| virtual bool | IsSkipAndReturnZeroPatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Checks if the instruction at addr is a call that can be patched to return zero. | |
| virtual bool | IsSkipAndReturnValuePatchAvailable (const uint8_t *data, uint64_t addr, size_t len) override |
| Checks if the instruction at addr is a call that can be patched to return a value. | |
| virtual bool | ConvertToNop (uint8_t *data, uint64_t addr, size_t len) override |
| Converts the instruction at addr to a no-operation instruction. | |
| virtual bool | AlwaysBranch (uint8_t *data, uint64_t addr, size_t len) override |
| Converts the conditional branch instruction at addr to an unconditional branch. | |
| virtual bool | InvertBranch (uint8_t *data, uint64_t addr, size_t len) override |
| InvertBranch converts the conditional branch instruction at addr to its invert. | |
| virtual bool | SkipAndReturnValue (uint8_t *data, uint64_t addr, size_t len, uint64_t value) override |
| SkipAndReturnValue converts the call instruction at addr to an instruction that simulates that call returning a value. | |
Public Member Functions inherited from BinaryNinja::Architecture | |
| Architecture (const std::string &name) | |
| std::string | GetName () const |
| Get the name of this architecture. | |
| ExprId | GetDefaultFlagWriteLowLevelIL (BNLowLevelILOperation op, size_t size, BNFlagRole role, BNRegisterOrConstant *operands, size_t operandCount, LowLevelILFunction &il) |
| ExprId | GetDefaultFlagConditionLowLevelIL (BNLowLevelILFlagCondition cond, uint32_t semClass, LowLevelILFunction &il) |
| bool | IsGlobalRegister (uint32_t reg) |
| bool | IsSystemRegister (uint32_t reg) |
| Check whether a register is a system register. | |
| std::vector< uint32_t > | GetModifiedRegistersOnWrite (uint32_t reg) |
Returns a list of register indices that are modified when reg is written to. | |
| uint32_t | GetRegisterByName (const std::string &name) |
| Get a register index by its name. | |
| uint32_t | GetRegisterStackForRegister (uint32_t reg) |
| void | RegisterFunctionRecognizer (FunctionRecognizer *recog) |
| void | RegisterRelocationHandler (const std::string &viewName, RelocationHandler *handler) |
| Ref< RelocationHandler > | GetRelocationHandler (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) |
| Register a calling convention with this architecture. | |
| std::vector< Ref< CallingConvention > > | GetCallingConventions () |
| List of registered calling conventions. | |
| Ref< CallingConvention > | GetCallingConventionByName (const std::string &name) |
| Get a calling convention by name. | |
| void | SetDefaultCallingConvention (CallingConvention *cc) |
| Set the default calling convention. | |
| void | SetCdeclCallingConvention (CallingConvention *cc) |
| Set the cdecl calling convention. | |
| void | SetStdcallCallingConvention (CallingConvention *cc) |
| Set the stdcall calling convention. | |
| void | SetFastcallCallingConvention (CallingConvention *cc) |
| Set the fastcall calling convention. | |
| Ref< CallingConvention > | GetDefaultCallingConvention () |
| Get the default calling convention. | |
| Ref< CallingConvention > | GetCdeclCallingConvention () |
| Get the cdecl calling convention. | |
| Ref< CallingConvention > | GetStdcallCallingConvention () |
| Get the stdcall calling convention. | |
| Ref< CallingConvention > | GetFastcallCallingConvention () |
| Get the fastcall calling convention. | |
| Ref< Platform > | GetStandalonePlatform () |
| Get the Architecture standalone platform. | |
| std::vector< Ref< TypeLibrary > > | GetTypeLibraries () |
| 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 () |
| void | AddRefForCallback () |
| void | ReleaseForCallback () |
Protected Member Functions | |
| virtual void | Register (BNCustomArchitecture *callbacks) override |
Protected Member Functions inherited from BinaryNinja::Architecture | |
| Architecture (BNArchitecture *arch) | |
Protected Attributes | |
| Ref< Architecture > | m_base |
Protected Attributes inherited from BinaryNinja::Architecture | |
| std::string | m_nameForRegister |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::Architecture | |
| static void | Register (Architecture *arch) |
| Register an architecture. | |
| static void | DefaultAnalyzeBasicBlocksCallback (BNFunction *function, BNBasicBlockAnalysisContext *context) |
| static void | DefaultAnalyzeBasicBlocks (Function *function, BasicBlockAnalysisContext &context) |
| Default implementation of AnalyzeBasicBlocks. | |
| static Ref< Architecture > | GetByName (const std::string &name) |
| Get an Architecture by name. | |
| static std::vector< Ref< Architecture > > | GetList () |
| Get the list of registered Architectures. | |
Static Public Member Functions inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture > | |
| static BNArchitecture * | GetObject (const StaticCoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::StaticCoreRefCountObject< BNArchitecture > | |
| std::atomic< int > | m_refs |
| BNArchitecture * | m_object |
Static Protected Member Functions inherited from BinaryNinja::Architecture | |
| 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 void | AnalyzeBasicBlocksCallback (void *ctxt, BNFunction *function, BNBasicBlockAnalysisContext *context) |
| 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 BNFlagConditionForSemanticClass * | GetFlagConditionsForSemanticFlagGroupCallback (void *ctxt, uint32_t semGroup, size_t *count) |
| static void | FreeFlagConditionsForSemanticFlagGroupCallback (void *ctxt, BNFlagConditionForSemanticClass *conditions, size_t count) |
| 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, size_t len) |
| 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 BNIntrinsicClass | GetIntrinsicClassCallback (void *ctxt, uint32_t intrinsic) |
| static char * | GetIntrinsicNameCallback (void *ctxt, uint32_t intrinsic) |
| static uint32_t * | GetAllIntrinsicsCallback (void *ctxt, size_t *count) |
| static BNNameAndType * | GetIntrinsicInputsCallback (void *ctxt, uint32_t intrinsic, size_t *count) |
| static void | FreeNameAndTypeListCallback (void *ctxt, BNNameAndType *nt, size_t count) |
| static BNTypeWithConfidence * | GetIntrinsicOutputsCallback (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) |
| ArchitectureHook::ArchitectureHook | ( | Architecture * | base | ) |
|
overrideprotectedvirtual |
Reimplemented from BinaryNinja::Architecture.
|
protected |