mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-04-11 17:57:19 +10:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
namespace PriFileFormat
|
|
{
|
|
public class TocEntry
|
|
{
|
|
public string SectionIdentifier { get; }
|
|
public ushort Flags { get; }
|
|
public ushort SectionFlags { get; }
|
|
public uint SectionQualifier { get; }
|
|
public uint SectionOffset { get; }
|
|
public uint SectionLength { get; }
|
|
private TocEntry (string sectionIdentifier, ushort flags, ushort sectionFlags, uint sectionQualifier, uint sectionOffset, uint sectionLength)
|
|
{
|
|
SectionIdentifier = sectionIdentifier;
|
|
Flags = flags;
|
|
SectionFlags = sectionFlags;
|
|
SectionQualifier = sectionQualifier;
|
|
SectionOffset = sectionOffset;
|
|
SectionLength = sectionLength;
|
|
}
|
|
internal static TocEntry Parse (BinaryReader binaryReader)
|
|
{
|
|
return new TocEntry (
|
|
new string (binaryReader.ReadChars (16)),
|
|
binaryReader.ReadUInt16 (),
|
|
binaryReader.ReadUInt16 (),
|
|
binaryReader.ReadUInt32 (),
|
|
binaryReader.ReadUInt32 (),
|
|
binaryReader.ReadUInt32 ());
|
|
}
|
|
public override string ToString ()
|
|
{
|
|
return $"{SectionIdentifier.TrimEnd ('\0', ' ')} length: {SectionLength}";
|
|
}
|
|
}
|
|
}
|