Organized the project files.

And also fixed some bugs.
This commit is contained in:
Bruce
2025-12-08 16:06:13 +08:00
parent ed7fe3af4b
commit d1813637c5
95 changed files with 46744 additions and 36366 deletions
+37
View File
@@ -0,0 +1,37 @@
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}";
}
}
}