Exemple #1
0
 public void Dispose()
 {
     this.CloseFile();
     this.defaultXeX.Dispose();
     this.isoType = IsoType.GDF;
     this.isoInfo = new XkeyBrew.Utils.IsoGameReader.IsoInfo();
 }
Exemple #2
0
 private void ReadIsoData()
 {
     try
     {
         this.isoInfo            = new XkeyBrew.Utils.IsoGameReader.IsoInfo();
         this.isoInfo.SectorSize = 0x800;
         this.reader.BaseStream.Seek((long)(0x20 * (long)this.isoInfo.SectorSize), SeekOrigin.Begin);
         if (Encoding.ASCII.GetString(this.reader.ReadBytes(20)) == "MICROSOFT*XBOX*MEDIA")
         {
             this.isoType            = IsoType.XSF;
             this.isoInfo.RootOffset = (uint)this.isoType;
         }
         else
         {
             this.file.Seek((long)((0x20 * (long)this.isoInfo.SectorSize) + (long)IsoType.GDF), SeekOrigin.Begin);
             if (Encoding.ASCII.GetString(this.reader.ReadBytes(20)) == "MICROSOFT*XBOX*MEDIA")
             {
                 this.isoType            = IsoType.GDF;
                 this.isoInfo.RootOffset = (uint)this.isoType;
             }
             else
             {
                 this.file.Seek((long)((0x20 * (long)this.isoInfo.SectorSize) + (long)IsoType.XGD3), SeekOrigin.Begin);
                 if (Encoding.ASCII.GetString(this.reader.ReadBytes(20)) == "MICROSOFT*XBOX*MEDIA")
                 {
                     this.isoType            = IsoType.XGD3;
                     this.isoInfo.RootOffset = (uint)this.isoType;
                 }
                 else
                 {
                     this.file.Seek((long)((0x20 * (long)this.isoInfo.SectorSize) + (long)IsoType.XBOX1), SeekOrigin.Begin);
                     if (Encoding.ASCII.GetString(this.reader.ReadBytes(20)) == "MICROSOFT*XBOX*MEDIA")
                     {
                         this.isoType            = IsoType.XBOX1;
                         this.isoInfo.RootOffset = (uint)this.isoType;
                     }
                     else
                     {
                         throw new Exception("Invalid Iso Type");
                     }
                 }
             }
         }
         this.reader.BaseStream.Seek((long)((0x20 * (long)this.isoInfo.SectorSize) + (long)this.isoInfo.RootOffset), SeekOrigin.Begin);
         this.isoInfo.Identifier        = this.reader.ReadBytes(20);
         this.isoInfo.RootDirSector     = this.reader.ReadUInt32();
         this.isoInfo.RootDirSize       = this.reader.ReadUInt32();
         this.isoInfo.ImageCreationTime = this.reader.ReadBytes(8);
         this.isoInfo.VolumeSize        = (ulong)(this.reader.BaseStream.Length - this.isoInfo.RootOffset);
         this.isoInfo.VolumeSectors     = (uint)(this.isoInfo.VolumeSize / ((ulong)this.isoInfo.SectorSize));
     }
     catch (Exception exception)
     {
         throw new Exception("Cannot read ISO info", exception);
     }
 }