binaryninja::workflow

Struct AnalysisContext

source
pub struct AnalysisContext { /* private fields */ }
Expand description

The AnalysisContext struct is used to represent the current state of analysis for a given function. It allows direct modification of IL and other analysis information.

Implementations§

source§

impl AnalysisContext

source

pub fn view(&self) -> Ref<BinaryView>

BinaryView for the current AnalysisContext

source

pub fn function(&self) -> Ref<Function>

Function for the current AnalysisContext

source

pub unsafe fn lifted_il_function( &self, ) -> Option<Ref<LowLevelILMutableFunction>>

LowLevelILMutableFunction used to represent Lifted Level IL

source

pub fn set_lifted_il_function(&self, value: &LowLevelILRegularFunction)

source

pub unsafe fn llil_function(&self) -> Option<Ref<LowLevelILMutableFunction>>

LowLevelILMutableFunction used to represent Low Level IL

source

pub fn set_llil_function(&self, value: &LowLevelILRegularFunction)

source

pub fn mlil_function(&self) -> Option<Ref<MediumLevelILFunction>>

MediumLevelILFunction used to represent Medium Level IL

source

pub fn set_mlil_function(&self, value: &MediumLevelILFunction)

source

pub fn hlil_function(&self, full_ast: bool) -> Option<Ref<HighLevelILFunction>>

HighLevelILFunction used to represent High Level IL

source

pub fn inform(&self, request: &str) -> bool

source

pub fn set_basic_blocks<I>(&self, blocks: I)

source

pub fn get_setting_bool(&self, key: &str) -> bool

Get a boolean setting from the cached settings

source

pub fn get_setting_double(&self, key: &str) -> f64

Get a double setting from the cached settings

source

pub fn get_setting_int64(&self, key: &str) -> i64

Get a signed 64-bit integer setting from the cached settings

source

pub fn get_setting_uint64(&self, key: &str) -> u64

Get an unsigned 64-bit integer setting from the cached settings

source

pub fn get_setting_string(&self, key: &str) -> BnString

Get a string setting from the cached settings

source

pub fn get_setting_string_list(&self, key: &str) -> Array<BnString>

Get a string list setting from the cached settings

source

pub fn is_offset_valid(&self, offset: u64) -> bool

Check if an offset is mapped in the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryView::offset_valid.

source

pub fn is_offset_readable(&self, offset: u64) -> bool

Check if an offset is readable in the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryView::offset_readable.

source

pub fn is_offset_writable(&self, offset: u64) -> bool

Check if an offset is writable in the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryView::offset_writable.

source

pub fn is_offset_executable(&self, offset: u64) -> bool

Check if an offset is executable in the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryView::offset_executable.

source

pub fn is_offset_backed_by_file(&self, offset: u64) -> bool

Check if an offset is backed by file in the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryView::offset_backed_by_file.

source

pub fn is_offset_code_semantics(&self, offset: u64) -> bool

Check if an offset has code semantics in the cached section map.

NOTE: This is a lock-free alternative to BinaryViewExt::offset_has_code_semantics.

source

pub fn is_offset_extern_semantics(&self, offset: u64) -> bool

Check if an offset has external semantics in the cached section map.

NOTE: This is a lock-free alternative to BinaryViewExt::offset_has_extern_semantics.

source

pub fn is_offset_writable_semantics(&self, offset: u64) -> bool

Check if an offset has writable semantics in the cached section map.

NOTE: This is a lock-free alternative to BinaryViewExt::offset_has_writable_semantics.

source

pub fn is_offset_readonly_semantics(&self, offset: u64) -> bool

Check if an offset has read-only semantics in the cached section map.

NOTE: This is a lock-free alternative to BinaryViewExt::offset_has_read_only_semantics.

source

pub fn sections(&self) -> Array<Section>

Get all sections from the cached section map.

NOTE: This is a lock-free alternative to BinaryViewExt::sections.

source

pub fn section_by_name(&self, name: impl IntoCStr) -> Option<Ref<Section>>

Get a section by name from the cached section map.

NOTE: This is a lock-free alternative to BinaryViewExt::section_by_name.

source

pub fn sections_at(&self, addr: u64) -> Array<Section>

Get all sections containing the given address from the cached section map.

NOTE: This is a lock-free alternative to BinaryViewExt::sections_at.

source

pub fn start(&self) -> u64

Get the start address (the lowest address) from the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryView::start.

source

pub fn end(&self) -> u64

Get the end address (the highest address) from the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryViewExt::end.

source

pub fn length(&self) -> u64

Get the length of the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryViewBase::len.

source

pub fn next_valid_offset(&self, offset: u64) -> u64

Get the next valid offset after the given offset from the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryView::next_valid_offset_after.

source

pub fn next_mapped_address(&self, addr: u64, flags: &SegmentFlags) -> u64

Get the next mapped address after the given address from the cached MemoryMap.

source

pub fn next_backed_address(&self, addr: u64, flags: &SegmentFlags) -> u64

Get the next backed address after the given address from the cached MemoryMap.

source

pub fn segment_at(&self, addr: u64) -> Option<Ref<Segment>>

Get the segment containing the given address from the cached MemoryMap.

NOTE: This is a lock-free alternative to BinaryViewExt::segment_at.

source

pub fn mapped_address_ranges(&self) -> Array<AddressRange>

Get all mapped address ranges from the cached MemoryMap.

source

pub fn backed_address_ranges(&self) -> Array<AddressRange>

Get all backed address ranges from the cached MemoryMap.

Trait Implementations§

source§

impl ToOwned for AnalysisContext

source§

type Owned = Ref<AnalysisContext>

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

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

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> 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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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