diff options
| author | Rubens Brandao <git@rubens.io> | 2023-11-18 15:58:33 -0300 |
|---|---|---|
| committer | Kyle Martin <krm504@nyu.edu> | 2023-11-21 15:18:50 -0500 |
| commit | 8c9cdd38c3302280087c9e6d94f7f57083885edd (patch) | |
| tree | 8bccf380b4470e0de8ac11c23b164e0acf6ffbb0 /rust/src/mlil/lift.rs | |
| parent | b040fcfce48db861600eeb122cd0e2ff802fac96 (diff) | |
add mlil to rust
Diffstat (limited to 'rust/src/mlil/lift.rs')
| -rw-r--r-- | rust/src/mlil/lift.rs | 139 |
1 files changed, 139 insertions, 0 deletions
diff --git a/rust/src/mlil/lift.rs b/rust/src/mlil/lift.rs new file mode 100644 index 00000000..68a7884e --- /dev/null +++ b/rust/src/mlil/lift.rs @@ -0,0 +1,139 @@ +use super::operation::*; + +#[derive(Clone, Debug, PartialEq)] +pub struct MediumLevelILLiftedInstruction { + pub address: u64, + pub operation: MediumLevelILLiftedOperation, +} + +#[derive(Clone, Debug, PartialEq)] +pub enum MediumLevelILLiftedOperation { + Nop(NoArgs), + Noret(NoArgs), + Bp(NoArgs), + Undef(NoArgs), + Unimpl(NoArgs), + If(LiftedIf), + FloatConst(FloatConst), + Const(Constant), + ConstPtr(Constant), + Import(Constant), + ExternPtr(ExternPtr), + ConstData(ConstantData), + Jump(LiftedJump), + RetHint(LiftedJump), + StoreSsa(LiftedStoreSsa), + StoreStructSsa(LiftedStoreStructSsa), + StoreStruct(LiftedStoreStruct), + Store(LiftedStore), + JumpTo(LiftedJumpTo), + Goto(Goto), + FreeVarSlot(FreeVarSlot), + SetVarField(LiftedSetVarField), + SetVar(LiftedSetVar), + FreeVarSlotSsa(FreeVarSlotSsa), + SetVarSsaField(LiftedSetVarSsaField), + SetVarAliasedField(LiftedSetVarSsaField), + SetVarAliased(LiftedSetVarAliased), + SetVarSsa(LiftedSetVarSsa), + VarPhi(LiftedVarPhi), + MemPhi(LiftedMemPhi), + VarSplit(VarSplit), + SetVarSplit(LiftedSetVarSplit), + VarSplitSsa(VarSplitSsa), + SetVarSplitSsa(LiftedSetVarSplitSsa), + Add(LiftedBinaryOp), + Sub(LiftedBinaryOp), + And(LiftedBinaryOp), + Or(LiftedBinaryOp), + Xor(LiftedBinaryOp), + Lsl(LiftedBinaryOp), + Lsr(LiftedBinaryOp), + Asr(LiftedBinaryOp), + Rol(LiftedBinaryOp), + Ror(LiftedBinaryOp), + Mul(LiftedBinaryOp), + MuluDp(LiftedBinaryOp), + MulsDp(LiftedBinaryOp), + Divu(LiftedBinaryOp), + DivuDp(LiftedBinaryOp), + Divs(LiftedBinaryOp), + DivsDp(LiftedBinaryOp), + Modu(LiftedBinaryOp), + ModuDp(LiftedBinaryOp), + Mods(LiftedBinaryOp), + ModsDp(LiftedBinaryOp), + CmpE(LiftedBinaryOp), + CmpNe(LiftedBinaryOp), + CmpSlt(LiftedBinaryOp), + CmpUlt(LiftedBinaryOp), + CmpSle(LiftedBinaryOp), + CmpUle(LiftedBinaryOp), + CmpSge(LiftedBinaryOp), + CmpUge(LiftedBinaryOp), + CmpSgt(LiftedBinaryOp), + CmpUgt(LiftedBinaryOp), + TestBit(LiftedBinaryOp), + AddOverflow(LiftedBinaryOp), + FcmpE(LiftedBinaryOp), + FcmpNe(LiftedBinaryOp), + FcmpLt(LiftedBinaryOp), + FcmpLe(LiftedBinaryOp), + FcmpGe(LiftedBinaryOp), + FcmpGt(LiftedBinaryOp), + FcmpO(LiftedBinaryOp), + FcmpUo(LiftedBinaryOp), + Fadd(LiftedBinaryOp), + Fsub(LiftedBinaryOp), + Fmul(LiftedBinaryOp), + Fdiv(LiftedBinaryOp), + Adc(LiftedBinaryOpCarry), + Sbb(LiftedBinaryOpCarry), + Rlc(LiftedBinaryOpCarry), + Rrc(LiftedBinaryOpCarry), + Call(LiftedCall), + Tailcall(LiftedCall), + Intrinsic(LiftedInnerCall), + Syscall(LiftedInnerCall), + IntrinsicSsa(LiftedIntrinsicSsa), + CallSsa(LiftedCallSsa), + TailcallSsa(LiftedCallSsa), + CallUntypedSsa(LiftedCallUntypedSsa), + TailcallUntypedSsa(LiftedCallUntypedSsa), + SyscallSsa(LiftedSyscallSsa), + SyscallUntypedSsa(LiftedSyscallUntypedSsa), + CallUntyped(LiftedCallUntyped), + TailcallUntyped(LiftedCallUntyped), + SyscallUntyped(LiftedSyscallUntyped), + Neg(LiftedUnaryOp), + Not(LiftedUnaryOp), + Sx(LiftedUnaryOp), + Zx(LiftedUnaryOp), + LowPart(LiftedUnaryOp), + BoolToInt(LiftedUnaryOp), + UnimplMem(LiftedUnaryOp), + Fsqrt(LiftedUnaryOp), + Fneg(LiftedUnaryOp), + Fabs(LiftedUnaryOp), + FloatToInt(LiftedUnaryOp), + IntToFloat(LiftedUnaryOp), + FloatConv(LiftedUnaryOp), + RoundToInt(LiftedUnaryOp), + Floor(LiftedUnaryOp), + Ceil(LiftedUnaryOp), + Ftrunc(LiftedUnaryOp), + Load(LiftedUnaryOp), + LoadStruct(LiftedLoadStruct), + LoadStructSsa(LiftedLoadStructSsa), + LoadSsa(LiftedLoadSsa), + Ret(LiftedRet), + Var(Var), + AddressOf(Var), + VarField(Field), + AddressOfField(Field), + VarSsa(VarSsa), + VarAliased(VarSsa), + VarSsaField(VarSsaField), + VarAliasedField(VarSsaField), + Trap(Trap), +} |
