private static void ExtractResources(ResourceDirectoryEntry root, byte[] buf) { ByteReader br = new ByteReader(buf, 0, buf.Length); while (br.Length >= 32) { br.Align(4); RESOURCEHEADER hdr = new RESOURCEHEADER(br); if (hdr.DataSize != 0) { root[hdr.TYPE][hdr.NAME][new OrdinalOrName(hdr.LanguageId)].Data = ByteBuffer.Wrap(br.ReadBytes(hdr.DataSize)); } } }
internal RESOURCEHEADER(ByteReader br) { DataSize = br.ReadInt32(); HeaderSize = br.ReadInt32(); TYPE = ReadOrdinalOrName(br); NAME = ReadOrdinalOrName(br); br.Align(4); DataVersion = br.ReadInt32(); MemoryFlags = br.ReadUInt16(); LanguageId = br.ReadUInt16(); Version = br.ReadInt32(); Characteristics = br.ReadInt32(); }