public static PitData ParsePIT(string fileName)
        {
            PitData data2;

            if (!File.Exists(fileName))
            {
                throw new Exception("The specified PIT file does not exist!");
            }
            using (FileStream stream4 = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite))
            {
                byte[] array   = new byte[((int)(stream4.Length - 1L)) + 1];
                byte[] buffer2 = new byte[0x1400];
                byte[] pattern = new byte[] { 0x76, 0x98, 0x34, 0x12 };
                byte[] buffer4 = new byte[0x100];
                long   num     = 0L;
                stream4.Read(array, 0, array.Length);
                num              = HelperUtils.FindByteOffset(array, pattern, 0);
                buffer2          = HelperUtils.GetByteArray(array, ((int)num) - pattern.Length, buffer2.Length + 1);
                stream4.Position = 0L;
                stream4.SetLength((long)buffer2.Length);
                stream4.Write(buffer2, 0, buffer2.Length);
                stream4.Position = 0L;
                PitInputStream inputStream = new PitInputStream(stream4);
                data2 = new PitData();
                if (!data2.ReadPITFile(inputStream))
                {
                    throw new Exception("The specified PIT file contains corrupt or invalid data!");
                }
                MemoryStream    byteStream   = new MemoryStream();
                PitOutputStream outputStream = new PitOutputStream(byteStream);
                data2.WritePITFile(outputStream);
                stream4.Position = 0L;
                stream4.SetLength(byteStream.Length + buffer4.Length);
                stream4.Write(byteStream.ToArray(), 0, (int)byteStream.Length);
            }
            return(data2);
        }