public void ImageResourceDirStringUConstructorWorks_Test()
        {
            var resourceDirStringU = new IMAGE_RESOURCE_DIR_STRING_U(RawStructures.RawResourceDirStringU, 2);

            Assert.Equal((uint)0x000b, resourceDirStringU.Length);
            Assert.Equal("Hello World", resourceDirStringU.NameString);
        }
Esempio n. 2
0
        public static IMAGE_RESOURCE_DIR_STRING_U Deserialize(MultiPartFile file)
        {
            IMAGE_RESOURCE_DIR_STRING_U irdsu = new IMAGE_RESOURCE_DIR_STRING_U();

            irdsu.Length     = file.ReadUInt16();
            irdsu.NameString = file.ReadChars(irdsu.Length);

            return(irdsu);
        }
Esempio n. 3
0
        public ResourceDirectoryEntry(Stream stream, long rsrcSectionFileAddress)
        {
            using (var br = new BinaryReader(stream, Encoding.Unicode, true))
            {
                header = br.ReadStruct <IMAGE_RESOURCE_DIRECTORY_ENTRY>();
#if COVERAGE_TEST && USE_SIZE
                RemoveBack(br.BaseStream.Position, header.GetType());
#endif
                if (header.IsString)
                {
                    var pos = br.BaseStream.Position;
                    br.BaseStream.Seek(rsrcSectionFileAddress + header.StringOffset, SeekOrigin.Begin);
                    //need to use this function because of the variable length
                    name = IMAGE_RESOURCE_DIR_STRING_U.FromStream(br);
#if COVERAGE_TEST && USE_SIZE
                    RemoveBack(br.BaseStream.Position, name.Value.Size);
#endif
                    br.BaseStream.Position = pos;
                }
            }
        }