示例#1
0
 public async Task Initialize(IReadOnlyBinaryDataAccessor data)
 {
     if (Header != null && Header.RomFsSize > 0)
     {
         if (Header.ExeFsOffset > 0 && Header.ExeFsSize > 0)
         {
             ExeFs = await ExeFs.Load(data.GetReadOnlyDataReference((long)Header.ExeFsOffset *MediaUnitSize, (long)Header.ExeFsSize *MediaUnitSize));
         }
         if (Header.RomFsOffset > 0 && Header.RomFsOffset > 0)
         {
             RomFs = await RomFs.Load(data.GetReadOnlyDataReference((long)Header.RomFsOffset *MediaUnitSize, (long)Header.RomFsSize *MediaUnitSize));
         }
         if (Header.ExHeaderSize > 0)
         {
             ExHeader = data.GetReadOnlyDataReference(0x200, Header.ExHeaderSize);
         }
     }
 }
示例#2
0
        public async Task Initialize(IReadOnlyBinaryDataAccessor data)
        {
            this.RawData = data;
            if (Header != null && Header.RomFsSize > 0)
            {
                if (Header.ExeFsOffset > 0 && Header.ExeFsSize > 0)
                {
                    ExeFs = await ExeFs.Load(data.Slice((long)Header.ExeFsOffset *MediaUnitSize, (long)Header.ExeFsSize *MediaUnitSize));
                }
                if (Header.RomFsOffset > 0 && Header.RomFsOffset > 0)
                {
                    RomFs = await RomFs.Load(data.Slice((long)Header.RomFsOffset *MediaUnitSize, (long)Header.RomFsSize *MediaUnitSize));
                }
                if (Header.ExHeaderSize > 0)
                {
                    ExHeader = await NcchExtendedHeader.Load(data.Slice(0x200, Header.ExHeaderSize));
                }

                PlainRegion = await data.ReadStringAsync(Header.PlainRegionOffset *MediaUnitSize, Header.PlainRegionSize *MediaUnitSize, Encoding.ASCII);

                Logo = await data.ReadArrayAsync(Header.LogoRegionOffset *MediaUnitSize, Header.LogoRegionSize *MediaUnitSize);
            }
        }