public void ReadCString() { var img = new LeImageReader(new byte[] { 0x12, 0x48, 0x65, 0x6C, 0x6C, 0x6F, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x00, 0x12 }, 1); StringConstant str = img.ReadCString(PrimitiveType.Char); Assert.AreEqual("Hello world!", str.ToString()); }
public void ReadLengthPrefixedString() { var img = new LeImageReader( new LoadedImage( Address.Ptr32(0x10000), new byte[] { 0x12, 0x34, 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x02, 0x02 }), 2); StringConstant str = img.ReadLengthPrefixedString(PrimitiveType.Int32, PrimitiveType.WChar); Assert.AreEqual("Foo", str.ToString()); }
public void ReadLengthPrefixedString() { var img = new LeImageReader( new ByteMemoryArea( Address.Ptr32(0x10000), new byte[] { 0x12, 0x34, 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x02, 0x02 }), 2); StringConstant str = img.ReadLengthPrefixedString(PrimitiveType.Int32, PrimitiveType.WChar, Encoding.Unicode); Assert.AreEqual("Foo", str.ToString()); Assert.AreEqual(9, img.Offset); }
public static string GetSemiColon() { return(SemiColon.ToString()); }
public static string GetColon() { return(Colon.ToString()); }
public static string GetSpace() { return(Space.ToString()); }
public static string GetBlank() { return(Blank.ToString()); }