diff options
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/llil/lifting.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rust/src/llil/lifting.rs b/rust/src/llil/lifting.rs index e6226070..f8b8257e 100644 --- a/rust/src/llil/lifting.rs +++ b/rust/src/llil/lifting.rs @@ -607,6 +607,26 @@ where A: 'a + Architecture, R: ExpressionResultType, { + pub fn from_expr(expr: Expression<'a, A, Mutable, NonSSA<LiftedNonSSA>, R>) -> Self { + use binaryninjacore_sys::BNGetLowLevelILByIndex; + + let instr = unsafe { + BNGetLowLevelILByIndex(expr.function.handle, expr.expr_idx) + }; + + ExpressionBuilder { + function: expr.function, + op: instr.operation, + size: instr.size, + flags: instr.flags, + op1: instr.operands[0], + op2: instr.operands[1], + op3: instr.operands[2], + op4: instr.operands[3], + _ty: PhantomData + } + } + pub fn with_flag_write(mut self, flag_write: A::FlagWrite) -> Self { // TODO verify valid id self.flags = flag_write.id(); |
