CoreArchitecture

Struct CoreArchitecture 

Source
pub struct CoreArchitecture { /* private fields */ }

Implementations§

Source§

impl CoreArchitecture

Source

pub unsafe fn from_raw(handle: *mut BNArchitecture) -> Self

Source

pub fn list_all() -> CoreArchitectureList

Source

pub fn by_name(name: &str) -> Option<Self>

Source

pub fn name(&self) -> String

Trait Implementations§

Source§

impl Architecture for CoreArchitecture

Source§

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

Source§

type Handle = CoreArchitecture

Source§

type RegisterInfo = CoreRegisterInfo

The RegisterInfo associated with this architecture.
Source§

type Register = CoreRegister

The Register associated with this architecture.
Source§

type RegisterStackInfo = CoreRegisterStackInfo

The RegisterStackInfo associated with this architecture. Read more
Source§

type RegisterStack = CoreRegisterStack

The RegisterStack associated with this architecture. Read more
Source§

type Flag = CoreFlag

The Flag associated with this architecture. Read more
Source§

type FlagWrite = CoreFlagWrite

The FlagWrite associated with this architecture. Read more
Source§

type FlagClass = CoreFlagClass

The FlagClass associated with this architecture. Read more
Source§

type FlagGroup = CoreFlagGroup

The FlagGroup associated with this architecture. Read more
Source§

type Intrinsic = CoreIntrinsic

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

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 more
Source§

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

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>

Returns the InstructionInfo at the given virtual address with data. Read more
Source§

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)>

Appends arbitrary low-level il instructions to il. Read more
Source§

fn 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>>

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>

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>>

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>>

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 more
Source§

fn registers_all(&self) -> Vec<CoreRegister>

Source§

fn register_from_id(&self, id: RegisterId) -> Option<CoreRegister>

Source§

fn registers_full_width(&self) -> Vec<CoreRegister>

Source§

fn registers_global(&self) -> Vec<CoreRegister>

Source§

fn registers_system(&self) -> Vec<CoreRegister>

Source§

fn stack_pointer_reg(&self) -> Option<CoreRegister>

Source§

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>

Get the Self::RegisterStack associated with the given RegisterStackId. Read more
Source§

fn flags(&self) -> Vec<CoreFlag>

List of concrete flags for this architecture. Read more
Source§

fn flag_from_id(&self, id: FlagId) -> Option<CoreFlag>

Get the Self::Flag associated with the given FlagId. Read more
Source§

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>

Get the Self::FlagWrite associated with the given FlagWriteId. Read more
Source§

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>

Get the Self::FlagClass associated with the given FlagClassId. Read more
Source§

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>

Get the Self::FlagGroup associated with the given FlagGroupId. Read more
Source§

fn intrinsics(&self) -> Vec<CoreIntrinsic>

List of concrete intrinsics for this architecture. Read more
Source§

fn intrinsic_from_id(&self, id: IntrinsicId) -> Option<CoreIntrinsic>

Get the Self::Intrinsic associated with the given IntrinsicId. Read more
Source§

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>

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

Let the UI display this patch option. Read more
Source§

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

Let the UI display this patch option. Read more
Source§

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

Let the UI display this patch option. Read more
Source§

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

Source§

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

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

Patch the instruction to skip and return value. Read more
Source§

fn handle(&self) -> CoreArchitecture

Source§

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

Source§

impl AsRef<CoreArchitecture> for CoreArchitecture

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for CoreArchitecture

Source§

fn clone(&self) -> CoreArchitecture

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CoreArchitecture

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for CoreArchitecture

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CoreArchitecture

Source§

fn eq(&self, other: &CoreArchitecture) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CoreArchitecture

Source§

impl Eq for CoreArchitecture

Source§

impl Send for CoreArchitecture

Source§

impl StructuralPartialEq for CoreArchitecture

Source§

impl Sync for CoreArchitecture

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchitectureExt for T
where T: Architecture,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more