KipExecutable.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using LibHac;
  2. using LibHac.Fs;
  3. using System.IO;
  4. namespace Ryujinx.HLE.Loaders.Executables
  5. {
  6. class KipExecutable : Kip, IExecutable
  7. {
  8. public byte[] Text { get; }
  9. public byte[] Ro { get; }
  10. public byte[] Data { get; }
  11. public int TextOffset => Header.Sections[0].OutOffset;
  12. public int RoOffset => Header.Sections[1].OutOffset;
  13. public int DataOffset => Header.Sections[2].OutOffset;
  14. public int BssOffset => Header.Sections[3].OutOffset;
  15. public int BssSize => Header.Sections[3].DecompressedSize;
  16. public int[] Capabilities { get; }
  17. public KipExecutable(IStorage inStorage) : base(inStorage)
  18. {
  19. Capabilities = new int[32];
  20. for (int index = 0; index < Capabilities.Length; index++)
  21. {
  22. Capabilities[index] = System.BitConverter.ToInt32(Header.Capabilities, index * 4);
  23. }
  24. Text = DecompressSection(0);
  25. Ro = DecompressSection(1);
  26. Data = DecompressSection(2);
  27. }
  28. }
  29. }