Пример #1
0
        public void NoPointer()
        {
            var value = new AbstractValue(2).AddTaint();

            Assert.IsNull(value.PointsTo);
            StringAssert.Contains("0x00000002", value.ToString());
            StringAssert.Contains("t", value.ToString());
        }
Пример #2
0
 public void Pointer()
 {
     buffer  = new AbstractBuffer(new[] { new AbstractValue(2) });
     pointer = new AbstractValue(buffer);
     Assert.AreEqual(2, pointer.PointsTo[0].Value);
     StringAssert.StartsWith("*0x00000002", pointer.ToString());
 }
Пример #3
0
 public void AssignmentAtByteZero()
 {
     var values = AbstractValue.GetNewBuffer(16);
     pointer = new AbstractValue(values);
     pointer.PointsTo[0] = new AbstractValue(0x31337);
     Assert.AreEqual(0x31337, pointer.PointsTo[0].Value);
     Assert.AreEqual("*0x00031337", pointer.ToString());
 }
Пример #4
0
        public void NotInitialized()
        {
            var uninitializedValue = new AbstractValue();

            Assert.IsFalse(uninitializedValue.IsInitialized);
            Assert.AreEqual(AbstractValue.UNKNOWN, uninitializedValue.Value);
            Assert.AreEqual("?", uninitializedValue.ToString());
        }
Пример #5
0
        public void AssignmentAtByteZero()
        {
            var values = AbstractValue.GetNewBuffer(16);

            pointer             = new AbstractValue(values);
            pointer.PointsTo[0] = new AbstractValue(0x31337);
            Assert.AreEqual(0x31337, pointer.PointsTo[0].Value);
            Assert.AreEqual("*0x00031337", pointer.ToString());
        }
Пример #6
0
        public void PointerPointerPointer()
        {
            buffer = new AbstractBuffer(new[] {new AbstractValue(2)});
            pointer = new AbstractValue(buffer);
            var pointerPointer = new AbstractValue(new[] {pointer});
            var pointerPointerPointer = new AbstractValue(new[] {pointerPointer});
            Assert.AreEqual(2, pointerPointerPointer.PointsTo[0].PointsTo[0].PointsTo[0].Value);

            StringAssert.StartsWith("***0x00000002", pointerPointerPointer.ToString());
        }
Пример #7
0
 public void NotInitialized()
 {
     var uninitializedValue = new AbstractValue();
     Assert.IsFalse(uninitializedValue.IsInitialized);
     Assert.AreEqual(AbstractValue.UNKNOWN, uninitializedValue.Value);
     Assert.AreEqual("?", uninitializedValue.ToString());
 }
Пример #8
0
        public void NoPointer()
        {
            var value = new AbstractValue(2).AddTaint();

            Assert.IsNull(value.PointsTo);
            StringAssert.Contains("0x00000002", value.ToString());
            StringAssert.Contains("t", value.ToString());
        }