internal EventLogHeader(byte[] bytes) { // File Header Signature = Encoding.ASCII.GetString(bytes, 0x00, 0x08); if (Signature == "ElfFile\0") { FirstChunkNumber = BitConverter.ToUInt64(bytes, 0x08); LastChunkNumber = BitConverter.ToUInt64(bytes, 0x10); NextRecordIdentifier = BitConverter.ToUInt64(bytes, 0x18); HeaderSize = BitConverter.ToUInt32(bytes, 0x20); MinorVersion = BitConverter.ToUInt16(bytes, 0x24); MajorVersion = BitConverter.ToUInt16(bytes, 0x26); Version = new Version(MajorVersion, MinorVersion); HeaderBlockSize = BitConverter.ToUInt16(bytes, 0x28); NumberOfChunks = BitConverter.ToUInt16(bytes, 0x2A); FileFlags = (FILEFLAGS)BitConverter.ToUInt32(bytes, 0x78); Checksum = BitConverter.ToUInt32(bytes, 0x7C); } else { throw new Exception("Invalid EventLogHeader"); } }
internal EventLogHeader(byte[] bytes) { // File Header Signature = Encoding.ASCII.GetString(bytes, 0x00, 0x08); if (Signature == "ElfFile\0") { FirstChunkNumber = BitConverter.ToUInt64(bytes, 0x08); LastChunkNumber = BitConverter.ToUInt64(bytes, 0x10); NextRecordIdentifier = BitConverter.ToUInt64(bytes, 0x18); HeaderSize = BitConverter.ToUInt32(bytes, 0x20); MinorVersion = BitConverter.ToUInt16(bytes, 0x24); MajorVersion = BitConverter.ToUInt16(bytes, 0x26); Version = new Version(MajorVersion, MinorVersion); HeaderBlockSize = BitConverter.ToUInt16(bytes, 0x28); NumberOfChunks = BitConverter.ToUInt16(bytes, 0x2A); FileFlags = (FILEFLAGS)BitConverter.ToUInt32(bytes, 0x78); Checksum = BitConverter.ToUInt32(bytes, 0x7C); } else { throw new Exception("Invalid EventLogHeader"); } }