Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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());
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public static string GetSemiColon()
 {
     return(SemiColon.ToString());
 }
Esempio n. 5
0
 public static string GetColon()
 {
     return(Colon.ToString());
 }
Esempio n. 6
0
 public static string GetSpace()
 {
     return(Space.ToString());
 }
Esempio n. 7
0
 public static string GetBlank()
 {
     return(Blank.ToString());
 }