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()); }
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()); }
public override bool TryRead(MemoryArea mem, Address addr, PrimitiveType dt, out Constant value) { return(mem.TryReadLe(addr, dt, out value)); }
public bool TryRead(MemoryArea mem, Address addr, PrimitiveType dt, out Constant c) { // Arbitrarily choose little-endian. return(mem.TryReadLe(addr, dt, out c)); }