Beispiel #1
0
 public static bool CheckPFI(byte[] PFI)
 {
     Trace.WriteLine("Checking PFI values");
     SCSIDevice.DiscData data = new SCSIDevice.DiscData(PFI, 0);
     if (data.StartSectorNumber == 0x30000)
     {
         Trace.WriteLine("PFI Validated (Start sector is ok)");
         return(true);
     }
     Trace.WriteLine("PFI invalid! (Start sector is " + data.StartSectorNumber.ToString() + ")");
     return(false);
 }
Beispiel #2
0
 public static bool SimpleCheckSS(byte[] SS)
 {
     Trace.WriteLine("Checking SS information..");
     SCSIDevice.DiscData data = new SCSIDevice.DiscData(SS, 0);
     if ((data.Layer0LastSectorLBA == 0x1b3880) || (data.Layer0LastSectorLBA == 0x1a2db0))
     {
         Trace.WriteLine("SS information valid - Layerbreak is correct");
         return(true);
     }
     Trace.WriteLine("SS information valid - Layerbreak is incorrect");
     return(false);
 }
Beispiel #3
0
        public static ISOPartitionDetails GetPartitionDetails(byte[] ss, byte[] pfi, Format ISOType, int VideoSize)
        {
            Trace.WriteLine("Getting partition Details from ISO");
            ISOPartitionDetails details = new ISOPartitionDetails();

            SCSIDevice.DiscData data  = new SCSIDevice.DiscData(ss, 0);
            SCSIDevice.DiscData data2 = new SCSIDevice.DiscData(pfi, 0);
            details.VideoPartitionSize = data.StartSectorNumber - data2.StartSectorNumber;
            Trace.WriteLine("Video partition size: " + details.VideoPartitionSize.ToString());
            details.GamePartitionSize = data.Layer0LastSectorLBA * 2;
            Trace.WriteLine("Game partition size: " + details.GamePartitionSize.ToString());
            details.LayerBreak = data.Layer0LastSectorLBA + details.VideoPartitionSize;
            Trace.WriteLine("Layerbreak: " + details.LayerBreak.ToString());
            Trace.WriteLine("Video Layer 0 size: " + details.VideoLayer0Size.ToString());
            details.VideoFileSize = (uint)VideoSize;
            Trace.WriteLine("Video is size: " + VideoSize);
            if ((details.VideoFileSize <= 0) || (details.VideoFileSize > 0x16e360))
            {
                if (ISOType == Format.Xbox360)
                {
                    details.VideoFileSize   = 0xdbf;
                    details.VideoLayer1Size = 0x32f;
                }
                else
                {
                    details.VideoFileSize   = 0x1b50;
                    details.VideoLayer1Size = 0xa1;
                }
            }
            else
            {
                details.VideoLayer1Size = details.VideoFileSize - data2.Layer0LastSectorLBA;
            }
            details.VideoLayer0Size      = data2.Layer0LastSectorLBA;
            details.VideoPadding         = details.VideoPartitionSize - details.VideoLayer0Size;
            details.TotalSplitVidISOSize = ((details.VideoPartitionSize + details.GamePartitionSize) + details.VideoPadding) + details.VideoLayer1Size;
            details.TotalISOSize         = details.VideoPartitionSize + details.GamePartitionSize;
            return(details);
        }
Beispiel #4
0
 public static bool CheckXbox1SS(byte[] SS)
 {
     if (SimpleCheckSS(SS))
     {
         Trace.WriteLine("Checking if Hitachi SS file");
         if (((SS[720] == 0) && (SS[0x2d1] == 0)) && ((SS[0x2d2] == 0) && (SS[0x2d3] == 0)))
         {
             Trace.WriteLine("Hitachi SS found");
             return(false);
         }
         Trace.WriteLine("Hitachi SS not found");
         Trace.WriteLine("Checking SS Layerbreak");
         SCSIDevice.DiscData data = new SCSIDevice.DiscData(SS, 0);
         if (data.Layer0LastSectorLBA == 0x1a2db0)
         {
             Trace.WriteLine("SS information valid - Layerbreak is correct");
             return(true);
         }
         Trace.WriteLine("SS information valid - Layerbreak is incorrect");
     }
     return(false);
 }