TransformSession

Struct TransformSession 

Source
pub struct TransformSession { /* private fields */ }
Expand description

A TransformSession manages the lifetime of a set of TransformContexts, performing transformations on said contexts, and extracting the results.

Sessions automatically apply appropriate transforms to navigate through nested containers, maintaining a tree of TransformContext objects representing each extraction stage.

NOTE: All sessions have a TransformSessionMode that configures the session for one of the below:

Implementations§

Source§

impl TransformSession

Source

pub fn new(file_path: &Path, settings: &Settings) -> Ref<TransformSession>

Creates the new transform session for the given file_path on disk.

NOTE: The TransformSessionMode will be set to the default specified by the files.container.mode setting in the Binary Ninja global settings (not the settings passed into this function). To specify the mode, use TransformSession::new_with_mode instead.

Source

pub fn new_with_mode( file_path: &Path, settings: &Settings, mode: TransformSessionMode, ) -> Ref<TransformSession>

Creates the new transform session for the given file_path on disk, with the specified mode.

Source

pub fn from_view( view: &BinaryView, settings: &Settings, ) -> Ref<TransformSession>

Creates the new transform session for the given view.

Source

pub fn from_view_with_mode( view: &BinaryView, settings: &Settings, mode: TransformSessionMode, ) -> Ref<TransformSession>

Creates the new transform session for the given view.

Source

pub fn from_context( context: &TransformContext, settings: &Settings, mode: TransformSessionMode, ) -> Ref<TransformSession>

Creates the new transform session for the given context.

Source

pub fn root_context(&self) -> Option<Ref<TransformContext>>

Source

pub fn current_context(&self) -> Option<Ref<TransformContext>>

Source

pub fn process(&self) -> ProcessResult

Process starting at the TransformSession::root_context.

See TransformSession for more information on how the different TransformSessionModes affect processing.

Source

pub fn process_from(&self, context: &TransformContext) -> ProcessResult

Process starting at the given context.

See TransformSession for more information on how the different TransformSessionModes affect processing.

Source

pub fn has_any_stages(&self) -> bool

Is there anything in the session to process?

Checks the root context to see if it has any possible transforms, if it does not, then that means the session will have nothing to process.

Source

pub fn has_single_path(&self) -> bool

If the tree has a single linear path, meaning that there is only one possible sequence of contexts to process.

Source

pub fn selected_contexts(&self) -> Array<TransformContext>

Selected contexts are the contexts that will be loaded for analysis.

Use TransformSession::set_selected_contexts to specify the contexts which to keep for further analysis.

Source

pub fn set_selected_contexts(&self, contexts: &[Ref<TransformContext>])

Specifies the contexts which will be loaded for analysis, anything not in this list will be considered temporary and will be discarded.

Trait Implementations§

Source§

impl ToOwned for TransformSession

Source§

type Owned = Ref<TransformSession>

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.

§

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