Esempio n. 1
0
        public void TryReadLeNegativeInt()
        {
            MemoryArea img = new MemoryArea(Address.Ptr32(0x10000), new byte[] {
                0xFE, 0xFF, 0xFF, 0xFF
            });

            Assert.IsTrue(img.TryReadLe(0, PrimitiveType.Int32, out Constant c));
            Assert.AreSame(PrimitiveType.Int32, c.DataType);
            Assert.AreEqual("-2<i32>", c.ToString());
        }
Esempio n. 2
0
        public void TryReadLeUInt32()
        {
            MemoryArea img = new MemoryArea(Address.Ptr32(0x10000), new byte[] {
                0x78, 0x56, 0x34, 0x12
            });

            Assert.IsTrue(img.TryReadLe(0, PrimitiveType.Word32, out Constant c));
            Assert.AreSame(PrimitiveType.Word32, c.DataType);
            Assert.AreEqual("0x12345678<32>", c.ToString());
        }
Esempio n. 3
0
 public override bool TryRead(MemoryArea mem, Address addr, PrimitiveType dt, out Constant value)
 {
     return(mem.TryReadLe(addr, dt, out value));
 }
Esempio n. 4
0
 public bool TryRead(MemoryArea mem, Address addr, PrimitiveType dt, out Constant c)
 {
     // Arbitrarily choose little-endian.
     return(mem.TryReadLe(addr, dt, out c));
 }