Trait yaxpeax_core::analyses::evaluators::const_evaluator::ConstEvaluator [−][src]
pub trait ConstEvaluator<A: Arch + SSAValues, Ctxs, D: Domain> {
fn evaluate_instruction<U: MemoryRange<A>>(
instr: &A::Instruction,
addr: A::Address,
dfg: &SSA<A>,
contexts: &Ctxs,
data: &U
);
fn apply_transient(
from: A::Address,
to: A::Address,
location: Option<A::Location>,
exprs: &Vec<D::Modifier>,
dfg: &SSA<A>,
contexts: &Ctxs
);
}
Required methods
fn evaluate_instruction<U: MemoryRange<A>>(
instr: &A::Instruction,
addr: A::Address,
dfg: &SSA<A>,
contexts: &Ctxs,
data: &U
)
Implementations on Foreign Types
fn apply_transient(
from: <x86_64 as Arch>::Address,
to: <x86_64 as Arch>::Address,
location: Option<<x86_64 as ValueLocations>::Location>,
exprs: &Vec<ModifierExpression>,
dfg: &SSA<x86_64>,
_contexts: &()
)
fn evaluate_instruction<U: MemoryRange<x86_64>>(
instr: &<x86_64 as Arch>::Instruction,
addr: <x86_64 as Arch>::Address,
dfg: &SSA<x86_64>,
_contexts: &(),
_data: &U
)
fn apply_transient(
_from: <x86_64 as Arch>::Address,
_to: <x86_64 as Arch>::Address,
_location: Option<<x86_64 as ValueLocations>::Location>,
_exprs: &Vec<<SymbolicDomain as Domain>::Modifier>,
_dfg: &SSA<x86_64>,
_contexts: &()
)
fn evaluate_instruction<U: MemoryRange<x86_64>>(
instr: &<x86_64 as Arch>::Instruction,
addr: <x86_64 as Arch>::Address,
dfg: &SSA<x86_64>,
contexts: &(),
_data: &U
)
In a situation like v_1 <- Data::Concrete(10) v_2 = transient ModifierExpression::Above(20) . v_1
TODO: v_2 should be computed to be impossible, and taint the entire branch.
in reality, the best we can do is bail and set v_2 unknown for now.
In a situation where ModifierExpression does not conflict with an existing Data entry, take the more specific of the two. eg v_1 <- Data::Concrete(10) v_2 = transient ModifierExpression::Below(20) . v_1 -> v_2 == Data::Concrete(10)
v_1 <- ValueSet(vec![ValueRange::Between(0, 1000)]) v_2 = transient ModifierExpression::Below(20) . transient ModifierExpression::Above(5) . v_1 -> v_2 == Data::ValueSet(vec![ValueRange::Between(5, 20)])