pub struct CoreArchitecture { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Architecture for CoreArchitecture
impl Architecture for CoreArchitecture
Source§fn analyze_basic_blocks(
&self,
function: &mut Function,
context: &mut BasicBlockAnalysisContext,
)
fn analyze_basic_blocks( &self, function: &mut Function, context: &mut BasicBlockAnalysisContext, )
Performs basic block recovery and commits the results to the function analysis.
NOTE: Only implement this method if function-level analysis is required. Otherwise, do not implement to let default basic block analysis take place.
NOTE: The default implementation exists in C++ here: https://github.com/Vector35/binaryninja-api/blob/dev/defaultabb.cpp
type Handle = CoreArchitecture
Source§type RegisterInfo = CoreRegisterInfo
type RegisterInfo = CoreRegisterInfo
The
RegisterInfo associated with this architecture.Source§type Register = CoreRegister
type Register = CoreRegister
The
Register associated with this architecture.Source§type RegisterStackInfo = CoreRegisterStackInfo
type RegisterStackInfo = CoreRegisterStackInfo
The
RegisterStackInfo associated with this architecture. Read moreSource§type RegisterStack = CoreRegisterStack
type RegisterStack = CoreRegisterStack
The
RegisterStack associated with this architecture. Read moretype Intrinsic = CoreIntrinsic
fn endianness(&self) -> Endianness
fn address_size(&self) -> usize
fn default_integer_size(&self) -> usize
fn instruction_alignment(&self) -> usize
Source§fn max_instr_len(&self) -> usize
fn max_instr_len(&self) -> usize
The maximum length of an instruction in bytes. This is used to determine the size of the buffer
given to callbacks such as
Architecture::instruction_info, Architecture::instruction_text
and Architecture::instruction_llil. Read moreSource§fn opcode_display_len(&self) -> usize
fn opcode_display_len(&self) -> usize
How many bytes to display in the opcode space before displaying a
..., typically set to
the Architecture::max_instr_len, however, can be overridden to display a truncated opcode.Source§fn associated_arch_by_addr(&self, addr: u64) -> CoreArchitecture
fn associated_arch_by_addr(&self, addr: u64) -> CoreArchitecture
In binaries with multiple architectures, you may wish to associate a specific architecture
with a given virtual address. This can be seen in armv7 where odd addresses are associated
with the thumb architecture.
Source§fn instruction_info(&self, data: &[u8], addr: u64) -> Option<InstructionInfo>
fn instruction_info(&self, data: &[u8], addr: u64) -> Option<InstructionInfo>
Source§fn instruction_text(
&self,
data: &[u8],
addr: u64,
) -> Option<(usize, Vec<InstructionTextToken>)>
fn instruction_text( &self, data: &[u8], addr: u64, ) -> Option<(usize, Vec<InstructionTextToken>)>
Disassembles a raw byte sequence into a human-readable list of text tokens. Read more
Source§fn instruction_llil(
&self,
data: &[u8],
addr: u64,
il: &LowLevelILMutableFunction,
) -> Option<(usize, bool)>
fn instruction_llil( &self, data: &[u8], addr: u64, il: &LowLevelILMutableFunction, ) -> Option<(usize, bool)>
Appends arbitrary low-level il instructions to
il. Read morefn lift_function( &self, function: LowLevelILMutableFunction, context: &mut FunctionLifterContext, ) -> bool
Source§fn flag_write_llil<'a>(
&self,
_flag: Self::Flag,
_flag_write: Self::FlagWrite,
_op: LowLevelILFlagWriteOp<Self::Register>,
_il: &'a LowLevelILMutableFunction,
) -> Option<LowLevelILMutableExpression<'a, ValueExpr>>
fn flag_write_llil<'a>( &self, _flag: Self::Flag, _flag_write: Self::FlagWrite, _op: LowLevelILFlagWriteOp<Self::Register>, _il: &'a LowLevelILMutableFunction, ) -> Option<LowLevelILMutableExpression<'a, ValueExpr>>
Fallback flag value calculation path. This method is invoked when the core is unable to
recover the flag using semantics and resorts to emitting instructions that explicitly set each
observed flag to the value of an expression returned by this function. Read more
Source§fn flags_required_for_flag_condition(
&self,
condition: FlagCondition,
class: Option<Self::FlagClass>,
) -> Vec<Self::Flag>
fn flags_required_for_flag_condition( &self, condition: FlagCondition, class: Option<Self::FlagClass>, ) -> Vec<Self::Flag>
Determines what flags need to be examined to attempt automatic recovery of the flag uses semantics. Read more
Source§fn flag_cond_llil<'a>(
&self,
_cond: FlagCondition,
_class: Option<Self::FlagClass>,
_il: &'a LowLevelILMutableFunction,
) -> Option<LowLevelILMutableExpression<'a, ValueExpr>>
fn flag_cond_llil<'a>( &self, _cond: FlagCondition, _class: Option<Self::FlagClass>, _il: &'a LowLevelILMutableFunction, ) -> Option<LowLevelILMutableExpression<'a, ValueExpr>>
This function MUST NOT append instructions that have side effects. Read more
Source§fn flag_group_llil<'a>(
&self,
_group: Self::FlagGroup,
_il: &'a LowLevelILMutableFunction,
) -> Option<LowLevelILMutableExpression<'a, ValueExpr>>
fn flag_group_llil<'a>( &self, _group: Self::FlagGroup, _il: &'a LowLevelILMutableFunction, ) -> Option<LowLevelILMutableExpression<'a, ValueExpr>>
Performs fallback resolution when the core was unable to recover the semantics of a
LLIL_FLAG_GROUP expression. This occurs when multiple instructions may have set the flags
at the flag group query, or when the FlagGroup::flag_conditions() map doesn’t have an entry
for the FlagClass associated with the FlagWrite type of the expression that last set
the flags required by the FlagGroup group. Read morefn registers_all(&self) -> Vec<CoreRegister>
fn register_from_id(&self, id: RegisterId) -> Option<CoreRegister>
fn registers_full_width(&self) -> Vec<CoreRegister>
fn registers_global(&self) -> Vec<CoreRegister>
fn registers_system(&self) -> Vec<CoreRegister>
fn stack_pointer_reg(&self) -> Option<CoreRegister>
fn link_reg(&self) -> Option<CoreRegister>
Source§fn register_stacks(&self) -> Vec<CoreRegisterStack>
fn register_stacks(&self) -> Vec<CoreRegisterStack>
List of concrete register stacks for this architecture. Read more
Source§fn register_stack_from_id(
&self,
id: RegisterStackId,
) -> Option<CoreRegisterStack>
fn register_stack_from_id( &self, id: RegisterStackId, ) -> Option<CoreRegisterStack>
Source§fn flag_write_types(&self) -> Vec<CoreFlagWrite>
fn flag_write_types(&self) -> Vec<CoreFlagWrite>
List of concrete flag write types for this architecture. Read more
Source§fn flag_write_from_id(&self, id: FlagWriteId) -> Option<CoreFlagWrite>
fn flag_write_from_id(&self, id: FlagWriteId) -> Option<CoreFlagWrite>
Source§fn flag_classes(&self) -> Vec<CoreFlagClass>
fn flag_classes(&self) -> Vec<CoreFlagClass>
List of concrete flag classes for this architecture. Read more
Source§fn flag_class_from_id(&self, id: FlagClassId) -> Option<CoreFlagClass>
fn flag_class_from_id(&self, id: FlagClassId) -> Option<CoreFlagClass>
Source§fn flag_groups(&self) -> Vec<CoreFlagGroup>
fn flag_groups(&self) -> Vec<CoreFlagGroup>
List of concrete flag groups for this architecture. Read more
Source§fn flag_group_from_id(&self, id: FlagGroupId) -> Option<CoreFlagGroup>
fn flag_group_from_id(&self, id: FlagGroupId) -> Option<CoreFlagGroup>
Source§fn intrinsics(&self) -> Vec<CoreIntrinsic>
fn intrinsics(&self) -> Vec<CoreIntrinsic>
List of concrete intrinsics for this architecture. Read more
Source§fn intrinsic_from_id(&self, id: IntrinsicId) -> Option<CoreIntrinsic>
fn intrinsic_from_id(&self, id: IntrinsicId) -> Option<CoreIntrinsic>
Source§fn can_assemble(&self) -> bool
fn can_assemble(&self) -> bool
Let the UI display this patch option. Read more
Source§fn assemble(&self, code: &str, addr: u64) -> Result<Vec<u8>, String>
fn assemble(&self, code: &str, addr: u64) -> Result<Vec<u8>, String>
Assemble the code at the specified address and return the machine code in bytes. Read more
Source§fn is_never_branch_patch_available(&self, data: &[u8], addr: u64) -> bool
fn is_never_branch_patch_available(&self, data: &[u8], addr: u64) -> bool
Let the UI display this patch option. Read more
Source§fn is_always_branch_patch_available(&self, data: &[u8], addr: u64) -> bool
fn is_always_branch_patch_available(&self, data: &[u8], addr: u64) -> bool
Let the UI display this patch option. Read more
Source§fn is_invert_branch_patch_available(&self, data: &[u8], addr: u64) -> bool
fn is_invert_branch_patch_available(&self, data: &[u8], addr: u64) -> bool
Let the UI display this patch option. Read more
Source§fn is_skip_and_return_zero_patch_available(
&self,
data: &[u8],
addr: u64,
) -> bool
fn is_skip_and_return_zero_patch_available( &self, data: &[u8], addr: u64, ) -> bool
Let the UI display this patch option. Read more
Source§fn is_skip_and_return_value_patch_available(
&self,
data: &[u8],
addr: u64,
) -> bool
fn is_skip_and_return_value_patch_available( &self, data: &[u8], addr: u64, ) -> bool
Let the UI display this patch option. Read more
fn convert_to_nop(&self, data: &mut [u8], addr: u64) -> bool
Source§fn always_branch(&self, data: &mut [u8], addr: u64) -> bool
fn always_branch(&self, data: &mut [u8], addr: u64) -> bool
Patch the instruction to always branch. Read more
Source§fn invert_branch(&self, data: &mut [u8], addr: u64) -> bool
fn invert_branch(&self, data: &mut [u8], addr: u64) -> bool
Patch the instruction to invert the branch condition. Read more
Source§fn skip_and_return_value(&self, data: &mut [u8], addr: u64, value: u64) -> bool
fn skip_and_return_value(&self, data: &mut [u8], addr: u64, value: u64) -> bool
Patch the instruction to skip and return value. Read more
fn handle(&self) -> CoreArchitecture
fn intrinsic_class(&self, _id: IntrinsicId) -> BNIntrinsicClass
Source§impl AsRef<CoreArchitecture> for CoreArchitecture
impl AsRef<CoreArchitecture> for CoreArchitecture
Source§impl Clone for CoreArchitecture
impl Clone for CoreArchitecture
Source§fn clone(&self) -> CoreArchitecture
fn clone(&self) -> CoreArchitecture
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CoreArchitecture
impl Debug for CoreArchitecture
Source§impl Hash for CoreArchitecture
impl Hash for CoreArchitecture
Source§impl PartialEq for CoreArchitecture
impl PartialEq for CoreArchitecture
impl Copy for CoreArchitecture
impl Eq for CoreArchitecture
impl Send for CoreArchitecture
impl StructuralPartialEq for CoreArchitecture
impl Sync for CoreArchitecture
Auto Trait Implementations§
impl Freeze for CoreArchitecture
impl RefUnwindSafe for CoreArchitecture
impl Unpin for CoreArchitecture
impl UnwindSafe for CoreArchitecture
Blanket Implementations§
Source§impl<T> ArchitectureExt for Twhere
T: Architecture,
impl<T> ArchitectureExt for Twhere
T: Architecture,
fn register_by_name(&self, name: &str) -> Option<Self::Register>
fn calling_conventions(&self) -> Array<CoreCallingConvention>
fn get_default_calling_convention(&self) -> Option<Ref<CoreCallingConvention>>
fn set_default_calling_convention(&self, cc: &CoreCallingConvention)
fn get_cdecl_calling_convention(&self) -> Option<Ref<CoreCallingConvention>>
fn set_cdecl_calling_convention(&self, cc: &CoreCallingConvention)
fn get_stdcall_calling_convention(&self) -> Option<Ref<CoreCallingConvention>>
fn set_stdcall_calling_convention(&self, cc: &CoreCallingConvention)
fn get_fastcall_calling_convention(&self) -> Option<Ref<CoreCallingConvention>>
fn set_fastcall_calling_convention(&self, cc: &CoreCallingConvention)
fn standalone_platform(&self) -> Option<Ref<Platform>>
fn relocation_handler( &self, view_name: &str, ) -> Option<Ref<CoreRelocationHandler>>
fn register_relocation_handler<R, F>(&self, name: &str, func: F)where
R: 'static + RelocationHandler<Handle = CustomRelocationHandlerHandle<R>> + Send + Sync + Sized,
F: FnOnce(CustomRelocationHandlerHandle<R>, CoreRelocationHandler) -> R,
fn register_function_recognizer<R>(&self, recognizer: R)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more