0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.HLE/Loaders/Executables/NsoExecutable.cs
Elise dc144d2e19
Use libhac for loading NSO and KIP (#1047)
* Use libhac for loading NSOs and KIPs

* Fix formatting

* Refactor KIP and NSO executables for libhac

* Fix up formatting

* Remove Ryujinx.HLE.Loaders.Compression

* Remove reference to Ryujinx.HLE.Loaders.Compression in NxStaticObject.cs

* Remove reference to Ryujinx.HLE.Loaders.Compression in KernelInitialProcess.cs

* Rename classes in Ryujinx.HLE.Loaders.Executables

* Fix space alignment

* Fix up formatting
2020-04-07 19:41:02 -03:00

28 lines
No EOL
815 B
C#

using LibHac;
using LibHac.Fs;
using System;
using System.IO;
namespace Ryujinx.HLE.Loaders.Executables
{
class NsoExecutable : Nso, IExecutable
{
public byte[] Text { get; }
public byte[] Ro { get; }
public byte[] Data { get; }
public int TextOffset => (int)Sections[0].MemoryOffset;
public int RoOffset => (int)Sections[1].MemoryOffset;
public int DataOffset => (int)Sections[2].MemoryOffset;
public int BssOffset => DataOffset + Data.Length;
public new int BssSize => (int)base.BssSize;
public NsoExecutable(IStorage inStorage) : base(inStorage)
{
Text = Sections[0].DecompressSection();
Ro = Sections[1].DecompressSection();
Data = Sections[2].DecompressSection();
}
}
}