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:
TransformSessionMode::TransformSessionModeDisabledThe session will immediately end processing and return the root context data as-is.TransformSessionMode::TransformSessionModeInteractiveThe session will process a context then require another round of processing to traverse to the next level of contexts, used to progressively transform the inputs rather than transforming all at once.TransformSessionMode::TransformSessionModeFullThe session will exhaust all processable contexts, or in other words, processing all at once.
Implementations§
Source§impl TransformSession
impl TransformSession
Sourcepub fn new(file_path: &Path, settings: &Settings) -> Ref<TransformSession>
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.
Sourcepub fn new_with_mode(
file_path: &Path,
settings: &Settings,
mode: TransformSessionMode,
) -> Ref<TransformSession>
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.
Sourcepub fn from_view(
view: &BinaryView,
settings: &Settings,
) -> Ref<TransformSession>
pub fn from_view( view: &BinaryView, settings: &Settings, ) -> Ref<TransformSession>
Creates the new transform session for the given view.
Sourcepub fn from_view_with_mode(
view: &BinaryView,
settings: &Settings,
mode: TransformSessionMode,
) -> Ref<TransformSession>
pub fn from_view_with_mode( view: &BinaryView, settings: &Settings, mode: TransformSessionMode, ) -> Ref<TransformSession>
Creates the new transform session for the given view.
Sourcepub fn from_context(
context: &TransformContext,
settings: &Settings,
mode: TransformSessionMode,
) -> Ref<TransformSession>
pub fn from_context( context: &TransformContext, settings: &Settings, mode: TransformSessionMode, ) -> Ref<TransformSession>
Creates the new transform session for the given context.
pub fn root_context(&self) -> Option<Ref<TransformContext>>
pub fn current_context(&self) -> Option<Ref<TransformContext>>
Sourcepub fn process(&self) -> ProcessResult
pub fn process(&self) -> ProcessResult
Process starting at the TransformSession::root_context.
See TransformSession for more information on how the different TransformSessionModes affect processing.
Sourcepub fn process_from(&self, context: &TransformContext) -> ProcessResult
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.
Sourcepub fn has_any_stages(&self) -> bool
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.
Sourcepub fn has_single_path(&self) -> bool
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.
Sourcepub fn selected_contexts(&self) -> Array<TransformContext>
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.
Sourcepub fn set_selected_contexts(&self, contexts: &[Ref<TransformContext>])
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.