From 10e253ba70e531d0aa56f704c3b74458040b4c3b Mon Sep 17 00:00:00 2001 From: MichaelHinrichs Date: Tue, 10 Sep 2024 17:30:59 -0500 Subject: [PATCH] change subfile struct to a class --- Program.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Program.cs b/Program.cs index 6f137ba..6492aba 100644 --- a/Program.cs +++ b/Program.cs @@ -14,11 +14,11 @@ class Program public static BinaryReader br; public static BinaryWriter bw; - struct Subfile + class Subfile { - public string Name; - public uint Offset; - public uint Size; + public string Name = new string(br.ReadChars(0XF8)).TrimEnd('\0'); + public uint Offset = br.ReadUInt32(); + public uint Size = br.ReadUInt32(); } static void Main(string[] args) @@ -43,9 +43,7 @@ static void Main(string[] args) br.BaseStream.Position = metaOffset; for (int i = 0; i < subfile.Length; i++) { - subfile[i].Name = new string(br.ReadChars(0XF8)).TrimEnd('\0'); - subfile[i].Offset = br.ReadUInt32(); - subfile[i].Size = br.ReadUInt32(); + subfile[i] = new(); } for (int i = 0; i < subfile.Length; i++)