public void ReadLeUInt32() { MemoryArea img = new MemoryArea(Address.Ptr32(0x10000), new byte[] { 0x78, 0x56, 0x34, 0x12 }); Constant c = img.ReadLe(0, PrimitiveType.Word32); Assert.AreSame(PrimitiveType.Word32, c.DataType); Assert.AreEqual("0x12345678<32>", c.ToString()); }
public void ReadLeNegativeInt() { MemoryArea img = new MemoryArea(Address.Ptr32(0x10000), new byte[] { 0xFE, 0xFF, 0xFF, 0xFF }); Constant c = img.ReadLe(0, PrimitiveType.Int32); Assert.AreSame(PrimitiveType.Int32, c.DataType); Assert.AreEqual("-2<i32>", c.ToString()); }
public void ReadLeUShort() { MemoryArea img = new MemoryArea(Address.Ptr32(0x10000), new byte[] { 0x78, 0x56, 0x34, 0x12 }); Constant c = img.ReadLe(2, PrimitiveType.Word16); Assert.AreSame(PrimitiveType.Word16, c.DataType); Assert.AreEqual("0x1234<16>", c.ToString()); }