예제 #1
0
        public bool GetCDiData(string lbaString)
        {
            if (lbaString.ToLower().Contains("cd-rtos"))
            {
                CDiVolumeDescriptor cdv = new CDiVolumeDescriptor(currSector);

                discI.Data.ManufacturerID = System.Text.Encoding.Default.GetString(currSector.ToList().Skip(1).Take(4).ToArray());
                discI.Data.OtherData      = System.Text.Encoding.Default.GetString(currSector.ToList().Skip(8).Take(16).ToArray()).Trim();
                int start = 190;
                int block = 128;

                List <string> header = new List <string>();
                for (int a = 0; a < 10; a++)
                {
                    string test = System.Text.Encoding.Default.GetString(currSector.ToList().Skip(start + (a * block)).Take(block).ToArray());
                    header.Add(test);
                }

                discI.Data.DeviceInformation = header[3].Trim();
                discI.Data.GameTitle         = header[0].Trim();
                discI.Data.Publisher         = header[1].Trim();
                discI.Data.Developer         = header[2].Trim();

                discI.Data.InternalDate = TextConverters.TruncateLongString(header[5], 12);

                return(true);
            }

            return(false);
        }
예제 #2
0
        /* Static Methods */
        private static ISOData PopulateISOData(ISOVolumeDescriptor vd)
        {
            ISOData i = new ISOData();

            // strings
            i.AbstractFileIdentifier        = System.Text.Encoding.Default.GetString(vd.AbstractFileIdentifier).TrimEnd('\0', ' ');
            i.ApplicationIdentifier         = System.Text.Encoding.Default.GetString(vd.ApplicationIdentifier).TrimEnd('\0', ' ');
            i.BibliographicalFileIdentifier = System.Text.Encoding.Default.GetString(vd.BibliographicalFileIdentifier).TrimEnd('\0', ' ');
            i.CopyrightFileIdentifier       = System.Text.Encoding.Default.GetString(vd.CopyrightFileIdentifier).TrimEnd('\0', ' ');
            i.DataPreparerIdentifier        = System.Text.Encoding.Default.GetString(vd.DataPreparerIdentifier).TrimEnd('\0', ' ');
            i.PublisherIdentifier           = System.Text.Encoding.Default.GetString(vd.PublisherIdentifier).TrimEnd('\0', ' ');
            i.Reserved            = System.Text.Encoding.Default.GetString(vd.Reserved).Trim('\0');
            i.SystemIdentifier    = System.Text.Encoding.Default.GetString(vd.SystemIdentifier).TrimEnd('\0', ' ');
            i.VolumeIdentifier    = System.Text.Encoding.Default.GetString(vd.VolumeIdentifier).TrimEnd('\0', ' ');
            i.VolumeSetIdentifier = System.Text.Encoding.Default.GetString(vd.VolumeSetIdentifier).TrimEnd('\0', ' ');

            // ints
            i.NumberOfSectors      = vd.NumberOfSectors;
            i.PathTableSize        = vd.PathTableSize;
            i.SectorSize           = vd.SectorSize;
            i.Type                 = vd.Type;
            i.VolumeSequenceNumber = vd.VolumeSequenceNumber;

            // datetimes
            i.EffectiveDateTime    = TextConverters.ParseDiscDateTime(TextConverters.TruncateLongString(System.Text.Encoding.Default.GetString(vd.EffectiveDateTime.ToArray()).Trim(), 12));
            i.ExpirationDateTime   = TextConverters.ParseDiscDateTime(TextConverters.TruncateLongString(System.Text.Encoding.Default.GetString(vd.ExpirationDateTime.ToArray()).Trim(), 12));
            i.LastModifiedDateTime = TextConverters.ParseDiscDateTime(TextConverters.TruncateLongString(System.Text.Encoding.Default.GetString(vd.LastModifiedDateTime.ToArray()).Trim(), 12));
            i.VolumeCreationDate   = TextConverters.ParseDiscDateTime(TextConverters.TruncateLongString(System.Text.Encoding.Default.GetString(vd.VolumeCreationDateTime.ToArray()).Trim(), 12));

            // other
            i.RootDirectoryRecord = vd.RootDirectoryRecord;

            return(i);
        }