Example #1
0
        // todo: Implement NcaReader and other Nca classes
        public Result Create(out IStorage storage, out NcaFsHeader fsHeader, Nca nca, int fsIndex, bool isCodeFs)
        {
            storage  = default;
            fsHeader = default;

            Result rc = OpenStorage(out IStorage storageTemp, nca, fsIndex);

            if (rc.IsFailure())
            {
                return(rc);
            }

            if (isCodeFs)
            {
                using (var codeFs = new PartitionFileSystemCore <StandardEntry>())
                {
                    rc = codeFs.Initialize(storageTemp);
                    if (rc.IsFailure())
                    {
                        return(rc);
                    }

                    rc = VerifyAcidSignature(codeFs, nca);
                    if (rc.IsFailure())
                    {
                        return(rc);
                    }
                }
            }

            storage  = storageTemp;
            fsHeader = nca.GetFsHeader(fsIndex);

            return(Result.Success);
        }
Example #2
0
        // todo: Implement NcaReader and other Nca classes
        public Result Create(out ReferenceCountedDisposable <IStorage> storage, out NcaFsHeader fsHeader, Nca nca,
                             int fsIndex, bool isCodeFs)
        {
            UnsafeHelpers.SkipParamInit(out storage, out fsHeader);

            Result rc = OpenStorage(out IStorage storageTemp, nca, fsIndex);

            if (rc.IsFailure())
            {
                return(rc);
            }

            if (isCodeFs)
            {
                using (var codeFs = new PartitionFileSystemCore <StandardEntry>())
                {
                    rc = codeFs.Initialize(storageTemp);
                    if (rc.IsFailure())
                    {
                        return(rc);
                    }

                    rc = VerifyAcidSignature(codeFs, nca);
                    if (rc.IsFailure())
                    {
                        return(rc);
                    }
                }
            }

            storage  = new ReferenceCountedDisposable <IStorage>(storageTemp);
            fsHeader = nca.GetFsHeader(fsIndex);

            return(Result.Success);
        }
        private void ProcessNsp(string nspPath)
        {
            FsClient.OpenFile(out FileHandle nspHandle, nspPath, OpenMode.Read).ThrowIfFailure();

            using (var nspStorage = new FileHandleStorage(nspHandle, true))
            {
                var pfs = new PartitionFileSystemCore <StandardEntry>();
                pfs.Initialize(nspStorage).ThrowIfFailure();

                ProcessNcaFs(pfs);
            }
        }
        public Result Create(out ReferenceCountedDisposable <IFileSystem> fileSystem, ReferenceCountedDisposable <IStorage> pFsStorage)
        {
            var partitionFs = new PartitionFileSystemCore <StandardEntry>();

            Result rc = partitionFs.Initialize(pFsStorage);

            if (rc.IsFailure())
            {
                UnsafeHelpers.SkipParamInit(out fileSystem);
                return(rc);
            }

            fileSystem = new ReferenceCountedDisposable <IFileSystem>(partitionFs);
            return(Result.Success);
        }
        public Result Create(out IFileSystem fileSystem, IStorage pFsStorage)
        {
            var partitionFs = new PartitionFileSystemCore <StandardEntry>();

            Result rc = partitionFs.Initialize(pFsStorage);

            if (rc.IsFailure())
            {
                UnsafeHelpers.SkipParamInit(out fileSystem);
                return(rc);
            }

            fileSystem = partitionFs;
            return(Result.Success);
        }
Example #6
0
        public Result Create(out IFileSystem fileSystem, IStorage pFsStorage)
        {
            var partitionFs = new PartitionFileSystemCore <StandardEntry>();

            Result rc = partitionFs.Initialize(pFsStorage);

            if (rc.IsFailure())
            {
                fileSystem = default;
                return(rc);
            }

            fileSystem = partitionFs;
            return(Result.Success);
        }