pub trait Architecture: 'static + Sized + AsRef<CoreArchitecture> {
    type Handle: Borrow<Self> + Clone;
    type RegisterInfo: RegisterInfo<RegType = Self::Register>;
    type Register: Register<InfoType = Self::RegisterInfo>;
    type RegisterStackInfo: RegisterStackInfo<RegType = Self::Register, RegInfoType = Self::RegisterInfo, RegStackType = Self::RegisterStack>;
    type RegisterStack: RegisterStack<InfoType = Self::RegisterStackInfo, RegType = Self::Register, RegInfoType = Self::RegisterInfo>;
    type Flag: Flag<FlagClass = Self::FlagClass>;
    type FlagWrite: FlagWrite<FlagType = Self::Flag, FlagClass = Self::FlagClass>;
    type FlagClass: FlagClass;
    type FlagGroup: FlagGroup<FlagType = Self::Flag, FlagClass = Self::FlagClass>;
    type Intrinsic: Intrinsic;

Show 46 methods // Required methods fn endianness(&self) -> Endianness; fn address_size(&self) -> usize; fn default_integer_size(&self) -> usize; fn instruction_alignment(&self) -> usize; fn max_instr_len(&self) -> usize; fn opcode_display_len(&self) -> usize; fn associated_arch_by_addr(&self, addr: &mut u64) -> CoreArchitecture; fn instruction_info( &self, data: &[u8], addr: u64 ) -> Option<InstructionInfo>; fn instruction_text( &self, data: &[u8], addr: u64 ) -> Option<(usize, Vec<InstructionTextToken>)>; fn instruction_llil( &self, data: &[u8], addr: u64, il: &mut Lifter<Self> ) -> Option<(usize, bool)>; fn registers_all(&self) -> Vec<Self::Register>; fn registers_full_width(&self) -> Vec<Self::Register>; fn stack_pointer_reg(&self) -> Option<Self::Register>; fn register_from_id(&self, id: u32) -> Option<Self::Register>; fn handle(&self) -> Self::Handle; // Provided methods fn flag_write_llil<'a>( &self, flag: Self::Flag, flag_write_type: Self::FlagWrite, op: FlagWriteOp<Self::Register>, il: &'a mut Lifter<Self> ) -> Option<LiftedExpr<'a, Self>> { ... } fn flags_required_for_flag_condition( &self, _condition: FlagCondition, _class: Option<Self::FlagClass> ) -> Vec<Self::Flag> { ... } fn flag_cond_llil<'a>( &self, cond: FlagCondition, class: Option<Self::FlagClass>, il: &'a mut Lifter<Self> ) -> Option<LiftedExpr<'a, Self>> { ... } fn flag_group_llil<'a>( &self, _group: Self::FlagGroup, _il: &'a mut Lifter<Self> ) -> Option<LiftedExpr<'a, Self>> { ... } fn registers_global(&self) -> Vec<Self::Register> { ... } fn registers_system(&self) -> Vec<Self::Register> { ... } fn register_stacks(&self) -> Vec<Self::RegisterStack> { ... } fn flags(&self) -> Vec<Self::Flag> { ... } fn flag_write_types(&self) -> Vec<Self::FlagWrite> { ... } fn flag_classes(&self) -> Vec<Self::FlagClass> { ... } fn flag_groups(&self) -> Vec<Self::FlagGroup> { ... } fn link_reg(&self) -> Option<Self::Register> { ... } fn register_stack_from_id(&self, _id: u32) -> Option<Self::RegisterStack> { ... } fn flag_from_id(&self, _id: u32) -> Option<Self::Flag> { ... } fn flag_write_from_id(&self, _id: u32) -> Option<Self::FlagWrite> { ... } fn flag_class_from_id(&self, _id: u32) -> Option<Self::FlagClass> { ... } fn flag_group_from_id(&self, _id: u32) -> Option<Self::FlagGroup> { ... } fn intrinsics(&self) -> Vec<Self::Intrinsic> { ... } fn intrinsic_class(&self, _id: u32) -> BNIntrinsicClass { ... } fn intrinsic_from_id(&self, _id: u32) -> Option<Self::Intrinsic> { ... } fn can_assemble(&self) -> bool { ... } fn assemble(&self, _code: &str, _addr: u64) -> Result<Vec<u8>, String> { ... } fn is_never_branch_patch_available(&self, _data: &[u8], _addr: u64) -> bool { ... } fn is_always_branch_patch_available(&self, _data: &[u8], _addr: u64) -> bool { ... } fn is_invert_branch_patch_available(&self, _data: &[u8], _addr: u64) -> bool { ... } fn is_skip_and_return_zero_patch_available( &self, _data: &[u8], _addr: u64 ) -> bool { ... } fn is_skip_and_return_value_patch_available( &self, _data: &[u8], _addr: u64 ) -> bool { ... } fn convert_to_nop(&self, _data: &mut [u8], _addr: u64) -> bool { ... } fn always_branch(&self, _data: &mut [u8], _addr: u64) -> bool { ... } fn invert_branch(&self, _data: &mut [u8], _addr: u64) -> bool { ... } fn skip_and_return_value( &self, _data: &mut [u8], _addr: u64, _value: u64 ) -> bool { ... }
}

Required Associated Types§

source

type Handle: Borrow<Self> + Clone

source

type RegisterInfo: RegisterInfo<RegType = Self::Register>

source

type Register: Register<InfoType = Self::RegisterInfo>

source

type RegisterStackInfo: RegisterStackInfo<RegType = Self::Register, RegInfoType = Self::RegisterInfo, RegStackType = Self::RegisterStack>

source

type RegisterStack: RegisterStack<InfoType = Self::RegisterStackInfo, RegType = Self::Register, RegInfoType = Self::RegisterInfo>

source

type Flag: Flag<FlagClass = Self::FlagClass>

source

type FlagWrite: FlagWrite<FlagType = Self::Flag, FlagClass = Self::FlagClass>

source

type FlagClass: FlagClass

source

type FlagGroup: FlagGroup<FlagType = Self::Flag, FlagClass = Self::FlagClass>

source

type Intrinsic: Intrinsic

Required Methods§

source

fn endianness(&self) -> Endianness

source

fn address_size(&self) -> usize

source

fn default_integer_size(&self) -> usize

source

fn instruction_alignment(&self) -> usize

source

fn max_instr_len(&self) -> usize

source

fn opcode_display_len(&self) -> usize

source

fn associated_arch_by_addr(&self, addr: &mut u64) -> CoreArchitecture

source

fn instruction_info(&self, data: &[u8], addr: u64) -> Option<InstructionInfo>

source

fn instruction_text( &self, data: &[u8], addr: u64 ) -> Option<(usize, Vec<InstructionTextToken>)>

source

fn instruction_llil( &self, data: &[u8], addr: u64, il: &mut Lifter<Self> ) -> Option<(usize, bool)>

source

fn registers_all(&self) -> Vec<Self::Register>

source

fn registers_full_width(&self) -> Vec<Self::Register>

source

fn stack_pointer_reg(&self) -> Option<Self::Register>

source

fn register_from_id(&self, id: u32) -> Option<Self::Register>

source

fn handle(&self) -> Self::Handle

Provided Methods§

source

fn flag_write_llil<'a>( &self, flag: Self::Flag, flag_write_type: Self::FlagWrite, op: FlagWriteOp<Self::Register>, il: &'a mut Lifter<Self> ) -> Option<LiftedExpr<'a, Self>>

Fallback flag value calculation path. This method is invoked when the core is unable to recover flag use semantics, and resorts to emitting instructions that explicitly set each observed flag to the value of an expression returned by this function.

This function MUST NOT append instructions that have side effects.

This function MUST NOT observe the values of other flags.

This function MUST return None or an expression representing a boolean value.

source

fn flags_required_for_flag_condition( &self, _condition: FlagCondition, _class: Option<Self::FlagClass> ) -> Vec<Self::Flag>

Determines what flags need to be examined in order to attempt automatic recovery of the semantics of this flag use.

If automatic recovery is not possible, the flag_cond_llil method will be invoked to give this Architecture implementation arbitrary control over the expression to be evaluated.

source

fn flag_cond_llil<'a>( &self, cond: FlagCondition, class: Option<Self::FlagClass>, il: &'a mut Lifter<Self> ) -> Option<LiftedExpr<'a, Self>>

This function MUST NOT append instructions that have side effects.

This function MUST NOT observe the values of flags not returned by flags_required_for_flag_condition.

This function MUST return None or an expression representing a boolean value.

source

fn flag_group_llil<'a>( &self, _group: Self::FlagGroup, _il: &'a mut Lifter<Self> ) -> Option<LiftedExpr<'a, Self>>

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.

In this fallback path, the Architecture must generate the boolean expression in terms of the values of that flags returned by group’s flags_required method.

This function must return an expression representing a boolean (as in, size of 0) value. It is not allowed to add any instructions that can cause side effects.

This function must not observe the values of any flag not returned by group’s flags_required method.

source

fn registers_global(&self) -> Vec<Self::Register>

source

fn registers_system(&self) -> Vec<Self::Register>

source

fn register_stacks(&self) -> Vec<Self::RegisterStack>

source

fn flags(&self) -> Vec<Self::Flag>

source

fn flag_write_types(&self) -> Vec<Self::FlagWrite>

source

fn flag_classes(&self) -> Vec<Self::FlagClass>

source

fn flag_groups(&self) -> Vec<Self::FlagGroup>

source

fn register_stack_from_id(&self, _id: u32) -> Option<Self::RegisterStack>

source

fn flag_from_id(&self, _id: u32) -> Option<Self::Flag>

source

fn flag_write_from_id(&self, _id: u32) -> Option<Self::FlagWrite>

source

fn flag_class_from_id(&self, _id: u32) -> Option<Self::FlagClass>

source

fn flag_group_from_id(&self, _id: u32) -> Option<Self::FlagGroup>

source

fn intrinsics(&self) -> Vec<Self::Intrinsic>

source

fn intrinsic_class(&self, _id: u32) -> BNIntrinsicClass

source

fn intrinsic_from_id(&self, _id: u32) -> Option<Self::Intrinsic>

source

fn can_assemble(&self) -> bool

source

fn assemble(&self, _code: &str, _addr: u64) -> Result<Vec<u8>, String>

source

fn is_never_branch_patch_available(&self, _data: &[u8], _addr: u64) -> bool

source

fn is_always_branch_patch_available(&self, _data: &[u8], _addr: u64) -> bool

source

fn is_invert_branch_patch_available(&self, _data: &[u8], _addr: u64) -> bool

source

fn is_skip_and_return_zero_patch_available( &self, _data: &[u8], _addr: u64 ) -> bool

source

fn is_skip_and_return_value_patch_available( &self, _data: &[u8], _addr: u64 ) -> bool

source

fn convert_to_nop(&self, _data: &mut [u8], _addr: u64) -> bool

source

fn always_branch(&self, _data: &mut [u8], _addr: u64) -> bool

source

fn invert_branch(&self, _data: &mut [u8], _addr: u64) -> bool

source

fn skip_and_return_value( &self, _data: &mut [u8], _addr: u64, _value: u64 ) -> bool

Object Safety§

This trait is not object safe.

Implementors§