NsoExecutable.cs 815 B

12345678910111213141516171819202122232425262728
  1. using LibHac;
  2. using LibHac.Fs;
  3. using System;
  4. using System.IO;
  5. namespace Ryujinx.HLE.Loaders.Executables
  6. {
  7. class NsoExecutable : Nso, IExecutable
  8. {
  9. public byte[] Text { get; }
  10. public byte[] Ro { get; }
  11. public byte[] Data { get; }
  12. public int TextOffset => (int)Sections[0].MemoryOffset;
  13. public int RoOffset => (int)Sections[1].MemoryOffset;
  14. public int DataOffset => (int)Sections[2].MemoryOffset;
  15. public int BssOffset => DataOffset + Data.Length;
  16. public new int BssSize => (int)base.BssSize;
  17. public NsoExecutable(IStorage inStorage) : base(inStorage)
  18. {
  19. Text = Sections[0].DecompressSection();
  20. Ro = Sections[1].DecompressSection();
  21. Data = Sections[2].DecompressSection();
  22. }
  23. }
  24. }