示例#1
0
        public void VpSequenceOfConstants()
        {
            Constant   pre = Constant.Word16(0x0001);
            Constant   fix = Constant.Word16(0x0002);
            Expression e   = new MkSequence(PrimitiveType.Word32, pre, fix);
            var        vp  = new ExpressionSimplifier(segmentMap, new SsaEvaluationContext(arch.Object, null, dynamicLinker.Object), listener);

            e = e.Accept(vp);
            Assert.AreEqual("0x10002<32>", e.ToString());
        }
示例#2
0
        public void VpSequenceOfConstants()
        {
            Constant   pre = Constant.Word16(0x0001);
            Constant   fix = Constant.Word16(0x0002);
            Expression e   = new MkSequence(PrimitiveType.Word32, pre, fix);
            var        vp  = new ExpressionSimplifier(new SsaEvaluationContext(arch, ssaIds));

            e = e.Accept(vp);
            Assert.AreEqual("0x00010002", e.ToString());
        }
示例#3
0
        public void VpMkSequenceToAddress()
        {
            Constant   seg = Constant.Create(PrimitiveType.SegmentSelector, 0x4711);
            Constant   off = Constant.Word16(0x4111);
            Expression e   = new MkSequence(PrimitiveType.Word32, seg, off);
            var        vp  = new ExpressionSimplifier(new SsaEvaluationContext(ssaIds));

            e = e.Accept(vp);
            Assert.IsInstanceOf(typeof(Address), e);
            Assert.AreEqual("4711:4111", e.ToString());
        }
示例#4
0
        public void VpMkSequenceToAddress()
        {
            Constant seg = Constant.Create(PrimitiveType.SegmentSelector, 0x4711);
            Constant off = Constant.Word16(0x4111);

            arch.Setup(a => a.MakeSegmentedAddress(seg, off)).Returns(Address.SegPtr(0x4711, 0x4111));

            Expression e  = new MkSequence(PrimitiveType.Word32, seg, off);
            var        vp = new ExpressionSimplifier(segmentMap, new SsaEvaluationContext(arch.Object, null, importResolver.Object), listener);

            e = e.Accept(vp);
            Assert.IsInstanceOf(typeof(Address), e);
            Assert.AreEqual("4711:4111", e.ToString());
        }
示例#5
0
        public void VpMkSequenceToAddress()
        {
            Constant seg = Constant.Create(PrimitiveType.SegmentSelector, 0x4711);
            Constant off = Constant.Word16(0x4111);

            arch.Expect(a => a.MakeSegmentedAddress(seg, off)).Return(Address.SegPtr(0x4711, 0x4111));
            mr.ReplayAll();

            Expression e  = new MkSequence(PrimitiveType.Word32, seg, off);
            var        vp = new ExpressionSimplifier(new SsaEvaluationContext(arch, ssaIds));

            e = e.Accept(vp);
            Assert.IsInstanceOf(typeof(Address), e);
            Assert.AreEqual("4711:4111", e.ToString());

            mr.VerifyAll();
        }
示例#6
0
        public void VpMkSequenceToAddress()
        {
            Constant seg = Constant.Create(PrimitiveType.SegmentSelector, 0x4711);
            Constant off = Constant.Word16(0x4111);
            arch.Expect(a => a.MakeSegmentedAddress(seg, off)).Return(Address.SegPtr(0x4711, 0x4111));
            mr.ReplayAll();

            Expression e = new MkSequence(PrimitiveType.Word32, seg, off);
            var vp = new ExpressionSimplifier(new SsaEvaluationContext(arch, ssaIds));
            e = e.Accept(vp);
            Assert.IsInstanceOf(typeof(Address), e);
            Assert.AreEqual("4711:4111", e.ToString());

            mr.VerifyAll();
        }
示例#7
0
		public void VpSequenceOfConstants()
		{
			Constant pre = Constant.Word16(0x0001);
			Constant fix = Constant.Word16(0x0002);
			Expression e = new MkSequence(PrimitiveType.Word32, pre, fix);
            var vp = new ExpressionSimplifier(new SsaEvaluationContext(arch, ssaIds));
			e = e.Accept(vp);
			Assert.AreEqual("0x00010002", e.ToString());
		}
示例#8
0
 public void VpMkSequenceToAddress()
 {
     Constant seg = Constant.Create(PrimitiveType.SegmentSelector, 0x4711);
     Constant off = Constant.Word16(0x4111);
     Expression e = new MkSequence(PrimitiveType.Word32, seg, off);
     var vp = new ExpressionSimplifier(new SsaEvaluationContext(ssaIds));
     e = e.Accept(vp);
     Assert.IsInstanceOf(typeof(Address), e);
     Assert.AreEqual("4711:4111", e.ToString());
 }