Struct Dataflows
pub struct Dataflows<A: Arch, C> {
pub addresses: MemoryAccesses<A>,
pub outputs: Vec<Dataflow<A, C>>,
pub found_dependent_bytes: bool,
}
Expand description
A collection of dataflows and memory accesses.
Fields§
§addresses: MemoryAccesses<A>
The memory accesses of these dataflows.
outputs: Vec<Dataflow<A, C>>
The outputs of the dataflows.
found_dependent_bytes: bool
Whether any dependent bytes were found during Dataflow Analysis.
Implementations§
§impl<A: Arch, C> Dataflows<A, C>
impl<A: Arch, C> Dataflows<A, C>
pub fn instr(&self) -> &Instruction
pub fn instr(&self) -> &Instruction
Returns the instruction for which these dataflow apply.
pub fn output_dataflows(&self) -> impl Iterator<Item = &Dataflow<A, C>>
pub fn output_dataflows(&self) -> impl Iterator<Item = &Dataflow<A, C>>
Iterates over all dataflows.
pub fn output_dataflow(&self, index: usize) -> &Dataflow<A, C>
pub fn output_dataflow(&self, index: usize) -> &Dataflow<A, C>
Returns the dataflow at position index
.
pub fn values(
&self,
) -> impl Iterator<Item = (FlowValueLocation, Source<A>)> + '_
pub fn values( &self, ) -> impl Iterator<Item = (FlowValueLocation, Source<A>)> + '_
Returns all sources in these dataflows.
pub fn get(&self, loc: &Dest<A>) -> Option<&Dataflow<A, C>>
pub fn get(&self, loc: &Dest<A>) -> Option<&Dataflow<A, C>>
Returns the dataflow with target
set to loc
.
pub fn extract_memory_areas<'a>(
&'a self,
state: &'a SystemState<A>,
) -> impl Iterator<Item = Area> + 'a
pub fn extract_memory_areas<'a>( &'a self, state: &'a SystemState<A>, ) -> impl Iterator<Item = Area> + 'a
Returns the memory areas read or written by these dataflows.
pub fn execute(&self, state: &mut SystemState<A>)where
C: Computation,
pub fn execute(&self, state: &mut SystemState<A>)where
C: Computation,
Executes the dataflows on state
, modifying the state
.
pub fn map_computations<CNew>(
&self,
f: impl Fn(&Inputs<A>, &C) -> Option<CNew>,
) -> Dataflows<A, CNew>
pub fn map_computations<CNew>( &self, f: impl Fn(&Inputs<A>, &C) -> Option<CNew>, ) -> Dataflows<A, CNew>
Maps all computations in the dataflows to new values.
pub fn split_flag_output(&mut self, index: usize) -> usize
pub fn split_flag_output(&mut self, index: usize) -> usize
Splits flag outputs in the dataflow with position index
into individual bytes.
pub fn map(
&self,
instr: Instruction,
map_flows: impl Fn(FlowValueLocation, &Source<A>) -> Option<Source<A>>,
map_address_computations: impl Fn(usize, &AddressComputation) -> Option<AddressComputation>,
) -> Dataflows<A, C>where
C: Clone,
pub fn map(
&self,
instr: Instruction,
map_flows: impl Fn(FlowValueLocation, &Source<A>) -> Option<Source<A>>,
map_address_computations: impl Fn(usize, &AddressComputation) -> Option<AddressComputation>,
) -> Dataflows<A, C>where
C: Clone,
Maps each source and destination in the dataflows and memory accesses to new values.
pub fn insert_imm_value(
&mut self,
output_indices: impl Iterator<Item = usize>,
part_index: usize,
) -> Vec<FlowInputLocation>
pub fn insert_imm_value( &mut self, output_indices: impl Iterator<Item = usize>, part_index: usize, ) -> Vec<FlowInputLocation>
Adds an immediate value to all outputs in output_indices
.
Returns a list containing the locations of the inserted Source::Imm
s.
pub fn insert_memory_imms(
&mut self,
locations: &[FlowOutputLocation],
offset: i64,
part_index: usize,
) -> Vec<FlowInputLocation>where
C: Debug,
pub fn insert_memory_imms(
&mut self,
locations: &[FlowOutputLocation],
offset: i64,
part_index: usize,
) -> Vec<FlowInputLocation>where
C: Debug,
Adds an immediate value to all memory accesses and outputs in locations
.
Returns a list containing the locations of the inserted Source::Imm
s.
pub fn overlapping_outputs<'a>(
&'a self,
output_dataflows: &'a [&'a Dataflow<A, C>],
) -> impl Iterator<Item = &'a Dataflow<A, C>>
pub fn overlapping_outputs<'a>( &'a self, output_dataflows: &'a [&'a Dataflow<A, C>], ) -> impl Iterator<Item = &'a Dataflow<A, C>>
Returns a list of dataflows that overlap with the list provided in output_dataflows
.
Trait Implementations§
§impl<'de, A: Arch, C> Deserialize<'de> for Dataflows<A, C>where
C: Deserialize<'de>,
impl<'de, A: Arch, C> Deserialize<'de> for Dataflows<A, C>where
C: Deserialize<'de>,
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
§impl<A: Arch, C: Computation> Display for Dataflows<A, C>
impl<A: Arch, C: Computation> Display for Dataflows<A, C>
§impl<A, C> JsonSchema for Dataflows<A, C>
impl<A, C> JsonSchema for Dataflows<A, C>
§fn schema_name() -> String
fn schema_name() -> String
§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreimpl<A: Eq + Arch, C: Eq> Eq for Dataflows<A, C>
impl<A: Arch, C> StructuralPartialEq for Dataflows<A, C>
Auto Trait Implementations§
impl<A, C> Freeze for Dataflows<A, C>
impl<A, C> RefUnwindSafe for Dataflows<A, C>
impl<A, C> Send for Dataflows<A, C>where
C: Send,
impl<A, C> Sync for Dataflows<A, C>where
C: Sync,
impl<A, C> Unpin for Dataflows<A, C>
impl<A, C> UnwindSafe for Dataflows<A, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more