Example #1
0
        private void OpenVersionNca(NcaFile nca)
        {
            using IFileSystem fs = nca.data.OpenFileSystem(NcaSectionType.Data, IntegrityCheckLevel.ErrorOnInvalid);

            fs.OpenFile(out IFile version, new U8Span("/file"), OpenMode.Read).ThrowIfFailure();
            version.GetSize(out long readSize);
            rawVersion = new byte[readSize];
            version.Read(out long temp, 0, rawVersion);
        }
Example #2
0
 private void Indexer()
 {
     foreach (var file in Directory.EnumerateFiles(path, "*.nca").ToArray())
     {
         NcaFile ncaFile = new NcaFile();
         ncaFile.filename = file.Split(new char[] { '/', '\\' }).Last();
         ncaFile.path     = file;
         ncaFile.GenHash();
         ncaFile.AddNcaInfo();
         files.Add(ncaFile);
     }
 }
Example #3
0
        public NcaFile FindNca(string titleid, NcaContentType type)
        {
            string  titleID = titleid.ToUpper();
            NcaFile file    = files.Find(x => x.titleId == titleID && x.header.ContentType == type);

            if (file == null)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine($"Could not find specified Program Id ({titleID})");
                if (!Config.noExfat)
                {
                    Console.WriteLine("Consider trying out the '--no-exfat' option");
                }
                Console.WriteLine("Is your firmware dump valid?");
                Console.ResetColor();
                Environment.Exit(0);
            }
            return(file);
        }
 public VersionExtractor(NcaFile nca)
 {
     versionMetaNca = nca;
 }
Example #5
0
 public VersionExtractor(NcaFile nca)
 {
     this.OpenVersionNca(nca);
     this.Parse();
 }