Пример #1
0
Файл: DAT.cs Проект: X-Hax/SA3D
        public static DAT Read(byte[] source)
        {
            PushBigEndian(false);

            DAT result = new();

            result.Steam = source.GetCString(0, 0x10) switch
            {
                "archive  V2.2\0\0\0" => false,
                "archive  V2.DMZ\0" => true,
                _ => throw new Exception("Error: Unknown archive type"),
            };

            int count = source.ToInt32(0x10);

            for (int i = 0; i < count; i++)
            {
                result.Entries.Add(DATEntry.Read(source, (uint)(0x14 + (i * 0xC))));
            }

            PopEndian();
            return(result);
        }
Пример #2
0
 public void ReplaceFile(string path, int index)
 {
     Entries[index] = new DATEntry(path);
 }