public Instruction VisitAssignment(Assignment ass) { var src = ass.Src.Accept(this); ctx.SetValue(ass.Dst, src.Value); return(new Assignment(ass.Dst, src.PropagatedExpression)); }
private void CreateSymbolicEvaluator(Frame frame) { ctx = new SymbolicEvaluationContext(arch, frame); se = new SymbolicEvaluator(ctx); if (esp == null) esp = Tmp32("esp"); ctx.SetValue(esp, frame.FramePointer); }
private void CreateSymbolicEvaluator(Frame frame) { ctx = new SymbolicEvaluationContext(arch, frame); se = new SymbolicEvaluator(ctx); if (esp == null) { esp = Tmp32("esp"); } ctx.SetValue(esp, frame.FramePointer); }
private void CreateSymbolicEvaluator(Frame frame) { ctx = new SymbolicEvaluationContext(arch, frame); se = new SymbolicEvaluator( new ExpressionSimplifier(segmentMap, ctx, listener), ctx); if (esp == null) { esp = Tmp32("esp"); } ctx.SetValue(esp, frame.FramePointer); }
public void Idc_ConstantReferenceInt() { var dword = new TypeReference("DWORD", PrimitiveType.Int32); Identifier edx = new Identifier("edx", dword, Registers.edx); var ctx = new SymbolicEvaluationContext(null, null); ctx.SetValue(edx, Constant.Int32(321)); IdConstant ic = new IdConstant(ctx, new Unifier(null)); Assert.IsTrue(ic.Match(edx)); Expression e = ic.Transform(); Assert.AreEqual("321", e.ToString()); Assert.AreEqual("int32", e.DataType.ToString()); }
public void Idc_ConstantReferencePointerToInt() { var intptr = new TypeReference("INTPTR", new Pointer(PrimitiveType.Int32, 4)); Identifier edx = new Identifier("edx", intptr, Registers.edx); var ctx = new SymbolicEvaluationContext(null, null); ctx.SetValue(edx, Constant.Int32(0x567)); IdConstant ic = new IdConstant(ctx, new Unifier(null), listener); Assert.IsTrue(ic.Match(edx)); Expression e = ic.Transform(); Assert.AreEqual("00000567", e.ToString()); Assert.AreEqual("(ptr int32)", e.DataType.ToString()); }
public void Idc_ConstantReferenceInt() { var dword = new TypeReference("DWORD", PrimitiveType.Int32); Identifier edx = new Identifier("edx", dword, Registers.edx); var ctx = new SymbolicEvaluationContext(null, null); ctx.SetValue(edx, Constant.Int32(321)); IdConstant ic = new IdConstant(ctx, new Unifier(null), listener); Assert.IsTrue(ic.Match(edx)); Expression e = ic.Transform(); Assert.AreEqual("321", e.ToString()); Assert.AreEqual("DWORD", e.DataType.ToString()); }
public override Expression VisitApplication(Application appl) { var e = base.VisitApplication(appl); if (appl.Procedure != null && trf.ProcedureTerminates(appl.Procedure)) { ctx.TrashedFlags = 0; ctx.RegisterState.Clear(); return(appl); } foreach (var u in appl.Arguments.OfType <UnaryExpression>()) { if (u.Operator == UnaryOperator.AddrOf) { Identifier id = u.Expression as Identifier; if (id != null) { ctx.SetValue(id, Constant.Invalid); } } } return(e); }
public void Idc_ConstantReferencePointerToInt() { var intptr = new TypeReference("INTPTR", new Pointer(PrimitiveType.Int32, 4)); Identifier edx = new Identifier("edx", intptr, Registers.edx); var ctx = new SymbolicEvaluationContext(null, null); ctx.SetValue(edx, Constant.Int32(0x567)); IdConstant ic = new IdConstant(ctx, new Unifier(null)); Assert.IsTrue(ic.Match(edx)); Expression e = ic.Transform(); Assert.AreEqual("00000567", e.ToString()); Assert.AreEqual("(ptr int32)", e.DataType.ToString()); }