Beispiel #1
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((CIAView)view)
            {
            case CIAView.CIA:
                var cia = Header;
                f.SetGroupHeaders("CIA", "CIA Offsets");
                f.AddListItem(0, 8, "Padding Length", cia.PaddingLength, 0);
                f.AddListItem(8, 4, "Certificate Chain Length", cia.CertificateChainLength, 0);
                f.AddListItem(12, 4, "Ticket Length", cia.TicketLength, 0);
                f.AddListItem(16, 4, "TMD Length", cia.TMDLength, 0);
                f.AddListItem(20, 4, "Meta Length", cia.MetaLength, 0);
                f.AddListItem(24, 8, "Content Length", cia.ContentLength, 0);

                f.AddListItem(0, 8, "Certificate Chain Offset", (ulong)CertificateChainOffset, 1);
                f.AddListItem(0, 8, "Ticket Offset", (ulong)TicketOffset, 1);
                f.AddListItem(0, 8, "TMD Offset", (ulong)TMDOffset, 1);
                f.AddListItem(0, 8, "Content Offset", (ulong)ContentOffset, 1);
                f.AddListItem(0, 8, "Meta Offset", (ulong)MetaOffset, 1);
                break;

            case CIAView.Meta:
                CIAMetaHeaderEntry entry;
                f.SetGroupHeaders("CIA Meta");
                for (var i = 0; i < MetaHeaderEntries.Count; i++)
                {
                    entry = (CIAMetaHeaderEntry)MetaHeaderEntries[i];
                    f.AddListItem(i, 2, "Type " + entry.Type, entry.Index, 0);
                    f.AddListItem(i, 4, "Magic", entry.Magic, 0);
                }
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #2
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((ICNView)view)
            {
                case ICNView.ICN:
                    f.SetGroupHeaders("ICN", "Icons");
                    string pubString, firString, secString;
                    f.AddListItem(0, 4, "Magic (='SMDH')", Header.Magic, 0);
                    f.AddListItem(4, 4, "Padding 0", Header.Padding0, 0);

                    for (var i = 0; i < Header.Descriptions.Length; i++)
                    {
                        pubString = Encoding.Unicode.GetString(Header.Descriptions[i].Publisher);
                        firString = Encoding.Unicode.GetString(Header.Descriptions[i].FirstTitle);
                        secString = Encoding.Unicode.GetString(Header.Descriptions[i].SecondTitle);
                        f.AddListItem(i.ToString(), ((Localization)i).ToString(), firString, secString, pubString, 0);
                    }

                    f.AddListItem(0, 0, "Small Icon", 24, 1);
                    f.AddListItem(0, 0, "Large Icon", 48, 1);
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #3
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     f.SetGroupHeaders("Ticket", "Ticket Time Limits");
     f.AddListItem(0x000, 0x004, "Signature Type", (ulong)Ticket.SignatureType, 0);
     f.AddListItem(0x004, 0x100, "RSA-2048 signature of the Ticket", Ticket.Signature, 0);
     f.AddListItem(0x104, 0x03C, "Padding 0", Ticket.Padding0, 0);
     f.AddListItem(0x140, 0x040, "Issuer", Ticket.Issuer, 0);
     f.AddListItem(0x180, 0x03C, "ECDSA", Ticket.ECDSA, 0);
     f.AddListItem(0x1BC, 0x003, "Padding 1", Ticket.Padding1, 0);
     f.AddListItem(0x1BF, 0x010, "Encrypted Title Key", Ticket.EncryptedTitleKey, 0);
     f.AddListItem(0x1CF, 0x001, "Unknown 0", Ticket.Unknown0, 0);
     f.AddListItem(0x1D0, 0x008, "Ticket ID", Ticket.TicketID, 0);
     f.AddListItem(0x1D8, 0x004, "Console ID", Ticket.ConsoleID, 0);
     f.AddListItem(0x1DC, 0x008, "Title ID", Ticket.TitleID, 0);
     f.AddListItem(0x1E4, 0x002, "System Access", Ticket.SystemAccess, 0);
     f.AddListItem(0x1E6, 0x002, "Ticket Version", Ticket.TicketVersion, 0);
     f.AddListItem(0x1E8, 0x004, "Permitted Titles Mask", Ticket.PermittedTitlesMask, 0);
     f.AddListItem(0x1EC, 0x004, "Permit Mask", Ticket.PermitMask, 0);
     f.AddListItem(0x1F0, 0x001, "Title Export allowed using PRNG key", Ticket.TitleExport, 0);
     f.AddListItem(0x1F1, 0x001, "Common Key index (1=Korean,0=Normal)", Ticket.CommonKeyIndex, 0);
     f.AddListItem(0x1F2, 0x030, "Unknown1", Ticket.Unknown1, 0);
     f.AddListItem(0x222, 0x040, "Content access permissions (bit for each content)", Ticket.ContentPermissions, 0);
     f.AddListItem(0x262, 0x002, "Padding 2", Ticket.Padding2, 0);
     for (int i = 0; i < Ticket.TimeLimitEntries.Length; i++)
     {
         f.AddListItem(0x264 + i * 8, 0x004, "Time Limit Enabled=" + Ticket.TimeLimitEntries[i].EnableTimeLimit + " For", Ticket.TimeLimitEntries[i].TimeLimitSeconds, 1);
     }
     f.AutoAlignColumns();
 }
Beispiel #4
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((DARCView)view)
            {
            case DARCView.Header:
                f.SetGroupHeaders("DARC Header");
                f.AddListItem(0x000, 4, "Magic", Header.Magic, 0);
                f.AddListItem(0x004, 2, "Endianness", Header.Endianness, 0);
                f.AddListItem(0x006, 2, "Header's Length", Header.HeaderLength, 0);
                f.AddListItem(0x008, 4, "Version", Header.Version, 0);
                f.AddListItem(0x00C, 4, "File Length", Header.FileLength, 0);
                f.AddListItem(0x010, 4, "File Table Offset", Header.FileTableOffset, 0);
                f.AddListItem(0x014, 4, "File Table Length", Header.FileTableLength, 0);
                f.AddListItem(0x018, 4, "Files Data Offset", Header.FilesDataOffset, 0);
                break;

            case DARCView.FilesTable:
                f.SetGroupHeaders("Files");
                for (var i = 0; i < Files.Count; i++)
                {
                    f.AddListItem(i, 1, " *** " + FileNames[i], 0, 0);
                    f.AddListItem(i, 2, "File's Name offset", Files[i].NameOffset, 0);
                    f.AddListItem(i, 1, "Parent", Files[i].Parent, 0);
                    f.AddListItem(i, 1, "Is folder", Files[i].Folder, 0);
                    f.AddListItem(i, 4, "File's offset", Files[i].Offset, 0);
                    f.AddListItem(i, 4, "File's length", Files[i].Length, 0);
                }
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #5
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     f.SetGroupHeaders("Ticket", "Ticket Time Limits");
     f.AddListItem(0x000, 0x004, "Signature Type", (ulong)Ticket.SignatureType, 0);
     f.AddListItem(0x004, 0x100, "RSA-2048 signature of the Ticket", Ticket.Signature, 0);
     f.AddListItem(0x104, 0x03C, "Padding 0", Ticket.Padding0, 0);
     f.AddListItem(0x140, 0x040, "Issuer", Ticket.Issuer, 0);
     f.AddListItem(0x180, 0x03C, "ECDSA", Ticket.ECDSA, 0);
     f.AddListItem(0x1BC, 0x003, "Padding 1", Ticket.Padding1, 0);
     f.AddListItem(0x1BF, 0x010, "Encrypted Title Key", Ticket.EncryptedTitleKey, 0);
     f.AddListItem(0x1CF, 0x001, "Unknown 0", Ticket.Unknown0, 0);
     f.AddListItem(0x1D0, 0x008, "Ticket ID", Ticket.TicketID, 0);
     f.AddListItem(0x1D8, 0x004, "Console ID", Ticket.ConsoleID, 0);
     f.AddListItem(0x1DC, 0x008, "Title ID", Ticket.TitleID, 0);
     f.AddListItem(0x1E4, 0x002, "System Access", Ticket.SystemAccess, 0);
     f.AddListItem(0x1E6, 0x002, "Ticket Version", Ticket.TicketVersion, 0);
     f.AddListItem(0x1E8, 0x004, "Permitted Titles Mask", Ticket.PermittedTitlesMask, 0);
     f.AddListItem(0x1EC, 0x004, "Permit Mask", Ticket.PermitMask, 0);
     f.AddListItem(0x1F0, 0x001, "Title Export allowed using PRNG key", Ticket.TitleExport, 0);
     f.AddListItem(0x1F1, 0x001, "Common Key index (1=Korean,0=Normal)", Ticket.CommonKeyIndex, 0);
     f.AddListItem(0x1F2, 0x030, "Unknown1", Ticket.Unknown1, 0);
     f.AddListItem(0x222, 0x040, "Content access permissions (bit for each content)", Ticket.ContentPermissions, 0);
     f.AddListItem(0x262, 0x002, "Padding 2", Ticket.Padding2, 0);
     for (int i = 0; i < Ticket.TimeLimitEntries.Length; i++)
         f.AddListItem(0x264 + i * 8, 0x004, "Time Limit Enabled=" + Ticket.TimeLimitEntries[i].EnableTimeLimit + " For", Ticket.TimeLimitEntries[i].TimeLimitSeconds, 1);
     f.AutoAlignColumns();
 }
Beispiel #6
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((ICNView)view)
            {
            case ICNView.ICN:
                f.SetGroupHeaders("ICN", "Icons");
                string pubString, firString, secString;
                f.AddListItem(0, 4, "Magic (='SMDH')", Header.Magic, 0);
                f.AddListItem(4, 4, "Padding 0", Header.Padding0, 0);

                for (var i = 0; i < Header.Descriptions.Length; i++)
                {
                    pubString = Encoding.Unicode.GetString(Header.Descriptions[i].Publisher);
                    firString = Encoding.Unicode.GetString(Header.Descriptions[i].FirstTitle);
                    secString = Encoding.Unicode.GetString(Header.Descriptions[i].SecondTitle);
                    f.AddListItem(i.ToString(), ((Localization)i).ToString(), firString, secString, pubString, 0);
                }

                f.AddListItem(0, 0, "Small Icon", 24, 1);
                f.AddListItem(0, 0, "Large Icon", 48, 1);
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #7
0
        public void View(frmExplorer f, int view, object[] values)
        {
            //var i = values != null ? values[0] : -1;
            f.ClearInformation();
            switch ((CXIView)view)
            {
            case CXIView.NCCH:
                f.SetGroupHeaders("Title", "Hash", "NCCH");
                f.AddListItem(string.Empty, string.Empty, "Full Title (Name & Region)", string.Empty, TitleInfo.Title + " - " + TitleInfo.Region, 0);
                f.AddListItem(string.Empty, string.Empty, "Title Type", string.Empty, TitleInfo.Type, 0);
                f.AddListItem(string.Empty, string.Empty, "Publisher", string.Empty, TitleInfo.Developer, 0);

                f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCCH header [SHA-256]", Header.NCCHHeaderSignature, 1);

                f.AddListItem(0x100, 4, "Magic (='NCCH')", Header.Magic, 2);
                f.AddListItem(0x104, 4, "NCCH length [medias]", Header.CXILength, 2);
                f.AddListItem(0x108, 8, "Title ID", Header.TitleID, 2);
                f.AddListItem(0x110, 2, "Maker Code", Header.MakerCode, 2);
                f.AddListItem(0x112, 2, "Version", Header.Version, 2);
                f.AddListItem(0x118, 8, "Program ID", Header.TitleID, 2);
                f.AddListItem(0x120, 8, "Temp Flag", Header.TempFlag, 2);
                f.AddListItem(0x124, 20, "Unknown 0_0", Header.Unknown0_0, 2);
                f.AddListItem(0x144, 20, "Unknown 0_1", Header.Unknown0_1, 2);
                f.AddListItem(0x150, 0x10, "Product Code", Header.ProductCode, 2);
                f.AddListItem(0x160, 0x20, "Extended Header Hash", Header.ExtendedHeaderHash, 2);
                f.AddListItem(0x180, 4, "Extended header size", Header.ExtendedHeaderSize, 2);
                f.AddListItem(0x184, 4, "Unknown 1", Header.Unknown1, 2);
                f.AddListItem(0x188, 4, "Unknown 2", Header.Unknown2, 2);
                f.AddListItem(0x18C, 4, "Flags", Header.Flags, 2);
                f.AddListItem(0x190, 4, "Plain region offset [medias]", Header.PlainRegionOffset, 2);
                f.AddListItem(0x194, 4, "Plain region length [medias]", Header.PlainRegionSize, 2);
                f.AddListItem(0x198, 4, "Unknown 3", Header.Unknown3, 2);
                f.AddListItem(0x19C, 4, "Unknown 4", Header.Unknown4, 2);
                f.AddListItem(0x1A0, 4, "ExeFS offset [medias]", Header.ExeFSOffset, 2);
                f.AddListItem(0x1A4, 4, "ExeFS length [medias]", Header.ExeFSLength, 2);
                f.AddListItem(0x1A8, 4, "ExeFS hash region length [medias]", Header.ExeFSHashRegionSize, 2);
                f.AddListItem(0x1AC, 4, "Unknown 5", Header.Unknown5, 2);
                f.AddListItem(0x1B0, 4, "RomFS offset [medias]", Header.RomFSOffset, 2);
                f.AddListItem(0x1B4, 4, "RomFS length [medias]", Header.RomFSLength, 2);
                f.AddListItem(0x1B8, 4, "RomFS hash region length [medias]", Header.RomFSHashRegionSize, 2);
                f.AddListItem(0x1BC, 4, "Unknown 6", Header.Unknown6, 2);
                f.AddListItem(0x1C0, 0x20, "ExeFS superblock hash", Header.ExeFSSuperBlockhash, 2);
                f.AddListItem(0x1E0, 0x20, "RomFS superblock hash", Header.RomFSSuperBlockhash, 2);
                break;

            case CXIView.NCCHPlainRegion:
                f.SetGroupHeaders("Plain Regions");
                for (var j = 0; j < PlainRegion.PlainRegionStrings.Length; j++)
                {
                    f.AddListItem(0, 4, PlainRegion.PlainRegionStrings[j], (ulong)PlainRegion.PlainRegionStrings[j].Length, 0);
                }
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #8
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((ArchivedCCIView)view)
     {
         case ArchivedCCIView.Archive:
             f.SetGroupHeaders("CRC32");
             f.AddListItem(0x000, 0x000, _cciName, _crc , 0);
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #9
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((ArchivedCCIView)view)
     {
     case ArchivedCCIView.Archive:
         f.SetGroupHeaders("CRC32");
         f.AddListItem(0x000, 0x000, _cciName, _crc, 0);
         break;
     }
     f.AutoAlignColumns();
 }
Beispiel #10
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((BannerView)view)
     {
         case BannerView.Banner:
             f.SetGroupHeaders("Banner");
             var len = CBMDContext.Header.CBMDLength;
             f.AddListItem(0, 4, "CBMD Offset", 0, 0);
             f.AddListItem(0, 4, "CBMD Length", len, 0);
             f.AddListItem(0, 4, "CWAV Offset", len + ((len % 0x20) == 0 ? 0 : 0x20 - (len % 0x20)), 0);
             f.AddListItem(0, 4, "CWAV Length", CWAVContext.Wave.DataChunkLength - 8, 0);
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #11
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((BannerView)view)
     {
     case BannerView.Banner:
         f.SetGroupHeaders("Banner");
         var len = CBMDContext.Header.CBMDLength;
         f.AddListItem(0, 4, "CBMD Offset", 0, 0);
         f.AddListItem(0, 4, "CBMD Length", len, 0);
         f.AddListItem(0, 4, "CWAV Offset", len + ((len % 0x20) == 0 ? 0 : 0x20 - (len % 0x20)), 0);
         f.AddListItem(0, 4, "CWAV Length", CWAVContext.Wave.DataChunkLength - 8, 0);
         break;
     }
     f.AutoAlignColumns();
 }
Beispiel #12
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((CBMDView)view)
     {
         case CBMDView.CBMD:
             var bmd = Header;
             f.SetGroupHeaders("CBMD");
             f.AddListItem(0, 4, "Magic", bmd.Magic, 0);
             f.AddListItem(4, 4, "Padding 0", bmd.Padding0, 0);
             f.AddListItem(8, 4, "Compressed CGFX Offset", bmd.CompressedCGFXOffset, 0);
             f.AddListItem(0x10, 0x78, "Padding 1", bmd.Padding1, 0);
             f.AddListItem(0x84, 4, "CBMD Length", bmd.CBMDLength, 0);
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #13
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((CBMDView)view)
     {
     case CBMDView.CBMD:
         var bmd = Header;
         f.SetGroupHeaders("CBMD");
         f.AddListItem(0, 4, "Magic", bmd.Magic, 0);
         f.AddListItem(4, 4, "Padding 0", bmd.Padding0, 0);
         f.AddListItem(8, 4, "Compressed CGFX Offset", bmd.CompressedCGFXOffset, 0);
         f.AddListItem(0x10, 0x78, "Padding 1", bmd.Padding1, 0);
         f.AddListItem(0x84, 4, "CBMD Length", bmd.CBMDLength, 0);
         break;
     }
     f.AutoAlignColumns();
 }
Beispiel #14
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((CWAVView)view)
            {
            case CWAVView.CWAV:
                f.SetGroupHeaders("CWAV", "INFO", "Channels", "DATA");
                f.AddListItem(0, 4, "Magic", Wave.Magic, 0);
                f.AddListItem(4, 2, "Endianess", Wave.Endianess, 0);
                f.AddListItem(6, 2, "Struct length", Wave.StructLength, 0);
                f.AddListItem(8, 4, "Unknown0", Wave.Unknown0, 0);
                f.AddListItem(0x0C, 4, "File Size", Wave.FileSize, 0);
                f.AddListItem(0x10, 4, "Number of chunks", Wave.NumOfChunks, 0);
                f.AddListItem(0x14, 4, "Info Chunk Flags", Wave.InfoChunkFlags, 0);
                f.AddListItem(0x18, 4, "Info Chunk Offset", Wave.InfoChunkOffset, 0);
                f.AddListItem(0x1C, 4, "Info Chunk Length", Wave.InfoChunkLength, 0);
                f.AddListItem(0x20, 4, "Data Chunk Flags", Wave.DataChunkFlags, 0);
                f.AddListItem(0x24, 4, "Data Chunk Offset", Wave.DataChunkOffset, 0);
                f.AddListItem(0x28, 4, "Data Chunk Length", Wave.DataChunkLength, 0);
                f.AddListItem(0x2C, 0x14, "Reserved", Wave.Reserved, 0);

                f.AddListItem(0, 4, "Magic", InfoBlob.Magic, 1);
                f.AddListItem(4, 4, "Info Data Length", InfoBlob.InfoDataLength, 1);
                f.AddListItem(8, 4, "Type", InfoBlob.Type, 1);
                f.AddListItem(12, 4, "Samples per second", InfoBlob.SampleRate, 1);
                f.AddListItem(16, 4, "Unknown 0", InfoBlob.Unknown0, 1);
                f.AddListItem(20, 4, "NumberOfSamples", InfoBlob.NumberOfSamples, 1);
                f.AddListItem(24, 4, "Unknown 2", InfoBlob.Unknown2, 1);
                f.AddListItem(28, 4, "Channels", InfoBlob.Channels, 1);
                for (var i = 0; i < ChannelDataPointers.Length; i++)
                {
                    f.AddListItem(0, 4, "Channel " + i + " Ptr Flags", ChannelDataPointers[i].Flags, 2);
                    f.AddListItem(0, 4, "Channel " + i + " Ptr Offset", ChannelDataPointers[i].Offset, 2);
                    f.AddListItem(0, 4, "Channel " + i + " Data Flags", ChannelDatas[i].Flags, 2);
                    f.AddListItem(0, 8, "Channel " + i + " Data Offset", ChannelDatas[i].Offset, 2);
                    f.AddListItem(0, 4, "Channel " + i + " Data FFs", ChannelDatas[i].FFs, 2);
                    f.AddListItem(0, 4, "Channel " + i + " Data Padding", ChannelDatas[i].Padding, 2);
                }
                f.AddListItem(0, 4, "Magic", DataBlob.Magic, 3);
                f.AddListItem(4, 4, "Length", DataBlob.Length, 3);
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #15
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((CGFXView)view)
     {
     case CGFXView.CGFX:
         f.SetGroupHeaders("CGFX", "DATA");
         f.AddListItem(0x00, 4, "Magic", Graphics.Magic, 0);
         f.AddListItem(0x04, 2, "Endianess", Graphics.Endianess, 0);
         f.AddListItem(0x06, 2, "DATA Offset", Graphics.DataOffset, 0);
         f.AddListItem(0x08, 4, "Unknown 0", Graphics.Unknown0, 0);
         f.AddListItem(0x0C, 4, "File Size", Graphics.FileSize, 0);
         f.AddListItem(0x10, 4, "Unknown 1", Graphics.Unknown1, 0);
         f.AddListItem(0x14, 4, "Magic", Graphics.DataBlob.Magic, 1);
         f.AddListItem(0x18, 4, "Length", Graphics.DataBlob.Length, 1);
         break;
     }
     f.AutoAlignColumns();
 }
Beispiel #16
0
        public void View(frmExplorer f, int view, object[] values)
        {
            var i = (int)values[0];

            f.ClearInformation();
            if (i < 0)
            {
                f.SetGroupHeaders("Certificates");
                f.AddListItem(0, 4, "Certificate Count", (ulong)List.Count, 0);
            }
            else
            {
                var entry = (CertificateEntry)List[i];
                var cert  = entry.Certificate;
                f.SetGroupHeaders("Certificate");
                f.AddListItem(0, 4, "Signature Type", (ulong)entry.SignatureType, 0);
                int off = 4;
                if (entry.SignatureType == SignatureType.RSA_2048_SHA256 || entry.SignatureType == SignatureType.RSA_2048_SHA1)
                {
                    f.AddListItem(off, 0x100, "RSA-2048 signature of the content", entry.Signature, 0);
                    off += 0x100;
                }
                else
                {
                    f.AddListItem(off, 0x200, "RSA-4096 signature of the content", entry.Signature, 0);
                    off += 0x200;
                }
                f.AddListItem(off, 60, "Reserved0", cert.Reserved0, 0);
                f.AddListItem(off + 60, 64, "Issuer", cert.Issuer, 0);
                f.AddListItem(off + 124, 4, "Tag", cert.Tag, 0);
                f.AddListItem(off + 128, 64, "Name", cert.Name, 0);
                f.AddListItem(off + 292, 0x104, "Key", cert.Key, 0);
                f.AddListItem(off + 552, 2, "Unknown0", cert.Unknown1, 0);
                f.AddListItem(off + 554, 2, "Unknown1", cert.Unknown2, 0);
                f.AddListItem(off + 556, 52, "Padding", cert.Padding, 0);
            }
            f.AutoAlignColumns();
        }
Beispiel #17
0
 public void View(frmExplorer f, int view, object[] values)
 {
     //var i = values != null ? (int)values[0] : -1;
     f.ClearInformation();
     switch ((CCIView)view)
     {
     case CCIView.NCSD:
         f.SetGroupHeaders("Hash", "NCSD");
         f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCSD header [SHA-256]", Header.NCSDHeaderSignature, 0);
         f.AddListItem(0x100, 4, "Magic (='NCSD')", Header.Magic, 1);
         f.AddListItem(0x104, 4, "NCSD length [medias]", Header.CCILength, 1);
         f.AddListItem(0x108, 8, "Main Title ID", Header.MainTitleID, 1);
         f.AddListItem(0x110, 8, "Partitions FS Type", Header.PartitionFStype, 1);
         f.AddListItem(0x118, 8, "Partitions Crypt Type", Header.PartitionCrypttype, 1);
         for (var i = 0; i < 8; i++)
         {
             f.AddListItem(0x120 + i * 8, 4, "NCCH " + i + " offset [medias]", Header.CXIEntries[i].Offset, 1);
             f.AddListItem(0x124 + i * 8, 4, "NCCH " + i + " length [medias]", Header.CXIEntries[i].Length, 1);
         }
         f.AddListItem(0x160, 40, "Unknown Zeros 0", Header.UnknownZeros0, 1);
         f.AddListItem(0x188, 8, "NCCH Flags", Header.CXIFlags, 1);
         for (var i = 0; i < 8; i++)
         {
             f.AddListItem(0x190 + i * 8, 8, "NCCH " + i + " Title ID", Header.CXITitleIDs[i], 1);
         }
         f.AddListItem(0x1D0, 40, "Unknown Zeros 1", Header.UnknownZeros1, 1);
         f.AddListItem(0x1F8, 8, "Unknown 1", Header.Unknown1, 1);
         f.AddListItem(0x200, 4, "Always 0xFFFFFFFF", Header.PaddingFF, 1);
         f.AddListItem(0x204, 252, "Unknown 2", Header.Unknown2, 1);
         f.AddListItem(0x300, 4, "Used ROM length [bytes]", Header.UsedRomLength, 1);
         f.AddListItem(0x304, 28, "Unknown 3", Header.Unknown3, 1);
         f.AddListItem(0x320, 8, "Loader Title ID", Header.LoaderTitleId, 1);
         f.AddListItem(0x328, 8, "Loader Title Version", Header.LoaderTitleVersion, 1);
         break;
     }
     f.AutoAlignColumns();
 }
Beispiel #18
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((CIAView)view)
            {
            case CIAView.CIA:
                var cia = Header;
                f.SetGroupHeaders("CIA", "CIA Offsets");
                f.AddListItem(0, 8, "Padding Length", cia.PaddingLength, 0);
                f.AddListItem(8, 4, "Certificate Chain Length", cia.CertificateChainLength, 0);
                f.AddListItem(12, 4, "Ticket Length", cia.TicketLength, 0);
                f.AddListItem(16, 4, "TMD Length", cia.TMDLength, 0);
                f.AddListItem(20, 4, "Meta Length", cia.MetaLength, 0);
                f.AddListItem(24, 8, "Content Length", cia.ContentLength, 0);

                f.AddListItem(0, 8, "Certificate Chain Offset", (ulong)CertificateChainOffset, 1);
                f.AddListItem(0, 8, "Ticket Offset", (ulong)TicketOffset, 1);
                f.AddListItem(0, 8, "TMD Offset", (ulong)TMDOffset, 1);
                f.AddListItem(0, 8, "Content Offset", (ulong)ContentOffset, 1);
                f.AddListItem(0, 8, "Meta Offset", (ulong)MetaOffset, 1);
                break;

            case CIAView.Meta:
                CIAMetaHeaderEntry entry;
                f.SetGroupHeaders("CXI Dependancy TitleID List", "Core Version");
                for (var i = 0; i < MetaHeaderEntries.Count; i++)
                {
                    entry = (CIAMetaHeaderEntry)MetaHeaderEntries[i];
                    EndianSwapByteArray(entry.ID);
                    f.AddListItem(i, 8, "Module:", entry.ID, 0);
                }
                //f.AddListItem(i, 8, "Version:", entry.ID, 0);
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #19
0
        public void View(frmExplorer f, int view, object[] values)
        {
            //var i = values != null ? values[0] : -1;
            f.ClearInformation();
            switch ((CXIView)view)
            {
                case CXIView.NCCH:
                    f.SetGroupHeaders("Title", "Hash", "NCCH");
                    f.AddListItem(string.Empty, string.Empty, "Full Title (Name & Region)", string.Empty, TitleInfo.Title + " - " + TitleInfo.Region, 0);
                    f.AddListItem(string.Empty, string.Empty, "Title Type", string.Empty, TitleInfo.Type, 0);
                    f.AddListItem(string.Empty, string.Empty, "Publisher", string.Empty, TitleInfo.Developer, 0);

                    f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCCH header [SHA-256]", Header.NCCHHeaderSignature, 1);

                    f.AddListItem(0x100, 4, "Magic (='NCCH')", Header.Magic, 2);
                    f.AddListItem(0x104, 4, "NCCH length [medias]", Header.CXILength, 2);
                    f.AddListItem(0x108, 8, "Title ID", Header.TitleID, 2);
                    f.AddListItem(0x110, 2, "Maker Code", Header.MakerCode, 2);
                    f.AddListItem(0x112, 2, "Version", Header.Version, 2);
                    f.AddListItem(0x118, 8, "Program ID", Header.TitleID, 2);
                    f.AddListItem(0x120, 8, "Temp Flag", Header.TempFlag, 2);
                    f.AddListItem(0x124, 20, "Unknown 0_0", Header.Unknown0_0, 2);
                    f.AddListItem(0x144, 20, "Unknown 0_1", Header.Unknown0_1, 2);
                    f.AddListItem(0x150, 0x10, "Product Code", Header.ProductCode, 2);
                    f.AddListItem(0x160, 0x20, "Extended Header Hash", Header.ExtendedHeaderHash, 2);
                    f.AddListItem(0x180, 4, "Extended header size", Header.ExtendedHeaderSize, 2);
                    f.AddListItem(0x184, 4, "Unknown 1", Header.Unknown1, 2);
                    f.AddListItem(0x188, 4, "Unknown 2", Header.Unknown2, 2);
                    f.AddListItem(0x18C, 4, "Flags", Header.Flags, 2);
                    f.AddListItem(0x190, 4, "Plain region offset [medias]", Header.PlainRegionOffset, 2);
                    f.AddListItem(0x194, 4, "Plain region length [medias]", Header.PlainRegionSize, 2);
                    f.AddListItem(0x198, 4, "Unknown 3", Header.Unknown3, 2);
                    f.AddListItem(0x19C, 4, "Unknown 4", Header.Unknown4, 2);
                    f.AddListItem(0x1A0, 4, "ExeFS offset [medias]", Header.ExeFSOffset, 2);
                    f.AddListItem(0x1A4, 4, "ExeFS length [medias]", Header.ExeFSLength, 2);
                    f.AddListItem(0x1A8, 4, "ExeFS hash region length [medias]", Header.ExeFSHashRegionSize, 2);
                    f.AddListItem(0x1AC, 4, "Unknown 5", Header.Unknown5, 2);
                    f.AddListItem(0x1B0, 4, "RomFS offset [medias]", Header.RomFSOffset, 2);
                    f.AddListItem(0x1B4, 4, "RomFS length [medias]", Header.RomFSLength, 2);
                    f.AddListItem(0x1B8, 4, "RomFS hash region length [medias]", Header.RomFSHashRegionSize, 2);
                    f.AddListItem(0x1BC, 4, "Unknown 6", Header.Unknown6, 2);
                    f.AddListItem(0x1C0, 0x20, "ExeFS superblock hash", Header.ExeFSSuperBlockhash, 2);
                    f.AddListItem(0x1E0, 0x20, "RomFS superblock hash", Header.RomFSSuperBlockhash, 2);
                    break;
                case CXIView.NCCHPlainRegion:
                    f.SetGroupHeaders("Plain Regions");
                    for (var j = 0; j < PlainRegion.PlainRegionStrings.Length; j++)
                        f.AddListItem(0, 4, PlainRegion.PlainRegionStrings[j], (ulong)PlainRegion.PlainRegionStrings[j].Length, 0);
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #20
0
        public void View(frmExplorer f, int view, object[] values)
        {
            //var i = values != null ? (int)values[0] : -1;
            f.ClearInformation();
            switch ((CCIView)view)
            {
                case CCIView.NCSD:
                    f.SetGroupHeaders(NcsdInfo.ncsd_type + " Info","Signature", "NCSD Header", "Card Info Header", "Dev Card Info Header");

                    // CCI Details
                    f.AddListItem(string.Empty, string.Empty, "Media Type", NcsdInfo.MediaType,string.Empty, 0);
                    /*if (NcsdInfo.HasWritableRegion)
                    {
                        f.AddListItem(string.Empty, string.Empty, " > Writable Region Offset:", "0x" + NcsdInfo.WritableRegionAddress.ToString("X"), string.Empty, 0);
                        f.AddListItem(string.Empty, string.Empty, " > Writable Region Size:", "0x" + NcsdInfo.WritableRegionSize.ToString("X"), string.Empty, 0);
                    }*/
                    f.AddListItem(string.Empty, string.Empty, "Media Size", NcsdInfo.Media_Size_Str, NcsdInfo.Media_Size_Gbit.ToString("D") + " Gbit", 0);
                    f.AddListItem(string.Empty, string.Empty, "CCI Data Size", NcsdInfo.CCI_Data_Size_Str, "0x" + NcsdInfo.CCI_Data_Size.ToString("X") + " Bytes", 0);
                    f.AddListItem(string.Empty, string.Empty, "CCI File", string.Empty, string.Empty, 0);
                    f.AddListItem(string.Empty, string.Empty, " > Size:", NcsdInfo.CCI_File_Size_Str, string.Empty, 0);
                    f.AddListItem(string.Empty, string.Empty, " > Status:", NcsdInfo.CCI_File_Status_Str, string.Empty, 0);
                    f.AddListItem(string.Empty, string.Empty, "Card Device", NcsdInfo.CardDevice, string.Empty, 0);
                    f.AddListItem(string.Empty, string.Empty, "Save Crypto", NcsdInfo.SaveCrypto, string.Empty, 0);
                    if (Header.CVerTitleVersion > 0)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Minimum 3DS Firmware", NcsdInfo.Min3DSFirm, string.Empty, 0);
                    }

                    // Signature
                    f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCSD header [SHA-256]", Header.NCSDHeaderSignature, 1);

                    // NCSD Header
                    f.AddListItem(0x100, 4, "Magic (='NCSD')", Header.Magic, 2);
                    f.AddListItem(0x104, 4, "NCSD length [media units]", Header.CCILength, 2);
                    f.AddListItem(0x108, 8, "Main Title ID", Header.MainTitleID, 2);
                    f.AddListItem(0x110, 8, "Partitions FS Type", Header.PartitionFStype, 2);
                    f.AddListItem(0x118, 8, "Partitions Crypt Type", Header.PartitionCrypttype, 2);
                    for (var i = 0; i < 8; i++)
                    {
                        f.AddListItem(0x120 + i * 8, 4, "NCCH " + i + " offset [media units]", Header.CXIEntries[i].Offset, 2);
                        f.AddListItem(0x124 + i * 8, 4, "NCCH " + i + " length [media units]", Header.CXIEntries[i].Length, 2);
                    }
                    f.AddListItem(0x160, 0x20, "ExHeader Hash [SHA-256]", Header.ExHeaderHash, 2);
                    f.AddListItem(0x180, 4, "Additional Header Size [media units]", Header.AdditionalHeaderSize, 2);
                    f.AddListItem(0x184, 4, "Sector Zero Offset [media units]", Header.SectorZeroOffset, 2);
                    f.AddListItem(0x188, 8, NcsdInfo.ncsd_type + " Flags", Header.Flags, 2);
                    for (var i = 0; i < 8; i++)
                    {
                        f.AddListItem(0x190 + i * 8, 8, "NCCH " + i + " Title ID", Header.NCCHTitleIDs[i].ID, 2);
                    }
                    f.AddListItem(0x1D0, 0x30, "Reserved", Header.Reserved_0, 2);
                   

                    // Card Info Header
                    f.AddListItem(0x200, 4, "Writable Address [media units]", Header.WritableRegionAddress, 3);
                    f.AddListItem(0x204, 4, "Card Info Bitmask", Header.CardInfoBitmask, 3);
                    f.AddListItem(0x208, 248, "Reserved", Header.Reserved_1, 3);
                    f.AddListItem(0x300, 4, "Used ROM length [bytes]", Header.UsedRomLength, 3);
                    f.AddListItem(0x304, 28, "Reserved", Header.Reserved_2, 3);
                    f.AddListItem(0x320, 8, "CVer Title ID", Header.CVerTitleId, 3);
                    f.AddListItem(0x328, 2, "CVer Title Version", Header.CVerTitleVersion, 3);
                    f.AddListItem(0x32B, 28, "Reserved", Header.Reserved_3, 3);
                    f.AddListItem(0x1000, 8, "Media ID", Header.MediaID, 3);
                    f.AddListItem(0x1008, 8, "Reserved", Header.Reserved_4, 3);
                    f.AddListItem(0x1010, 0x30, "Initial Data", Header.InitialData, 3);
                    f.AddListItem(0x1040, 0xC0, "Reserved", Header.Reserved_5, 3);
                    // NCCH Header Duplicate of NCCH 0
                    /*
                    f.AddListItem(0x1100, 4, "Magic (='NCCH')", Header.cxi_Header.Magic, 3);
                    f.AddListItem(0x1104, 4, "NCCH length [media units]", Header.cxi_Header.CXILength, 3);
                    f.AddListItem(0x1108, 8, "Title ID", Header.cxi_Header.TitleID, 3);
                    f.AddListItem(0x1110, 2, "Maker Code", Header.cxi_Header.MakerCode, 3);
                    f.AddListItem(0x1112, 2, "NCCH Version", Header.cxi_Header.Version, 3);
                    f.AddListItem(0x1118, 8, "Program ID", Header.cxi_Header.ProgramID, 3);
                    f.AddListItem(0x1120, 0x10, "Reserved", Header.cxi_Header.Unknown0_0, 3);
                    f.AddListItem(0x1130, 0x20, "Logo Region Hash", Header.cxi_Header.LogoRegionHash, 3);
                    f.AddListItem(0x1150, 0x10, "Product Code", Header.cxi_Header.ProductCode, 3);
                    f.AddListItem(0x1160, 0x20, "Extended Header Hash", Header.cxi_Header.ExtendedHeaderHash, 3);
                    f.AddListItem(0x1180, 4, "Extended header size", Header.cxi_Header.ExtendedHeaderSize, 3);
                    f.AddListItem(0x1184, 4, "Reserved", Header.cxi_Header.Unknown1, 3);
                    f.AddListItem(0x1188, 8, "Flags", Header.cxi_Header.Flags, 3);
                    f.AddListItem(0x1190, 4, "Plain region offset [media units]", Header.cxi_Header.PlainRegionOffset, 3);
                    f.AddListItem(0x1194, 4, "Plain region length [media units]", Header.cxi_Header.PlainRegionSize, 3);
                    f.AddListItem(0x1198, 4, "Logo region offset [media units]", Header.cxi_Header.LogoRegionOffset, 3);
                    f.AddListItem(0x119C, 4, "Logo region length [media units]", Header.cxi_Header.LogoRegionLength, 3);
                    f.AddListItem(0x11A0, 4, "ExeFS offset [media units]", Header.cxi_Header.ExeFSOffset, 3);
                    f.AddListItem(0x11A4, 4, "ExeFS length [media units]", Header.cxi_Header.ExeFSLength, 3);
                    f.AddListItem(0x11A8, 4, "ExeFS hash region length [media units]", Header.cxi_Header.ExeFSHashRegionSize, 3);
                    f.AddListItem(0x11AC, 4, "Reserved", Header.cxi_Header.Unknown5, 3);
                    f.AddListItem(0x11B0, 4, "RomFS offset [media units]", Header.cxi_Header.RomFSOffset, 3);
                    f.AddListItem(0x11B4, 4, "RomFS length [media units]", Header.cxi_Header.RomFSLength, 3);
                    f.AddListItem(0x11B8, 4, "RomFS hash region length [media units]", Header.cxi_Header.RomFSHashRegionSize, 3);
                    f.AddListItem(0x11BC, 4, "Reserved", Header.cxi_Header.Unknown6, 3);
                    f.AddListItem(0x11C0, 0x20, "ExeFS SuperBlock hash [SHA-256]", Header.cxi_Header.ExeFSSuperBlockhash, 3);
                    f.AddListItem(0x11E0, 0x20, "RomFS SuperBlock hash [SHA-256]", Header.cxi_Header.RomFSSuperBlockhash, 3);
                    */
                    // Dev Card Info Header
                    if (Header.CardDeviceReserved1[0] != 0xff && Header.CardDeviceReserved1[10] != 0xff)
                    {
                        f.AddListItem(0x1200, 0x200, "CardDeviceReserved1", Header.CardDeviceReserved1, 4);
                        f.AddListItem(0x1400, 0x10, "TitleKey", Header.TitleKey, 4);
                        f.AddListItem(0x1410, 0xf0, "CardDeviceReserved2", Header.CardDeviceReserved2, 4);
                    }
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #21
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((CGFXView)view)
     {
         case CGFXView.CGFX:
             f.SetGroupHeaders("CGFX","DATA");
             f.AddListItem(0x00, 4, "Magic", Graphics.Magic, 0);
             f.AddListItem(0x04, 2, "Endianess", Graphics.Endianess, 0);
             f.AddListItem(0x06, 2, "DATA Offset", Graphics.DataOffset, 0);                            
             f.AddListItem(0x08, 4, "Unknown 0", Graphics.Unknown0, 0);
             f.AddListItem(0x0C, 4, "File Size", Graphics.FileSize, 0);
             f.AddListItem(0x10, 4, "Unknown 1", Graphics.Unknown1, 0);
             f.AddListItem(0x14, 4, "Magic", Graphics.DataBlob.Magic, 1);
             f.AddListItem(0x18, 4, "Length", Graphics.DataBlob.Length, 1);
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #22
0
 public void View(frmExplorer f, int view, object[] values)
 {
     //var i = values != null ? (int)values[0] : -1;
     f.ClearInformation();
     switch ((CCIView)view)
     {
         case CCIView.NCSD:
             f.SetGroupHeaders("Hash", "NCSD");
             f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCSD header [SHA-256]", Header.NCSDHeaderSignature, 0);
             f.AddListItem(0x100, 4, "Magic (='NCSD')", Header.Magic, 1);
             f.AddListItem(0x104, 4, "NCSD length [medias]", Header.CCILength, 1);
             f.AddListItem(0x108, 8, "Main Title ID", Header.MainTitleID, 1);
             f.AddListItem(0x110, 8, "Partitions FS Type", Header.PartitionFStype, 1);
             f.AddListItem(0x118, 8, "Partitions Crypt Type", Header.PartitionCrypttype, 1);
             for (var i = 0; i < 8; i++)
             {
                 f.AddListItem(0x120 + i * 8, 4, "NCCH " + i + " offset [medias]", Header.CXIEntries[i].Offset, 1);
                 f.AddListItem(0x124 + i * 8, 4, "NCCH " + i + " length [medias]", Header.CXIEntries[i].Length, 1);
             }
             f.AddListItem(0x160,40, "Unknown Zeros 0", Header.UnknownZeros0, 1);
             f.AddListItem(0x188, 8, "NCCH Flags", Header.CXIFlags, 1);
             for (var i = 0; i < 8; i++)
             {
                 f.AddListItem(0x190 + i * 8, 8, "NCCH " + i + " Title ID", Header.CXITitleIDs[i], 1);
             }
             f.AddListItem(0x1D0, 40, "Unknown Zeros 1", Header.UnknownZeros1, 1);
             f.AddListItem(0x1F8, 8, "Unknown 1", Header.Unknown1, 1);
             f.AddListItem(0x200, 4, "Always 0xFFFFFFFF", Header.PaddingFF, 1);
             f.AddListItem(0x204, 252, "Unknown 2", Header.Unknown2, 1);
             f.AddListItem(0x300, 4, "Used ROM length [bytes]", Header.UsedRomLength, 1);
             f.AddListItem(0x304, 28, "Unknown 3", Header.Unknown3, 1);
             f.AddListItem(0x320, 8, "Loader Title ID", Header.LoaderTitleId, 1);
             f.AddListItem(0x328, 8, "Loader Title Version", Header.LoaderTitleVersion, 1);
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #23
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((TMDView)view)
     {
         case TMDView.TMD:
             f.SetGroupHeaders("TMD");
             f.AddListItem(0, 4, "Signature Type", (ulong)SignatureType, 0);
             int off = 4;
             if (SignatureType == SignatureType.RSA_2048_SHA256 || SignatureType == SignatureType.RSA_2048_SHA1)
             {
                 f.AddListItem(off, 0x100, "RSA-2048 signature of the TMD", Hash, 0);
                 off += 0x100;
             }
             else
             {
                 f.AddListItem(off, 0x200, "RSA-4096 signature of the TMD", Hash, 0);
                 off += 0x200;
             }
             f.AddListItem(off, 60, "Reserved0", Head.Reserved0, 0);
             f.AddListItem(off + 60, 64, "Issuer", Head.Issuer, 0);
             f.AddListItem(off + 124, 4, "Version", Head.Version, 0);
             f.AddListItem(off + 128, 1, "Car Crl Version", Head.CarCrlVersion, 0);
             f.AddListItem(off + 129, 1, "Signer Version", Head.SignerVersion, 0);
             f.AddListItem(off + 130, 1, "Reserved1", Head.Reserved1, 0);
             f.AddListItem(off + 131, 8, "System Version", Head.SystemVersion, 0);
             f.AddListItem(off + 139, 8, "Title ID", Head.TitleID, 0);
             f.AddListItem(off + 147, 4, "Title Type", Head.TitleType, 0);
             f.AddListItem(off + 151, 2, "Group ID", Head.GroupID, 0);
             f.AddListItem(off + 153, 62, "Reserved2", Head.Reserved2, 0);
             f.AddListItem(off + 215, 4, "Access Rights", Head.AccessRights, 0);
             f.AddListItem(off + 219, 2, "Title Version", Head.TitleVersion, 0);
             f.AddListItem(off + 221, 2, "Content Count", Head.ContentCount, 0);
             f.AddListItem(off + 223, 2, "Boot Content", Head.BootContent, 0);
             f.AddListItem(off + 225, 2, "Padding", Head.Padding0, 0);
             f.AddListItem(off + 227, 32, "Content Info Records Hash", Head.ContentInfoRecordsHash, 0);
             break;
         case TMDView.ContentInfoRecord:
             f.SetGroupHeaders("TMD Content Records");
             for (var i = 0; i < 64; i++)
             {
                 f.AddListItem(i * 36, 2, "Content Command Count", ContentInfoRecords[i].ContentCommandCount, 0);
                 f.AddListItem(i * 36 + 2, 2, "Content Index Offset", ContentInfoRecords[i].ContentIndexOffset, 0);
                 f.AddListItem(i * 36 + 4, 32, "Next Content Hash", ContentInfoRecords[i].NextContentHash, 0);
             }
             break;
         case TMDView.ContentChunkRecord:
             f.SetGroupHeaders("TMD Content Chunks");
             for (var i = 0; i < Chunks.Length; i++)
             {
                 f.AddListItem(i, 4, "Content ID", Chunks[i].ContentID, 0);
                 f.AddListItem(0, 2, "Content Index", Chunks[i].ContentIndex, 0);
                 f.AddListItem(0, 2, "Content Type (=" + TypeToString(Chunks[i].ContentType) + ")", Chunks[i].ContentType, 0);
                 f.AddListItem(0, 8, "Content Size", Chunks[i].ContentSize, 0);
                 f.AddListItem(0, 32, "Content Hash", Chunks[i].ContentHash, 0);
             }
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #24
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((TMDView)view)
            {
            case TMDView.TMD:
                f.SetGroupHeaders("TMD");
                f.AddListItem(0, 4, "Signature Type", (ulong)SignatureType, 0);
                int off = 4;
                if (SignatureType == SignatureType.RSA_2048_SHA256 || SignatureType == SignatureType.RSA_2048_SHA1)
                {
                    f.AddListItem(off, 0x100, "RSA-2048 signature of the TMD", Hash, 0);
                    off += 0x100;
                }
                else
                {
                    f.AddListItem(off, 0x200, "RSA-4096 signature of the TMD", Hash, 0);
                    off += 0x200;
                }
                f.AddListItem(off, 60, "Reserved0", Head.Reserved0, 0);
                f.AddListItem(off + 60, 64, "Issuer", Head.Issuer, 0);
                f.AddListItem(off + 124, 4, "Version", Head.Version, 0);
                f.AddListItem(off + 128, 1, "Car Crl Version", Head.CarCrlVersion, 0);
                f.AddListItem(off + 129, 1, "Signer Version", Head.SignerVersion, 0);
                f.AddListItem(off + 130, 1, "Reserved1", Head.Reserved1, 0);
                f.AddListItem(off + 131, 8, "System Version", Head.SystemVersion, 0);
                f.AddListItem(off + 139, 8, "Title ID", Head.TitleID, 0);
                f.AddListItem(off + 147, 4, "Title Type", Head.TitleType, 0);
                f.AddListItem(off + 151, 2, "Group ID", Head.GroupID, 0);
                f.AddListItem(off + 153, 62, "Reserved2", Head.Reserved2, 0);
                f.AddListItem(off + 215, 4, "Access Rights", Head.AccessRights, 0);
                f.AddListItem(off + 219, 2, "Title Version", Head.TitleVersion, 0);
                f.AddListItem(off + 221, 2, "Content Count", Head.ContentCount, 0);
                f.AddListItem(off + 223, 2, "Boot Content", Head.BootContent, 0);
                f.AddListItem(off + 225, 2, "Padding", Head.Padding0, 0);
                f.AddListItem(off + 227, 32, "Content Info Records Hash", Head.ContentInfoRecordsHash, 0);
                break;

            case TMDView.ContentInfoRecord:
                f.SetGroupHeaders("TMD Content Records");
                for (var i = 0; i < 64; i++)
                {
                    f.AddListItem(i * 36, 2, "Content Command Count", ContentInfoRecords[i].ContentCommandCount, 0);
                    f.AddListItem(i * 36 + 2, 2, "Content Index Offset", ContentInfoRecords[i].ContentIndexOffset, 0);
                    f.AddListItem(i * 36 + 4, 32, "Next Content Hash", ContentInfoRecords[i].NextContentHash, 0);
                }
                break;

            case TMDView.ContentChunkRecord:
                f.SetGroupHeaders("TMD Content Chunks");
                for (var i = 0; i < Chunks.Length; i++)
                {
                    f.AddListItem(i, 4, "Content ID", Chunks[i].ContentID, 0);
                    f.AddListItem(0, 2, "Content Index", Chunks[i].ContentIndex, 0);
                    f.AddListItem(0, 2, "Content Type (=" + TypeToString(Chunks[i].ContentType) + ")", Chunks[i].ContentType, 0);
                    f.AddListItem(0, 8, "Content Size", Chunks[i].ContentSize, 0);
                    f.AddListItem(0, 32, "Content Hash", Chunks[i].ContentHash, 0);
                }
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #25
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((ICNView)view)
            {
            case ICNView.ICN:
                f.SetGroupHeaders("ICN", "Title Data", "Icons");
                string pubString, firString, secString;
                f.AddListItem(0, 4, "Magic (='SMDH')", Header.Magic, 0);
                f.AddListItem(4, 4, "Padding 0", Header.Padding0, 0);

                for (var i = 0; i < Header.Descriptions.Length; i++)
                {
                    pubString = Encoding.Unicode.GetString(Header.Descriptions[i].Publisher);
                    firString = Encoding.Unicode.GetString(Header.Descriptions[i].FirstTitle);
                    secString = Encoding.Unicode.GetString(Header.Descriptions[i].SecondTitle);
                    f.AddListItem(i.ToString(), ((Localization)i).ToString(), firString, secString, pubString, 1);
                }

                f.AddListItem(0x2040, 480, "Small Icon", 24, 2);
                f.AddListItem(0x24c0, 1200, "Large Icon", 48, 2);
                break;

            case ICNView.Data:
                f.SetGroupHeaders("Title Data", "Ratings", "Region Lockout", "Flags");
                f.AddListItem(0, 16, "Ratings*", DataHeader.Ratings, 0);
                f.AddListItem(16, 4, "Region Lockout*", DataHeader.Region, 0);
                f.AddListItem(20, 4, "MatchMaker ID", DataHeader.MatchMakerId, 0);
                f.AddListItem(24, 8, "MatchMaker Bit ID", DataHeader.MatchMakerBitId, 0);
                f.AddListItem(32, 4, "Flags*", DataHeader.Flags, 0);
                f.AddListItem("0x024", "2", "EULA Version", DataHeader.EULA_Ver_Major.ToString("D") + "." + DataHeader.EULA_Ver_Minor.ToString("D"), string.Empty, 0);
                f.AddListItem(38, 4, "Optimal Animation Default Frame", DataHeader.OptimalAnimationDefaultFrame, 0);
                f.AddListItem(42, 4, "CEC (StreetPass) ID", DataHeader.Cec, 0);


                if ((DataHeader.Region & (uint)RegionLockBitmask.Japan) == (uint)RegionLockBitmask.Japan)
                {
                    f.AddListItem(string.Empty, string.Empty, "Japan", "Yes", string.Empty, 2);
                }
                else
                {
                    f.AddListItem(string.Empty, string.Empty, "Japan", "No", string.Empty, 2);
                }
                if ((DataHeader.Region & (uint)RegionLockBitmask.USA) == (uint)RegionLockBitmask.USA)
                {
                    f.AddListItem(string.Empty, string.Empty, "North America", "Yes", string.Empty, 2);
                }
                else
                {
                    f.AddListItem(string.Empty, string.Empty, "North America", "No", string.Empty, 2);
                }
                if ((DataHeader.Region & (uint)RegionLockBitmask.Europe) == (uint)RegionLockBitmask.Europe)
                {
                    f.AddListItem(string.Empty, string.Empty, "Europe", "Yes", string.Empty, 2);
                }
                else
                {
                    f.AddListItem(string.Empty, string.Empty, "Europe", "No", string.Empty, 2);
                }
                if ((DataHeader.Region & (uint)RegionLockBitmask.Australia) == (uint)RegionLockBitmask.Australia)
                {
                    f.AddListItem(string.Empty, string.Empty, "Australia", "Yes", string.Empty, 2);
                }
                else
                {
                    f.AddListItem(string.Empty, string.Empty, "Australia", "No", string.Empty, 2);
                }
                if ((DataHeader.Region & (uint)RegionLockBitmask.China) == (uint)RegionLockBitmask.China)
                {
                    f.AddListItem(string.Empty, string.Empty, "China", "Yes", string.Empty, 2);
                }
                else
                {
                    f.AddListItem(string.Empty, string.Empty, "China", "No", string.Empty, 2);
                }
                if ((DataHeader.Region & (uint)RegionLockBitmask.Korea) == (uint)RegionLockBitmask.Korea)
                {
                    f.AddListItem(string.Empty, string.Empty, "Korea", "Yes", string.Empty, 2);
                }
                else
                {
                    f.AddListItem(string.Empty, string.Empty, "Korea", "No", string.Empty, 2);
                }
                if ((DataHeader.Region & (uint)RegionLockBitmask.Taiwan) == (uint)RegionLockBitmask.Taiwan)
                {
                    f.AddListItem(string.Empty, string.Empty, "Taiwan", "Yes", string.Empty, 2);
                }
                else
                {
                    f.AddListItem(string.Empty, string.Empty, "Taiwan", "No", string.Empty, 2);
                }

                f.AddListItem(0, 1, "CERO (Japan)", (byte)(DataHeader.Ratings[0] & 0x7F), 1);
                f.AddListItem(0, 1, "ESRB (North America)", (byte)(DataHeader.Ratings[1] & 0x7F), 1);
                f.AddListItem(0, 1, "USK (Germany)", (byte)(DataHeader.Ratings[3] & 0x7F), 1);
                f.AddListItem(0, 1, "PEGI (Europe)", (byte)(DataHeader.Ratings[4] & 0x7F), 1);
                f.AddListItem(0, 1, "PEGI (Portugal)", (byte)(DataHeader.Ratings[6] & 0x7F), 1);
                f.AddListItem(0, 1, "BBFC (England)", (byte)(DataHeader.Ratings[7] & 0x7F), 1);
                f.AddListItem(0, 1, "COB (Australia)", (byte)(DataHeader.Ratings[8] & 0x7F), 1);
                f.AddListItem(0, 1, "GRB (South Korea) ", (byte)(DataHeader.Ratings[9] & 0x7F), 1);
                f.AddListItem(0, 1, "CGSRR (China) ", (byte)(DataHeader.Ratings[10] & 0x7F), 1);
                f.AddListItem("", "", "Allow Stereoscopic 3D", (((uint)ICNDataFlags.AllowStereoscopic3D & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Require Accepting CTR Eula", (((uint)ICNDataFlags.RequireAcceptingCTREula & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Auto Save On Exit", (((uint)ICNDataFlags.AutoSaveOnExit & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Auto Boot", (((uint)ICNDataFlags.AutoBoot & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Using An External Banner", (((uint)ICNDataFlags.UsingAnExternalBanner & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Uses Save Data", (((uint)ICNDataFlags.UsesSaveData & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Uses Region Game Ratings", (((uint)ICNDataFlags.UsingGameRating & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Uses Icon Database", (((uint)ICNDataFlags.UseIconDatabase & DataHeader.Flags) > 0).ToString(), "", 3);
                f.AddListItem("", "", "Disable Savedata Backup", (((uint)ICNDataFlags.DisableSavedataBackup & DataHeader.Flags) > 0).ToString(), "", 3);
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #26
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((CIAView)view)
            {
                case CIAView.CIA:
                    var cia = Header;
                    f.SetGroupHeaders("CIA", "CIA Offsets");
                    f.AddListItem(0, 8, "Padding Length", cia.PaddingLength, 0);
                    f.AddListItem(8, 4, "Certificate Chain Length", cia.CertificateChainLength, 0);
                    f.AddListItem(12, 4, "Ticket Length", cia.TicketLength, 0);
                    f.AddListItem(16, 4, "TMD Length", cia.TMDLength, 0);
                    f.AddListItem(20, 4, "Meta Length", cia.MetaLength, 0);
                    f.AddListItem(24, 8, "Content Length", cia.ContentLength, 0);

                    f.AddListItem(0, 8, "Certificate Chain Offset", (ulong)CertificateChainOffset, 1);
                    f.AddListItem(0, 8, "Ticket Offset", (ulong)TicketOffset, 1);
                    f.AddListItem(0, 8, "TMD Offset", (ulong)TMDOffset, 1);
                    f.AddListItem(0, 8, "Content Offset", (ulong)ContentOffset, 1);
                    f.AddListItem(0, 8, "Meta Offset", (ulong)MetaOffset, 1);
                    break;
                case CIAView.Meta:
                    CIAMetaHeaderEntry entry;
                    f.SetGroupHeaders("CIA Meta");
                    for (var i = 0; i < MetaHeaderEntries.Count; i++)
                    {
                        entry = (CIAMetaHeaderEntry)MetaHeaderEntries[i];
                        f.AddListItem(i, 2, "Type " + entry.Type, entry.Index, 0);
                        f.AddListItem(i, 4, "Magic", entry.Magic, 0);
                    }
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #27
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((DARCView)view)
     {
         case DARCView.Header:
             f.SetGroupHeaders("DARC Header");
             f.AddListItem(0x000, 4, "Magic", Header.Magic, 0);
             f.AddListItem(0x004, 2, "Endianness", Header.Endianness, 0);
             f.AddListItem(0x006, 2, "Header's Length", Header.HeaderLength, 0);
             f.AddListItem(0x008, 4, "Version", Header.Version, 0);
             f.AddListItem(0x00C, 4, "File Length",Header.FileLength , 0);
             f.AddListItem(0x010, 4, "File Table Offset", Header.FileTableOffset, 0);
             f.AddListItem(0x014, 4, "File Table Length", Header.FileTableLength, 0);
             f.AddListItem(0x018, 4, "Files Data Offset", Header.FilesDataOffset, 0);
             break;
         case DARCView.FilesTable:
             f.SetGroupHeaders("Files");
             for (var i = 0; i < Files.Count; i++ )
             {
                 f.AddListItem(i, 1, " *** " + FileNames[i], 0, 0);
                 f.AddListItem(i, 2, "File's Name offset", Files[i].NameOffset, 0);
                 f.AddListItem(i, 1, "Parent", Files[i].Parent, 0);
                 f.AddListItem(i, 1, "Is folder", Files[i].Folder, 0);
                 f.AddListItem(i, 4, "File's offset", Files[i].Offset, 0);
                 f.AddListItem(i, 4, "File's length", Files[i].Length, 0);
             }
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #28
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((ICNView)view)
            {
                case ICNView.ICN:
                    f.SetGroupHeaders("ICN", "Title Data", "Icons");
                    string pubString, firString, secString;
                    f.AddListItem(0, 4, "Magic (='SMDH')", Header.Magic, 0);
                    f.AddListItem(4, 4, "Padding 0", Header.Padding0, 0);

                    for (var i = 0; i < Header.Descriptions.Length; i++)
                    {
                        pubString = Encoding.Unicode.GetString(Header.Descriptions[i].Publisher);
                        firString = Encoding.Unicode.GetString(Header.Descriptions[i].FirstTitle);
                        secString = Encoding.Unicode.GetString(Header.Descriptions[i].SecondTitle);
                        f.AddListItem(i.ToString(), ((Localization)i).ToString(), firString, secString, pubString, 1);
                    }

                    f.AddListItem(0x2040, 480, "Small Icon", 24, 2);
                    f.AddListItem(0x24c0, 1200, "Large Icon", 48, 2);
                    break;
                case ICNView.Data:
                    f.SetGroupHeaders("Title Data", "Ratings", "Region Lockout", "Flags");
                    f.AddListItem(0, 16, "Ratings*", DataHeader.Ratings, 0);
                    f.AddListItem(16, 4, "Region Lockout*", DataHeader.Region, 0);
                    f.AddListItem(20, 4, "MatchMaker ID", DataHeader.MatchMakerId, 0);
                    f.AddListItem(24, 8, "MatchMaker Bit ID", DataHeader.MatchMakerBitId, 0);
                    f.AddListItem(32, 4, "Flags*", DataHeader.Flags, 0);
                    f.AddListItem("0x024", "2", "EULA Version", DataHeader.EULA_Ver_Major.ToString("D") + "." + DataHeader.EULA_Ver_Minor.ToString("D"), string.Empty, 0);
                    f.AddListItem(38, 4, "Optimal Animation Default Frame", DataHeader.OptimalAnimationDefaultFrame, 0);
                    f.AddListItem(42, 4, "CEC (StreetPass) ID", DataHeader.Cec, 0);
                    
                    
                    if ((DataHeader.Region & (uint)RegionLockBitmask.Japan) == (uint)RegionLockBitmask.Japan)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Japan", "Yes", string.Empty, 2);
                    }
                    else 
                    {
                        f.AddListItem(string.Empty, string.Empty, "Japan", "No", string.Empty, 2);
                    }
                    if ((DataHeader.Region & (uint)RegionLockBitmask.USA) == (uint)RegionLockBitmask.USA)
                    {
                        f.AddListItem(string.Empty, string.Empty, "North America", "Yes", string.Empty, 2);
                    }
                    else
                    {
                        f.AddListItem(string.Empty, string.Empty, "North America", "No", string.Empty, 2);
                    }
                    if ((DataHeader.Region & (uint)RegionLockBitmask.Europe) == (uint)RegionLockBitmask.Europe)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Europe", "Yes", string.Empty, 2);
                    }
                    else
                    {
                        f.AddListItem(string.Empty, string.Empty, "Europe", "No", string.Empty, 2);
                    }
                    if ((DataHeader.Region & (uint)RegionLockBitmask.Australia) == (uint)RegionLockBitmask.Australia)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Australia", "Yes", string.Empty, 2);
                    }
                    else
                    {
                        f.AddListItem(string.Empty, string.Empty, "Australia", "No", string.Empty, 2);
                    }
                    if ((DataHeader.Region & (uint)RegionLockBitmask.China) == (uint)RegionLockBitmask.China)
                    {
                        f.AddListItem(string.Empty, string.Empty, "China", "Yes", string.Empty, 2);
                    }
                    else
                    {
                        f.AddListItem(string.Empty, string.Empty, "China", "No", string.Empty, 2);
                    }
                    if ((DataHeader.Region & (uint)RegionLockBitmask.Korea) == (uint)RegionLockBitmask.Korea)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Korea", "Yes", string.Empty, 2);
                    }
                    else
                    {
                        f.AddListItem(string.Empty, string.Empty, "Korea", "No", string.Empty, 2);
                    }
                    if ((DataHeader.Region & (uint)RegionLockBitmask.Taiwan) == (uint)RegionLockBitmask.Taiwan)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Taiwan", "Yes", string.Empty, 2);
                    }
                    else
                    {
                        f.AddListItem(string.Empty, string.Empty, "Taiwan", "No", string.Empty, 2);
                    }
                    
                    f.AddListItem(0, 1, "CERO (Japan)", (byte)(DataHeader.Ratings[0] & 0x7F), 1);
                    f.AddListItem(0, 1, "ESRB (North America)", (byte)(DataHeader.Ratings[1] & 0x7F), 1);
                    f.AddListItem(0, 1, "USK (Germany)", (byte)(DataHeader.Ratings[3] & 0x7F), 1);
                    f.AddListItem(0, 1, "PEGI (Europe)", (byte)(DataHeader.Ratings[4] & 0x7F), 1);
                    f.AddListItem(0, 1, "PEGI (Portugal)", (byte)(DataHeader.Ratings[6] & 0x7F), 1);
                    f.AddListItem(0, 1, "BBFC (England)", (byte)(DataHeader.Ratings[7] & 0x7F), 1);
                    f.AddListItem(0, 1, "COB (Australia)", (byte)(DataHeader.Ratings[8] & 0x7F), 1);
                    f.AddListItem(0, 1, "GRB (South Korea) ", (byte)(DataHeader.Ratings[9] & 0x7F), 1);
                    f.AddListItem(0, 1, "CGSRR (China) ", (byte)(DataHeader.Ratings[10] & 0x7F), 1);
                    f.AddListItem("", "", "Allow Stereoscopic 3D", (((uint)ICNDataFlags.AllowStereoscopic3D & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Require Accepting CTR Eula", (((uint)ICNDataFlags.RequireAcceptingCTREula & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Auto Save On Exit", (((uint)ICNDataFlags.AutoSaveOnExit & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Auto Boot", (((uint)ICNDataFlags.AutoBoot & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Using An External Banner", (((uint)ICNDataFlags.UsingAnExternalBanner & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Uses Save Data", (((uint)ICNDataFlags.UsesSaveData & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Uses Region Game Ratings", (((uint)ICNDataFlags.UsingGameRating & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Uses Icon Database", (((uint)ICNDataFlags.UseIconDatabase & DataHeader.Flags) > 0).ToString(), "", 3);
                    f.AddListItem("", "", "Disable Savedata Backup", (((uint)ICNDataFlags.DisableSavedataBackup & DataHeader.Flags) > 0).ToString(), "", 3);
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #29
0
 public void View(frmExplorer f, int view, object[] values)
 {
     var i = (int) values[0];
     f.ClearInformation();
     if (i < 0)
     {
         f.SetGroupHeaders("Certificates");
         f.AddListItem(0, 4, "Certificate Count", (ulong)List.Count, 0);
     }
     else
     {
         var entry = (CertificateEntry)List[i];
         var cert = entry.Certificate;
         f.SetGroupHeaders("Certificate");
         f.AddListItem(0, 4, "Signature Type", (ulong)entry.SignatureType, 0);
         int off = 4;
         if (entry.SignatureType == SignatureType.RSA_2048_SHA256 || entry.SignatureType == SignatureType.RSA_2048_SHA1)
         {
             f.AddListItem(off, 0x100, "RSA-2048 signature of the content", entry.Signature, 0);
             off += 0x100;
         }
         else
         {
             f.AddListItem(off, 0x200, "RSA-4096 signature of the content", entry.Signature, 0);
             off += 0x200;
         }
         f.AddListItem(off, 60, "Reserved0", cert.Reserved0, 0);
         f.AddListItem(off + 60, 64, "Issuer", cert.Issuer, 0);
         f.AddListItem(off + 124, 4, "Tag", cert.Tag, 0);
         f.AddListItem(off + 128, 64, "Name", cert.Name, 0);
         f.AddListItem(off + 292, 0x104, "Key", cert.Key, 0);
         f.AddListItem(off + 552, 2, "Unknown0", cert.Unknown1, 0);
         f.AddListItem(off + 554, 2, "Unknown1", cert.Unknown2, 0);
         f.AddListItem(off + 556, 52, "Padding", cert.Padding, 0);
     }
     f.AutoAlignColumns();
 }
Beispiel #30
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((MPOView)view)
            {
            case MPOView.MPO:
                break;

            case MPOView.Image:

                var propItems = (int)values[0] == 0 ? LeftImage.PropertyItems : RightImage.PropertyItems;

                string tempString;
                foreach (var propItem in propItems)
                {
                    switch (propItem.Id)
                    {
                    case 0x1000:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "InteroperabilityVersion",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x010f:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "Manufacturer",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x0110:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "Camera",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x011a:
                        tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                        f.AddListItem(propItem.Id, 8, "XResolution",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x011b:
                        tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                        f.AddListItem(propItem.Id, 8, "YResolution",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x0128:
                        f.AddListItem(propItem.Id, 2, "ResolutionUnit", BitConverter.ToUInt16(propItem.Value, 0), 0);
                        break;

                    case 0x0131:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "Software",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x0132:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "DateTime",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x0201:
                        f.AddListItem(propItem.Id, 4, "JPEGInterchangeFormat", BitConverter.ToUInt32(propItem.Value, 0), 0);
                        break;

                    case 0x0202:
                        f.AddListItem(propItem.Id, 4, "JPEGInterchangeFormatLength", BitConverter.ToUInt32(propItem.Value, 0), 0);
                        break;

                    case 0x0213:
                        f.AddListItem(propItem.Id, 2, "YCbCrPositioning", BitConverter.ToUInt16(propItem.Value, 0), 0);
                        break;

                    case 0x501b:
                        f.AddListItem(propItem.Id, propItem.Value.Length, "ThumbnailData", propItem.Value, 0);
                        break;

                    case 0x5023:
                        f.AddListItem(propItem.Id, 2, "ThumbnailCompression", BitConverter.ToUInt16(propItem.Value, 0), 0);
                        break;

                    case 0x502d:
                        tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                        f.AddListItem(propItem.Id, 8, "ThumbnailXResolution",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x502e:
                        tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                        f.AddListItem(propItem.Id, 8, "ThumbnailYResolution",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x5030:
                        f.AddListItem(propItem.Id, 2, "ThumbnailTransferFunction", BitConverter.ToUInt16(propItem.Value, 0), 0);
                        break;

                    case 0x5041:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "InteroperabilityIndex",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x5042:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "ExifInteroperabilityVersion",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x5090:
                        f.AddListItem(propItem.Id, propItem.Value.Length, "LuminanceTable", propItem.Value, 0);
                        break;

                    case 0x5091:
                        f.AddListItem(propItem.Id, propItem.Value.Length, "ChrominanceTable", propItem.Value, 0);
                        break;

                    case 0x9000:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "ExifVersion",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x9003:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "DateTimeOriginal",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x9004:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "DateTimeDigitized",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0x9101:
                        f.AddListItem(propItem.Id, propItem.Value.Length, "ComponentsConfiguration", propItem.Value, 0);
                        break;

                    case 0x927c:
                        f.AddListItem(propItem.Id, propItem.Value.Length, "MakerNote", propItem.Value, 0);
                        break;

                    case 0xa000:
                        tempString = Encoding.UTF8.GetString(propItem.Value);
                        f.AddListItem(propItem.Id, tempString.Length, "FlashPixVersion",
                                      tempString.ToCharArray(), 0);
                        break;

                    case 0xa001:
                        f.AddListItem(propItem.Id, 2, "ColorSpace", BitConverter.ToUInt16(propItem.Value, 0), 0);
                        break;

                    case 0xa002:
                        f.AddListItem(propItem.Id, 4, "PixelXDimension", BitConverter.ToUInt32(propItem.Value, 0), 0);
                        break;

                    case 0xa003:
                        f.AddListItem(propItem.Id, 4, "PixelYDimension", BitConverter.ToUInt32(propItem.Value, 0), 0);
                        break;

                    default:
                        f.AddListItem(propItem.Id, propItem.Value.Length, "<Unknown>", propItem.Value, 0);
                        break;
                    }
                }
                break;

            case MPOView.MPOExtensions:
                break;

            case MPOView.MakerNote:
                f.SetGroupHeaders("IFD", "First IFD", "Nintendo MarkerNote");
                if (_ifds != null)
                {
                    f.AddListItem(0, 2, "IFD Count", (uint)_ifds.Length, 0);
                    for (var i = 0; i < _ifds.Length; i++)
                    {
                        f.AddListItem((2 + i * 12).ToString(), "12", "IFD", "Tag = " + _ifds[i].Tag.ToString("X4"),
                                      string.Format("Type={0}, Count/Value={1}, Value/Offset={2}", _ifds[i].Type,
                                                    _ifds[i].CountValue, _ifds[i].ValueOffset), 0);
                    }

                    f.AddListItem(0, _firstIFDData.Length, "First IFD data", _firstIFDData, 1);
                }
                f.AddListItem(0, 4, "Magic", _nintendoNote.Magic, 2);
                f.AddListItem(4, 4, "Type", _nintendoNote.Type, 2);
                f.AddListItem(8, 4, "Time stamp", _nintendoNote.TimeStamp, 2);
                f.AddListItem("", "", "", "", (new DateTime(2000, 1, 1, 0, 0, 0)).AddSeconds(_nintendoNote.TimeStamp).ToString(), 2);
                f.AddListItem(12, 4, "Padding 0", _nintendoNote.Padding0, 2);
                f.AddListItem(16, 4, "Title ID Low", _nintendoNote.TitleIDLow, 2);
                f.AddListItem(20, 4, "Flags", _nintendoNote.Flags, 2);
                f.AddListItem(24, 4, "Console ID", _nintendoNote.ConsoleID, 2);
                f.AddListItem(28, 12, "Padding 1", _nintendoNote.Padding1, 2);
                f.AddListItem(40, 4, "Parallax", _nintendoNote.Parallax, 2);
                f.AddListItem(44, 4, "Padding 2", _nintendoNote.Padding2, 2);
                f.AddListItem(48, 2, "Categories", _nintendoNote.Categories, 2);
                f.AddListItem(50, 2, "Filters", _nintendoNote.Filters, 2);
                f.AddListItem(52, 12, "Padding 3", _nintendoNote.Padding3, 2);
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #31
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((SaveFlashView)view)
            {
                case SaveFlashView.Image:
                    f.SetGroupHeaders("SaveFlash", "Image");
                    f.AddListItem(0x000, 4, "Unknown 1", FileHeader.Unknown1, 0);
                    f.AddListItem(0x004, 4, "Unknown 2", FileHeader.Unknown2, 0);
                    f.AddListItem(0, 4, "** Blockmap length", (ulong)Blockmap.Length, 0);
                    f.AddListItem(0, 4, "** Journal size", JournalSize, 0);
                    f.AddListItem(0, 0x10, "** Image Hash", ImageHash, 1);
                    f.AddListItem(0x000, 4, "Magic DISA", Disa.Magic, 1);
                    f.AddListItem(0x004, 4, "Magic Number", Disa.Unknown0, 1);
                    f.AddListItem(0x008, 8, "Table Size", Disa.TableSize, 1);
                    f.AddListItem(0x010, 8, "Primary Table offset", Disa.PrimaryTableOffset, 1);
                    f.AddListItem(0x018, 8, "Secondary Table offset", Disa.SecondaryTableOffset, 1);
                    f.AddListItem(0x020, 8, "Table Length", Disa.TableLength, 1);
                    f.AddListItem(0x028, 8, "SAVE Entry Table offset", Disa.SAVEEntryOffset, 1);
                    f.AddListItem(0x030, 8, "SAVE Entry Table length", Disa.SAVEEntryLength, 1);
                    f.AddListItem(0x038, 8, "DATA Entry Table offset", Disa.DATAEntryOffset, 1);
                    f.AddListItem(0x040, 8, "DATA Entry Table length", Disa.DATAEntryLength, 1);
                    f.AddListItem(0x048, 8, "SAVE Partition Offset", Disa.SAVEPartitionOffset, 1);
                    f.AddListItem(0x050, 8, "SAVE Partition Length", Disa.SAVEPartitionLength, 1);
                    f.AddListItem(0x058, 8, "DATA Partition Offset", Disa.DATAPartitionOffset, 1);
                    f.AddListItem(0x060, 8, "DATA Partition Length", Disa.DATAPartitionLength, 1);
                    f.AddListItem(0x068, 4, "Active Table is " + ((Disa.ActiveTable & 1) == 1 ? "Primary" : "Secondary"), Disa.ActiveTable, 1);
                    f.AddListItem(0x06C, 0x20, "Hash", Disa.Hash, 1);
                    f.AddListItem(0x08C, 4, "Zero Padding 0(to 8 bytes)", Disa.ZeroPad0, 1);
                    f.AddListItem(0x090, 4, "Flag 0 ?", Disa.Flag0, 1);
                    f.AddListItem(0x094, 4, "Zero Padding 1(to 8 bytes)", Disa.ZeroPad1, 1);
                    f.AddListItem(0x098, 4, "Unknown 1", Disa.Unknown1, 1);
                    f.AddListItem(0x09C, 4, "Unknown 2 (Magic?)", Disa.Unknown2, 1);
                    f.AddListItem(0x0A0, 8, "Data FS Length", Disa.DataFsLength, 1);
                    f.AddListItem(0x0A8, 8, "Unknown 3", Disa.Unknown3, 1);
                    f.AddListItem(0x0B0, 4, "Unknown 4", Disa.Unknown4, 1);
                    f.AddListItem(0x0B4, 4, "Unknown 5", Disa.Unknown5, 1);
                    f.AddListItem(0x0B8, 4, "Unknown 6", Disa.Unknown6, 1);
                    f.AddListItem(0x0BC, 4, "Unknown 7", Disa.Unknown7, 1);
                    f.AddListItem(0x0C0, 4, "Unknown 8", Disa.Unknown8, 1);
                    f.AddListItem(0x0C4, 4, "Flag 1 ?", Disa.Flag1, 1);
                    f.AddListItem(0x0C8, 4, "Flag 2 ?", Disa.Flag2, 1);
                    f.AddListItem(0x0CC, 4, "Flag 3 ?", Disa.Flag3, 1);
                    f.AddListItem(0x0D0, 4, "Flag 4 ?", Disa.Flag4, 1);
                    f.AddListItem(0x0D4, 4, "Unknown 14", Disa.Unknown14, 1);
                    f.AddListItem(0x0D8, 4, "Flag 5 ?", Disa.Flag5, 1);
                    f.AddListItem(0x0DC, 4, "Unknown 16", Disa.Unknown16, 1);
                    f.AddListItem(0x0E0, 4, "Magic 17", Disa.Magic17, 1);
                    f.AddListItem(0x0E4, 4, "Unknown 18", Disa.Unknown18, 1);
                    f.AddListItem(0x0E8, 4, "Flag 6 ?", Disa.Flag6, 1);
                    f.AddListItem(0x0EC, 4, "Flag 7 ?", Disa.Flag7, 1);
                    f.AddListItem(0x0F0, 4, "Flag 8 ?", Disa.Flag8, 1);
                    f.AddListItem(0x0F4, 4, "Unknown 21", Disa.Unknown21, 1);
                    f.AddListItem(0x0F8, 4, "Unknown 22", Disa.Unknown22, 1);
                    f.AddListItem(0x0FC, 4, "Unknown 23", Disa.Unknown23, 1);
                    break;
                case SaveFlashView.Partition:
                    var j = (int) values[0];
                    var difi = Partitions[j].Difi;
                    var ivfc = Partitions[j].Ivfc;
                    var dpfs = Partitions[j].Dpfs;
                    var save = Save;

                    f.SetGroupHeaders("DIFI", "IVFC", "DPFS", "Hash", "SAVE", "Folders", "Files");
                    f.AddListItem(0x000, 4, "Magic DIFI", difi.Magic, 0);
                    f.AddListItem(0x004, 4, "Magic Number", difi.MagicPadding, 0);
                    f.AddListItem(0x008, 8, "IVFC Offset", difi.IVFCOffset, 0);
                    f.AddListItem(0x010, 8, "IVFC Size", difi.IVFCSize, 0);
                    f.AddListItem(0x018, 8, "DPFS Offset", difi.DPFSOffset, 0);
                    f.AddListItem(0x020, 8, "DPFS Size", difi.DPFSSize, 0);
                    f.AddListItem(0x028, 8, "Hash Offset", difi.HashOffset, 0);
                    f.AddListItem(0x030, 8, "Hash Size", difi.HashSize, 0);
                    f.AddListItem(0x038, 4, "Flags", difi.Flags, 0);
                    f.AddListItem(0x03C, 8, "File Base (for DATA partitions)", difi.FileBase, 0);

                    f.AddListItem(0x000, 4, "Magic IVFC", ivfc.Magic, 1);
                    f.AddListItem(0x004, 4, "Magic Number", ivfc.MagicPadding, 1);
                    f.AddListItem(0x008, 8, "Unknown 1", ivfc.Unknown1, 1);
                    f.AddListItem(0x010, 8, "FirstHash Offset", ivfc.FirstHashOffset, 1);
                    f.AddListItem(0x018, 8, "FirstHash Length", ivfc.FirstHashLength, 1);
                    f.AddListItem(0x020, 8, "FirstHash Block" + " (=" + (1 << (int)ivfc.FirstHashBlock) + ")", ivfc.FirstHashBlock, 1);
                    f.AddListItem(0x028, 8, "SecondHash Offset", ivfc.SecondHashOffset, 1);
                    f.AddListItem(0x030, 8, "SecondHash Length", ivfc.SecondHashLength, 1);
                    f.AddListItem(0x038, 8, "SecondHash Block" + " (=" + (1 << (int)ivfc.SecondHashBlock) + ")", ivfc.SecondHashBlock, 1);
                    f.AddListItem(0x040, 8, "HashTable Offset", ivfc.HashTableOffset, 1);
                    f.AddListItem(0x048, 8, "HashTable Length", ivfc.HashTableLength, 1);
                    f.AddListItem(0x050, 8, "HashTable Block" + " (=" + (1 << (int)ivfc.HashTableBlock) + ")", ivfc.HashTableBlock, 1);
                    f.AddListItem(0x058, 8, "FileSystem Offset", ivfc.FileSystemOffset, 1);
                    f.AddListItem(0x060, 8, "FileSystem Length", ivfc.FileSystemLength, 1);
                    f.AddListItem(0x068, 8, "FileSystem Block" + " (=" + (1 << (int)ivfc.FileSystemBlock) + ")", ivfc.FileSystemBlock, 1);
                    f.AddListItem(0x070, 8, "Unknown 3 (?=0x78)", ivfc.Unknown3, 1);

                    f.AddListItem(0x000, 4, "Magic DPFS", dpfs.Magic, 2);
                    f.AddListItem(0x004, 4, "Magic Number", dpfs.MagicPadding, 2);
                    f.AddListItem(0x008, 8, "First Table Offset", dpfs.FirstTableOffset, 2);
                    f.AddListItem(0x010, 8, "First Table Length", dpfs.FirstTableLength, 2);
                    f.AddListItem(0x018, 8, "First Table Block", dpfs.FirstTableBlock, 2);
                    f.AddListItem(0x020, 8, "Second Table Offset", dpfs.SecondTableOffset, 2);
                    f.AddListItem(0x028, 8, "Second Table Length", dpfs.SecondTableLength, 2);
                    f.AddListItem(0x030, 8, "Second Table Block", dpfs.SecondTableBlock, 2);
                    f.AddListItem(0x038, 8, "Offset to Data", dpfs.OffsetToData, 2);
                    f.AddListItem(0x040, 8, "Data Length", dpfs.DataLength, 2);
                    f.AddListItem(0x048, 8, "Data Block", dpfs.DataBlock, 2);

#if DEBUG
            f.AddListItem(0x000, 4, "* First Flag", Partitions[j].FirstFlag, 2);
            f.AddListItem(0x000, 4, "* First Flag Dupe", Partitions[j].FirstFlagDupe,2);
            f.AddListItem(0x000, 4, "* Second Flag", Partitions[j].SecondFlag, 2);
            f.AddListItem(0x000, 4, "* Second Flag Dupe", Partitions[j].SecondFlagDupe, 2);
#endif

                    f.AddListItem(0x000, 0x20, "Hash", Partitions[j].Hash, 3);

                    if (j == 0)
                    {
                        f.AddListItem(0x000, 4, "Magic SAVE", save.Magic, 4);
                        f.AddListItem(0x004, 4, "Magic Number", save.MagicPadding, 4);
                        f.AddListItem(0x008, 8, "Unknown 1 (?=0x020)", save.Unknown1, 4);
                        f.AddListItem(0x010, 8, "Size of data Partition [medias]", save.PartitionSize, 4);
                        f.AddListItem(0x018, 4, "Partition Media Size", save.PartitionMediaSize, 4);
                        f.AddListItem(0x01C, 8, "Unknown 3 (?=0x000)", save.Unknown3, 4);
                        f.AddListItem(0x024, 4, "Unknown 4 (?=0x200)", save.Unknown4, 4);
                        f.AddListItem(0x028, 8, "File Map Offset", save.FileMapOffset, 4);
                        f.AddListItem(0x030, 4, "File Map Size", save.FileMapSize, 4);
                        f.AddListItem(0x034, 4, "File Map MediaSize", save.FileMapMediaSize, 4);
                        f.AddListItem(0x038, 8, "Folder Map Offset", save.FolderMapOffset, 4);
                        f.AddListItem(0x040, 4, "Folder Map Size", save.FolderMapSize, 4);
                        f.AddListItem(0x044, 4, "Folder Map Media Size", save.FolderMapMediaSize, 4);
                        f.AddListItem(0x048, 8, "Block Map Offset", save.BlockMapOffset, 4);
                        f.AddListItem(0x050, 4, "Block Map Size", save.BlockMapSize, 4);
                        f.AddListItem(0x054, 4, "Block Map Media Size", save.BlockMapMediaSize, 4);
                        f.AddListItem(0x058, 8, "Filestore Offset (from SAVE)", save.FileStoreOffset, 4);
                        f.AddListItem(0x060, 4, "Filestore Length (medias)", save.FileStoreLength, 4);
                        f.AddListItem(0x064, 4, "Filestore Media", save.FileStoreMedia, 4);
                        f.AddListItem(0x068, 4, "Folders Table offset (medias/exact)", save.FolderTableOffset, 4);
                        f.AddListItem(0x06C, 4, "Folders Table Length (medias)", save.FolderTableLength, 4);
                        f.AddListItem(0x070, 4, "Folders Table Unknown", save.FolderTableUnknown, 4);
                        f.AddListItem(0x074, 4, "Folders Table Media Size", save.FolderTableMedia, 4);
                        f.AddListItem(0x078, 4, "Files Table Offset (medias/exact)", save.FSTOffset, 4);
                        f.AddListItem(0x07C, 4, "Files Table Length", save.FSTLength, 4);
                        f.AddListItem(0x080, 4, "Files Table Unknown", save.FSTUnknown, 4);
                        f.AddListItem(0x084, 4, "Files Table Media Size", save.FSTMedia, 4);

                        if (IsSaveMagic(save.Magic))
                        {
                            var i = 1;
                            foreach (var fse in Folders)
                                f.AddListItem(i++.ToString(),
                                            fse.Index.ToString(),
                                            StringUtil.CharArrayToString(fse.FolderName),
                                            fse.ParentFolderIndex.ToString(),
                                            StringUtil.ToHexString(8, fse.LastFileIndex),
                                            5);
                            i = 1;
                            foreach (var fse in Files)
                                f.AddListItem(i++.ToString(),
                                            fse.BlockOffset.ToString(),
                                            "[" + fse.Index + "] " + StringUtil.CharArrayToString(fse.Filename) + ", (" + fse.FileSize + "b)",
                                            fse.ParentFolderIndex.ToString(),
                                            StringUtil.ToHexString(8, fse.Unknown2) + " " + StringUtil.ToHexString(8, fse.Magic),
                                            6);
                        }
                    }
                    break;
                case SaveFlashView.Tables:
                    f.SetGroupHeaders("Files", "Folders", "Unknown");
                    if (IsSaveMagic(Save.Magic))
                    {
                        for (var i = 0; i < FilesMap.Length; i++)
                            f.AddListItem(i, 4, "UInt32", FilesMap[i], 0);
                        for (var i = 0; i < FoldersMap.Length; i++)
                            f.AddListItem(i, 4, "UInt32", FoldersMap[i], 1);

                        f.AddListItem("", "", "Start", "Start:" + (BlockMap[0].StartBlock & 0xff) + ", End: " + (BlockMap[0].EndBlock & 0xff), "Start:" + BlockMap[0].StartBlock.ToString("X8") + ", End: " + BlockMap[0].EndBlock.ToString("X8"), 2);
                        for (var i = 1; i < BlockMap.Length - 1; i++)
                            f.AddListItem("", (i - 1).ToString(), "Block " + i + (BlockMap[i].EndBlock == 0x80000000 && BlockMap[i].StartBlock == 0x80000000 ? " (Start of data)" : ""), "Start:" + (BlockMap[i].StartBlock & 0xff) + ", End: " + (BlockMap[i].EndBlock & 0xff), "Start:" + BlockMap[i].StartBlock.ToString("X8") + ", End: " + BlockMap[i].EndBlock.ToString("X8"), 2);
                        f.AddListItem("", "", "End", "", "Start:" + (BlockMap[BlockMap.Length - 1].StartBlock & 0xff) + ", End: " + (BlockMap[BlockMap.Length - 1].EndBlock & 0xff), 2);
                    }
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #32
0
        public void View(frmExplorer f, int view, object[] values)
        {
            //var i = values != null ? values[0] : -1;
            f.ClearInformation();
            switch ((CXIView)view)
            {
            case CXIView.NCCH:
                int mod = 0;
                if (!NcchInfo.IsCfa)
                {
                    f.SetGroupHeaders("Title", NcchInfo.ncch_type + " Details", "Signature", "NCCH Header");
                    f.AddListItem(string.Empty, string.Empty, "Full Title (Name & Region)", string.Empty, TitleInfo.Title + " - " + TitleInfo.Region, 0);
                    f.AddListItem(string.Empty, string.Empty, "Title Type", string.Empty, TitleInfo.Type, 0);
                    f.AddListItem(string.Empty, string.Empty, "Publisher", string.Empty, TitleInfo.Developer, 0);
                }
                else
                {
                    f.SetGroupHeaders(NcchInfo.ncch_type + " Details", "Signature", "NCCH Header");
                    mod = 1;
                }


                f.AddListItem(string.Empty, string.Empty, "Content Type", string.Empty, NcchInfo.content_type_str, 1 - mod);
                f.AddListItem(string.Empty, string.Empty, "Unique ID", string.Empty, "0x" + NcchInfo.UniqueID.ToString("X"), 1 - mod);
                f.AddListItem(string.Empty, string.Empty, "Crypto Key", string.Empty, NcchInfo.encryption, 1 - mod);
                f.AddListItem(string.Empty, string.Empty, NcchInfo.ncch_type + " Size", string.Empty, NcchInfo.ncch_size_str, 1 - mod);
                if (!NcchInfo.IsCfa)
                {
                    if (NcchInfo.sdk_build != null)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Build Type", string.Empty, NcchInfo.sdk_build, 1);
                    }
                    if (NcchInfo.sdk_version != null)
                    {
                        f.AddListItem(string.Empty, string.Empty, "SDK Version", string.Empty, NcchInfo.sdk_version, 1);
                    }
                    if (NcchInfo.req_kernel != null)
                    {
                        f.AddListItem(string.Empty, string.Empty, "Required Kernel Version", string.Empty, NcchInfo.req_kernel, 1);
                    }
                }


                f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCCH header [SHA-256]", Header.NCCHHeaderSignature, 2 - mod);

                f.AddListItem(0x100, 4, "Magic (='NCCH')", Header.Magic, 3 - mod);
                f.AddListItem(0x104, 4, NcchInfo.ncch_type + " length [media units]", Header.CXILength, 3 - mod);
                f.AddListItem(0x108, 8, "Title ID", Header.TitleID, 3 - mod);
                f.AddListItem(0x110, 2, "Maker Code", Header.MakerCode, 3 - mod);
                f.AddListItem(0x112, 2, NcchInfo.ncch_type + " Version", Header.Version, 3 - mod);
                f.AddListItem(0x118, 8, "Program ID", Header.ProgramID, 3 - mod);
                f.AddListItem(0x120, 0x10, "Reserved", Header.Unknown0_0, 3 - mod);
                f.AddListItem(0x130, 0x20, "Logo Region Hash", Header.LogoRegionHash, 3 - mod);
                f.AddListItem(0x150, 0x10, "Product Code", Header.ProductCode, 3 - mod);
                f.AddListItem(0x160, 0x20, "Extended Header Hash", Header.ExtendedHeaderHash, 3 - mod);
                f.AddListItem(0x180, 4, "Extended header size", Header.ExtendedHeaderSize, 3 - mod);
                f.AddListItem(0x184, 4, "Reserved", Header.Unknown1, 3 - mod);
                f.AddListItem(0x188, 8, "Flags", Header.Flags, 3 - mod);
                f.AddListItem(0x190, 4, "Plain region offset [media units]", Header.PlainRegionOffset, 3 - mod);
                f.AddListItem(0x194, 4, "Plain region length [media units]", Header.PlainRegionSize, 3 - mod);
                f.AddListItem(0x198, 4, "Logo region offset [media units]", Header.LogoRegionOffset, 3 - mod);
                f.AddListItem(0x19C, 4, "Logo region length [media units]", Header.LogoRegionLength, 3 - mod);
                f.AddListItem(0x1A0, 4, "ExeFS offset [media units]", Header.ExeFSOffset, 3 - mod);
                f.AddListItem(0x1A4, 4, "ExeFS length [media units]", Header.ExeFSLength, 3 - mod);
                f.AddListItem(0x1A8, 4, "ExeFS hash region length [media units]", Header.ExeFSHashRegionSize, 3 - mod);
                f.AddListItem(0x1AC, 4, "Reserved", Header.Unknown5, 3 - mod);
                f.AddListItem(0x1B0, 4, "RomFS offset [media units]", Header.RomFSOffset, 3 - mod);
                f.AddListItem(0x1B4, 4, "RomFS length [media units]", Header.RomFSLength, 3 - mod);
                f.AddListItem(0x1B8, 4, "RomFS hash region length [media units]", Header.RomFSHashRegionSize, 3 - mod);
                f.AddListItem(0x1BC, 4, "Reserved", Header.Unknown6, 3 - mod);
                f.AddListItem(0x1C0, 0x20, "ExeFS SuperBlock hash [SHA-256]", Header.ExeFSSuperBlockhash, 3 - mod);
                f.AddListItem(0x1E0, 0x20, "RomFS Superblock hash [SHA-256]", Header.RomFSSuperBlockhash, 3 - mod);
                break;

            case CXIView.NCCHPlainRegion:
                f.SetGroupHeaders("Plain Regions");
                for (var j = 0; j < PlainRegion.PlainRegionStrings.Length; j++)
                {
                    f.AddListItem(0, 4, PlainRegion.PlainRegionStrings[j], (ulong)PlainRegion.PlainRegionStrings[j].Length, 0);
                }
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #33
0
        public void View(frmExplorer f, int view, object[] values)
        {
            //var i = values != null ? (int)values[0] : -1;
            f.ClearInformation();
            switch ((CCIView)view)
            {
            case CCIView.NCSD:
                f.SetGroupHeaders(NcsdInfo.ncsd_type + " Info", "Signature", "NCSD Header", "Card Info Header", "Dev Card Info Header");

                // CCI Details
                f.AddListItem(string.Empty, string.Empty, "Media Type", NcsdInfo.MediaType, string.Empty, 0);

                /*if (NcsdInfo.HasWritableRegion)
                 * {
                 *  f.AddListItem(string.Empty, string.Empty, " > Writable Region Offset:", "0x" + NcsdInfo.WritableRegionAddress.ToString("X"), string.Empty, 0);
                 *  f.AddListItem(string.Empty, string.Empty, " > Writable Region Size:", "0x" + NcsdInfo.WritableRegionSize.ToString("X"), string.Empty, 0);
                 * }*/
                f.AddListItem(string.Empty, string.Empty, "Media Size", NcsdInfo.Media_Size_Str, NcsdInfo.Media_Size_Gbit.ToString("D") + " Gbit", 0);
                f.AddListItem(string.Empty, string.Empty, "CCI Data Size", NcsdInfo.CCI_Data_Size_Str, "0x" + NcsdInfo.CCI_Data_Size.ToString("X") + " Bytes", 0);
                f.AddListItem(string.Empty, string.Empty, "CCI File", string.Empty, string.Empty, 0);
                f.AddListItem(string.Empty, string.Empty, " > Size:", NcsdInfo.CCI_File_Size_Str, string.Empty, 0);
                f.AddListItem(string.Empty, string.Empty, " > Status:", NcsdInfo.CCI_File_Status_Str, string.Empty, 0);
                f.AddListItem(string.Empty, string.Empty, "Card Device", NcsdInfo.CardDevice, string.Empty, 0);
                f.AddListItem(string.Empty, string.Empty, "Save Crypto", NcsdInfo.SaveCrypto, string.Empty, 0);
                if (Header.CVerTitleVersion > 0)
                {
                    f.AddListItem(string.Empty, string.Empty, "Minimum 3DS Firmware", NcsdInfo.Min3DSFirm, string.Empty, 0);
                }

                // Signature
                f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCSD header [SHA-256]", Header.NCSDHeaderSignature, 1);

                // NCSD Header
                f.AddListItem(0x100, 4, "Magic (='NCSD')", Header.Magic, 2);
                f.AddListItem(0x104, 4, "NCSD length [media units]", Header.CCILength, 2);
                f.AddListItem(0x108, 8, "Main Title ID", Header.MainTitleID, 2);
                f.AddListItem(0x110, 8, "Partitions FS Type", Header.PartitionFStype, 2);
                f.AddListItem(0x118, 8, "Partitions Crypt Type", Header.PartitionCrypttype, 2);
                for (var i = 0; i < 8; i++)
                {
                    f.AddListItem(0x120 + i * 8, 4, "NCCH " + i + " offset [media units]", Header.CXIEntries[i].Offset, 2);
                    f.AddListItem(0x124 + i * 8, 4, "NCCH " + i + " length [media units]", Header.CXIEntries[i].Length, 2);
                }
                f.AddListItem(0x160, 0x20, "ExHeader Hash [SHA-256]", Header.ExHeaderHash, 2);
                f.AddListItem(0x180, 4, "Additional Header Size [media units]", Header.AdditionalHeaderSize, 2);
                f.AddListItem(0x184, 4, "Sector Zero Offset [media units]", Header.SectorZeroOffset, 2);
                f.AddListItem(0x188, 8, NcsdInfo.ncsd_type + " Flags", Header.Flags, 2);
                for (var i = 0; i < 8; i++)
                {
                    f.AddListItem(0x190 + i * 8, 8, "NCCH " + i + " Title ID", Header.NCCHTitleIDs[i].ID, 2);
                }
                f.AddListItem(0x1D0, 0x30, "Reserved", Header.Reserved_0, 2);


                // Card Info Header
                f.AddListItem(0x200, 4, "Writable Address [media units]", Header.WritableRegionAddress, 3);
                f.AddListItem(0x204, 4, "Card Info Bitmask", Header.CardInfoBitmask, 3);
                f.AddListItem(0x208, 248, "Reserved", Header.Reserved_1, 3);
                f.AddListItem(0x300, 4, "Used ROM length [bytes]", Header.UsedRomLength, 3);
                f.AddListItem(0x304, 28, "Reserved", Header.Reserved_2, 3);
                f.AddListItem(0x320, 8, "CVer Title ID", Header.CVerTitleId, 3);
                f.AddListItem(0x328, 2, "CVer Title Version", Header.CVerTitleVersion, 3);
                f.AddListItem(0x32B, 28, "Reserved", Header.Reserved_3, 3);
                f.AddListItem(0x1000, 8, "Media ID", Header.MediaID, 3);
                f.AddListItem(0x1008, 8, "Reserved", Header.Reserved_4, 3);
                f.AddListItem(0x1010, 0x30, "Initial Data", Header.InitialData, 3);
                f.AddListItem(0x1040, 0xC0, "Reserved", Header.Reserved_5, 3);
                // NCCH Header Duplicate of NCCH 0

                /*
                 * f.AddListItem(0x1100, 4, "Magic (='NCCH')", Header.cxi_Header.Magic, 3);
                 * f.AddListItem(0x1104, 4, "NCCH length [media units]", Header.cxi_Header.CXILength, 3);
                 * f.AddListItem(0x1108, 8, "Title ID", Header.cxi_Header.TitleID, 3);
                 * f.AddListItem(0x1110, 2, "Maker Code", Header.cxi_Header.MakerCode, 3);
                 * f.AddListItem(0x1112, 2, "NCCH Version", Header.cxi_Header.Version, 3);
                 * f.AddListItem(0x1118, 8, "Program ID", Header.cxi_Header.ProgramID, 3);
                 * f.AddListItem(0x1120, 0x10, "Reserved", Header.cxi_Header.Unknown0_0, 3);
                 * f.AddListItem(0x1130, 0x20, "Logo Region Hash", Header.cxi_Header.LogoRegionHash, 3);
                 * f.AddListItem(0x1150, 0x10, "Product Code", Header.cxi_Header.ProductCode, 3);
                 * f.AddListItem(0x1160, 0x20, "Extended Header Hash", Header.cxi_Header.ExtendedHeaderHash, 3);
                 * f.AddListItem(0x1180, 4, "Extended header size", Header.cxi_Header.ExtendedHeaderSize, 3);
                 * f.AddListItem(0x1184, 4, "Reserved", Header.cxi_Header.Unknown1, 3);
                 * f.AddListItem(0x1188, 8, "Flags", Header.cxi_Header.Flags, 3);
                 * f.AddListItem(0x1190, 4, "Plain region offset [media units]", Header.cxi_Header.PlainRegionOffset, 3);
                 * f.AddListItem(0x1194, 4, "Plain region length [media units]", Header.cxi_Header.PlainRegionSize, 3);
                 * f.AddListItem(0x1198, 4, "Logo region offset [media units]", Header.cxi_Header.LogoRegionOffset, 3);
                 * f.AddListItem(0x119C, 4, "Logo region length [media units]", Header.cxi_Header.LogoRegionLength, 3);
                 * f.AddListItem(0x11A0, 4, "ExeFS offset [media units]", Header.cxi_Header.ExeFSOffset, 3);
                 * f.AddListItem(0x11A4, 4, "ExeFS length [media units]", Header.cxi_Header.ExeFSLength, 3);
                 * f.AddListItem(0x11A8, 4, "ExeFS hash region length [media units]", Header.cxi_Header.ExeFSHashRegionSize, 3);
                 * f.AddListItem(0x11AC, 4, "Reserved", Header.cxi_Header.Unknown5, 3);
                 * f.AddListItem(0x11B0, 4, "RomFS offset [media units]", Header.cxi_Header.RomFSOffset, 3);
                 * f.AddListItem(0x11B4, 4, "RomFS length [media units]", Header.cxi_Header.RomFSLength, 3);
                 * f.AddListItem(0x11B8, 4, "RomFS hash region length [media units]", Header.cxi_Header.RomFSHashRegionSize, 3);
                 * f.AddListItem(0x11BC, 4, "Reserved", Header.cxi_Header.Unknown6, 3);
                 * f.AddListItem(0x11C0, 0x20, "ExeFS SuperBlock hash [SHA-256]", Header.cxi_Header.ExeFSSuperBlockhash, 3);
                 * f.AddListItem(0x11E0, 0x20, "RomFS SuperBlock hash [SHA-256]", Header.cxi_Header.RomFSSuperBlockhash, 3);
                 */
                // Dev Card Info Header
                if (Header.CardDeviceReserved1[0] != 0xff && Header.CardDeviceReserved1[10] != 0xff)
                {
                    f.AddListItem(0x1200, 0x200, "CardDeviceReserved1", Header.CardDeviceReserved1, 4);
                    f.AddListItem(0x1400, 0x10, "TitleKey", Header.TitleKey, 4);
                    f.AddListItem(0x1410, 0xf0, "CardDeviceReserved2", Header.CardDeviceReserved2, 4);
                }
                break;
            }
            f.AutoAlignColumns();
        }
Beispiel #34
0
        public void View(frmExplorer f, int view, object[] values)
        {
            //var i = values != null ? values[0] : -1;
            f.ClearInformation();
            switch ((CXIView)view)
            {
                case CXIView.NCCH:
                    int mod = 0;
                    if (!NcchInfo.IsCfa)
                    {
                        f.SetGroupHeaders("Title", NcchInfo.ncch_type + " Details", "Signature", "NCCH Header");
                        f.AddListItem(string.Empty, string.Empty, "Full Title (Name & Region)", string.Empty, TitleInfo.Title + " - " + TitleInfo.Region, 0);
                        f.AddListItem(string.Empty, string.Empty, "Title Type", string.Empty, TitleInfo.Type, 0);
                        f.AddListItem(string.Empty, string.Empty, "Publisher", string.Empty, TitleInfo.Developer, 0);
                    }
                    else
                    {
                        f.SetGroupHeaders(NcchInfo.ncch_type + " Details", "Signature", "NCCH Header");
                        mod = 1;
                    }

                    f.AddListItem(string.Empty, string.Empty, "Content Type", string.Empty, NcchInfo.content_type_str, 1-mod);
                    f.AddListItem(string.Empty, string.Empty, "Unique ID", string.Empty, "0x" + NcchInfo.UniqueID.ToString("X"), 1 - mod);
                    f.AddListItem(string.Empty, string.Empty, "Crypto Key", string.Empty, NcchInfo.encryption, 1 - mod);
                    f.AddListItem(string.Empty, string.Empty, NcchInfo.ncch_type + " Size", string.Empty, NcchInfo.ncch_size_str, 1 - mod);
                    if (!NcchInfo.IsCfa)
                    {
                        if (NcchInfo.sdk_build != null)
                        {
                            f.AddListItem(string.Empty, string.Empty, "Build Type", string.Empty, NcchInfo.sdk_build, 1);
                        }
                        if (NcchInfo.sdk_version != null)
                        {
                            f.AddListItem(string.Empty, string.Empty, "SDK Version", string.Empty, NcchInfo.sdk_version, 1);
                        }
                        if (NcchInfo.req_kernel != null)
                        {
                            f.AddListItem(string.Empty, string.Empty, "Required Kernel Version", string.Empty, NcchInfo.req_kernel, 1);
                        }
                    }

                    f.AddListItem(0x000, 0x100, "RSA-2048 signature of the NCCH header [SHA-256]", Header.NCCHHeaderSignature, 2-mod);

                    f.AddListItem(0x100, 4, "Magic (='NCCH')", Header.Magic, 3-mod);
                    f.AddListItem(0x104, 4, NcchInfo.ncch_type + " length [media units]", Header.CXILength, 3-mod);
                    f.AddListItem(0x108, 8, "Title ID", Header.TitleID, 3-mod);
                    f.AddListItem(0x110, 2, "Maker Code", Header.MakerCode, 3-mod);
                    f.AddListItem(0x112, 2, NcchInfo.ncch_type + " Version", Header.Version, 3-mod);
                    f.AddListItem(0x118, 8, "Program ID", Header.ProgramID, 3-mod);
                    f.AddListItem(0x120, 0x10, "Reserved", Header.Unknown0_0, 3-mod);
                    f.AddListItem(0x130, 0x20, "Logo Region Hash", Header.LogoRegionHash, 3-mod);
                    f.AddListItem(0x150, 0x10, "Product Code", Header.ProductCode, 3-mod);
                    f.AddListItem(0x160, 0x20, "Extended Header Hash", Header.ExtendedHeaderHash, 3-mod);
                    f.AddListItem(0x180, 4, "Extended header size", Header.ExtendedHeaderSize, 3-mod);
                    f.AddListItem(0x184, 4, "Reserved", Header.Unknown1, 3-mod);
                    f.AddListItem(0x188, 8, "Flags", Header.Flags, 3-mod);
                    f.AddListItem(0x190, 4, "Plain region offset [media units]", Header.PlainRegionOffset, 3-mod);
                    f.AddListItem(0x194, 4, "Plain region length [media units]", Header.PlainRegionSize, 3-mod);
                    f.AddListItem(0x198, 4, "Logo region offset [media units]", Header.LogoRegionOffset, 3-mod);
                    f.AddListItem(0x19C, 4, "Logo region length [media units]", Header.LogoRegionLength, 3-mod);
                    f.AddListItem(0x1A0, 4, "ExeFS offset [media units]", Header.ExeFSOffset, 3-mod);
                    f.AddListItem(0x1A4, 4, "ExeFS length [media units]", Header.ExeFSLength, 3-mod);
                    f.AddListItem(0x1A8, 4, "ExeFS hash region length [media units]", Header.ExeFSHashRegionSize, 3-mod);
                    f.AddListItem(0x1AC, 4, "Reserved", Header.Unknown5, 3-mod);
                    f.AddListItem(0x1B0, 4, "RomFS offset [media units]", Header.RomFSOffset, 3-mod);
                    f.AddListItem(0x1B4, 4, "RomFS length [media units]", Header.RomFSLength, 3-mod);
                    f.AddListItem(0x1B8, 4, "RomFS hash region length [media units]", Header.RomFSHashRegionSize, 3-mod);
                    f.AddListItem(0x1BC, 4, "Reserved", Header.Unknown6, 3-mod);
                    f.AddListItem(0x1C0, 0x20, "ExeFS SuperBlock hash [SHA-256]", Header.ExeFSSuperBlockhash, 3 - mod);
                    f.AddListItem(0x1E0, 0x20, "RomFS Superblock hash [SHA-256]", Header.RomFSSuperBlockhash, 3 - mod);
                    break;
                case CXIView.NCCHPlainRegion:
                    f.SetGroupHeaders("Plain Regions");
                    for (var j = 0; j < PlainRegion.PlainRegionStrings.Length; j++)
                        f.AddListItem(0, 4, PlainRegion.PlainRegionStrings[j], (ulong)PlainRegion.PlainRegionStrings[j].Length, 0);
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #35
0
 public void View(frmExplorer f, int view, object[] values)
 {
     f.ClearInformation();
     switch ((CWAVView)view)
     {
         case CWAVView.CWAV:
             f.SetGroupHeaders("CWAV","INFO","Channels", "DATA");
             f.AddListItem(0, 4, "Magic", Wave.Magic, 0);
             f.AddListItem(4, 2, "Endianess", Wave.Endianess, 0);
             f.AddListItem(6, 2, "Struct length", Wave.StructLength, 0);
             f.AddListItem(8, 4, "Unknown0", Wave.Unknown0, 0);
             f.AddListItem(0x0C, 4, "File Size", Wave.FileSize, 0);
             f.AddListItem(0x10, 4, "Number of chunks", Wave.NumOfChunks, 0);
             f.AddListItem(0x14, 4, "Info Chunk Flags", Wave.InfoChunkFlags, 0);
             f.AddListItem(0x18, 4, "Info Chunk Offset", Wave.InfoChunkOffset, 0);
             f.AddListItem(0x1C, 4, "Info Chunk Length", Wave.InfoChunkLength, 0);
             f.AddListItem(0x20, 4, "Data Chunk Flags", Wave.DataChunkFlags, 0);
             f.AddListItem(0x24, 4, "Data Chunk Offset", Wave.DataChunkOffset, 0);
             f.AddListItem(0x28, 4, "Data Chunk Length", Wave.DataChunkLength, 0);
             f.AddListItem(0x2C, 0x14, "Reserved", Wave.Reserved, 0);
             
             f.AddListItem(0, 4, "Magic", InfoBlob.Magic, 1);
             f.AddListItem(4, 4, "Info Data Length", InfoBlob.InfoDataLength, 1);
             f.AddListItem(8, 4, "Type", InfoBlob.Type, 1);
             f.AddListItem(12, 4, "Samples per second", InfoBlob.SampleRate, 1);
             f.AddListItem(16, 4, "Unknown 0", InfoBlob.Unknown0, 1);
             f.AddListItem(20, 4, "NumberOfSamples", InfoBlob.NumberOfSamples, 1);
             f.AddListItem(24, 4, "Unknown 2", InfoBlob.Unknown2, 1);
             f.AddListItem(28, 4, "Channels", InfoBlob.Channels, 1);
             for (var i = 0; i < ChannelDataPointers.Length; i++)
             {
                 f.AddListItem(0, 4, "Channel " + i + " Ptr Flags", ChannelDataPointers[i].Flags, 2);
                 f.AddListItem(0, 4, "Channel " + i + " Ptr Offset", ChannelDataPointers[i].Offset, 2);
                 f.AddListItem(0, 4, "Channel " + i + " Data Flags", ChannelDatas[i].Flags, 2);
                 f.AddListItem(0, 8, "Channel " + i + " Data Offset", ChannelDatas[i].Offset, 2);
                 f.AddListItem(0, 4, "Channel " + i + " Data FFs", ChannelDatas[i].FFs, 2);
                 f.AddListItem(0, 4, "Channel " + i + " Data Padding", ChannelDatas[i].Padding, 2);
             }
             f.AddListItem(0, 4, "Magic", DataBlob.Magic, 3);
             f.AddListItem(4, 4, "Length", DataBlob.Length, 3);
             break;
     }
     f.AutoAlignColumns();
 }
Beispiel #36
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((MPOView)view)
            {
                case MPOView.MPO:
                    break;
                case MPOView.Image:
                    
                    var propItems = (int)values[0] == 0 ? LeftImage.PropertyItems : RightImage.PropertyItems;

                    string tempString;
                    foreach (var propItem in propItems)
                    {
                        switch (propItem.Id)
                        {
                            case 0x1000:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "InteroperabilityVersion",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x010f:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "Manufacturer",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x0110:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "Camera",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x011a:
                                tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                                f.AddListItem(propItem.Id, 8, "XResolution",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x011b:
                                tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                                f.AddListItem(propItem.Id, 8, "YResolution",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x0128:
                                f.AddListItem(propItem.Id, 2, "ResolutionUnit", BitConverter.ToUInt16(propItem.Value, 0), 0);
                                break;
                            case 0x0131:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "Software",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x0132:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "DateTime",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x0201:
                                f.AddListItem(propItem.Id, 4, "JPEGInterchangeFormat", BitConverter.ToUInt32(propItem.Value, 0), 0);
                                break;
                            case 0x0202:
                                f.AddListItem(propItem.Id, 4, "JPEGInterchangeFormatLength", BitConverter.ToUInt32(propItem.Value, 0), 0);
                                break;
                            case 0x0213:
                                f.AddListItem(propItem.Id, 2, "YCbCrPositioning", BitConverter.ToUInt16(propItem.Value, 0), 0);
                                break;
                            case 0x501b:
                                f.AddListItem(propItem.Id, propItem.Value.Length, "ThumbnailData", propItem.Value, 0);
                                break;
                            case 0x5023:
                                f.AddListItem(propItem.Id, 2, "ThumbnailCompression", BitConverter.ToUInt16(propItem.Value, 0), 0);
                                break;
                            case 0x502d:
                                tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                                f.AddListItem(propItem.Id, 8, "ThumbnailXResolution",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x502e:
                                tempString = BitConverter.ToUInt32(propItem.Value, 0) + ":" + BitConverter.ToUInt32(propItem.Value, 4);
                                f.AddListItem(propItem.Id, 8, "ThumbnailYResolution",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x5030:
                                f.AddListItem(propItem.Id, 2, "ThumbnailTransferFunction", BitConverter.ToUInt16(propItem.Value, 0), 0);
                                break;
                            case 0x5041:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "InteroperabilityIndex",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x5042:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "ExifInteroperabilityVersion",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x5090:
                                f.AddListItem(propItem.Id, propItem.Value.Length, "LuminanceTable", propItem.Value, 0);
                                break;
                            case 0x5091:
                                f.AddListItem(propItem.Id, propItem.Value.Length, "ChrominanceTable", propItem.Value, 0);
                                break;
                            case 0x9000:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "ExifVersion",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x9003:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "DateTimeOriginal",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x9004:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "DateTimeDigitized",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0x9101:
                                f.AddListItem(propItem.Id, propItem.Value.Length, "ComponentsConfiguration", propItem.Value, 0);
                                break;
                            case 0x927c:
                                f.AddListItem(propItem.Id, propItem.Value.Length, "MakerNote", propItem.Value, 0);
                                break;
                            case 0xa000:
                                tempString = Encoding.UTF8.GetString(propItem.Value);
                                f.AddListItem(propItem.Id, tempString.Length, "FlashPixVersion",
                                              tempString.ToCharArray(), 0);
                                break;
                            case 0xa001:
                                f.AddListItem(propItem.Id, 2, "ColorSpace", BitConverter.ToUInt16(propItem.Value, 0), 0);
                                break;
                            case 0xa002:
                                f.AddListItem(propItem.Id, 4, "PixelXDimension", BitConverter.ToUInt32(propItem.Value, 0), 0);
                                break;
                            case 0xa003:
                                f.AddListItem(propItem.Id, 4, "PixelYDimension", BitConverter.ToUInt32(propItem.Value, 0), 0);
                                break;
                            default:
                                f.AddListItem(propItem.Id, propItem.Value.Length, "<Unknown>", propItem.Value, 0);
                                break;
                        }
                    }
                    break;
                case MPOView.MPOExtensions:
                    break;
                case MPOView.MakerNote:
                    f.SetGroupHeaders("IFD","First IFD","Nintendo MarkerNote");
                    if (_ifds != null)
                    {
                        f.AddListItem(0, 2, "IFD Count", (uint) _ifds.Length, 0);
                        for (var i = 0; i < _ifds.Length; i++)
                            f.AddListItem((2 + i*12).ToString(), "12", "IFD", "Tag = " + _ifds[i].Tag.ToString("X4"),
                                          string.Format("Type={0}, Count/Value={1}, Value/Offset={2}", _ifds[i].Type,
                                                        _ifds[i].CountValue, _ifds[i].ValueOffset), 0);

                        f.AddListItem(0, _firstIFDData.Length, "First IFD data", _firstIFDData, 1);
                    }
                    f.AddListItem(0, 4, "Magic", _nintendoNote.Magic, 2);
                    f.AddListItem(4, 4, "Type", _nintendoNote.Type, 2);
                    f.AddListItem(8, 4, "Time stamp", _nintendoNote.TimeStamp, 2);
                    f.AddListItem("","","","",(new DateTime(2000,1,1,0,0,0)).AddSeconds(_nintendoNote.TimeStamp).ToString(),2);
                    f.AddListItem(12, 4, "Padding 0", _nintendoNote.Padding0, 2);
                    f.AddListItem(16, 4, "Title ID Low", _nintendoNote.TitleIDLow, 2);
                    f.AddListItem(20, 4, "Flags", _nintendoNote.Flags, 2);
                    f.AddListItem(24, 4, "Console ID", _nintendoNote.ConsoleID, 2);
                    f.AddListItem(28, 12, "Padding 1", _nintendoNote.Padding1, 2);
                    f.AddListItem(40, 4, "Parallax", _nintendoNote.Parallax, 2);
                    f.AddListItem(44, 4, "Padding 2", _nintendoNote.Padding2, 2);
                    f.AddListItem(48, 2, "Categories", _nintendoNote.Categories, 2);
                    f.AddListItem(50, 2, "Filters", _nintendoNote.Filters, 2);
                    f.AddListItem(52, 12, "Padding 3", _nintendoNote.Padding3, 2);
                    break;
            }
            f.AutoAlignColumns();
        }
Beispiel #37
0
        public void View(frmExplorer f, int view, object[] values)
        {
            f.ClearInformation();
            switch ((CIAView)view)
            {
                case CIAView.CIA:
                    var cia = Header;
                    f.SetGroupHeaders("CIA", "CIA Offsets");
                    f.AddListItem(0, 8, "Padding Length", cia.PaddingLength, 0);
                    f.AddListItem(8, 4, "Certificate Chain Length", cia.CertificateChainLength, 0);
                    f.AddListItem(12, 4, "Ticket Length", cia.TicketLength, 0);
                    f.AddListItem(16, 4, "TMD Length", cia.TMDLength, 0);
                    f.AddListItem(20, 4, "Meta Length", cia.MetaLength, 0);
                    f.AddListItem(24, 8, "Content Length", cia.ContentLength, 0);

                    f.AddListItem(0, 8, "Certificate Chain Offset", (ulong)CertificateChainOffset, 1);
                    f.AddListItem(0, 8, "Ticket Offset", (ulong)TicketOffset, 1);
                    f.AddListItem(0, 8, "TMD Offset", (ulong)TMDOffset, 1);
                    f.AddListItem(0, 8, "Content Offset", (ulong)ContentOffset, 1);
                    f.AddListItem(0, 8, "Meta Offset", (ulong)MetaOffset, 1);
                    break;
                case CIAView.Meta:
                    CIAMetaHeaderEntry entry;
                    f.SetGroupHeaders("CXI Dependancy TitleID List","Core Version");
                    for (var i = 0; i < MetaHeaderEntries.Count; i++)
                    {
                        entry = (CIAMetaHeaderEntry)MetaHeaderEntries[i];
                        EndianSwapByteArray(entry.ID);
                        f.AddListItem(i, 8, "Module:", entry.ID, 0);
                    }
                    //f.AddListItem(i, 8, "Version:", entry.ID, 0);
                    break;
            }
            f.AutoAlignColumns();
        }