diff options
| author | Elise <elisezerotwo@gmail.com> | 2020-04-08 00:41:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-07 19:41:02 -0300 |
| commit | dc144d2e190e03729b16e402da9c36eec5aaf53f (patch) | |
| tree | 00728f4639cc9642c25031aff6ae9a6d465f4fe7 /Ryujinx.HLE/Loaders/Executables/NsoExecutable.cs | |
| parent | 468d8f841ffcbebf4130371eb64ab04165bce3e9 (diff) | |
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
Diffstat (limited to 'Ryujinx.HLE/Loaders/Executables/NsoExecutable.cs')
| -rw-r--r-- | Ryujinx.HLE/Loaders/Executables/NsoExecutable.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Ryujinx.HLE/Loaders/Executables/NsoExecutable.cs b/Ryujinx.HLE/Loaders/Executables/NsoExecutable.cs new file mode 100644 index 00000000..6050432d --- /dev/null +++ b/Ryujinx.HLE/Loaders/Executables/NsoExecutable.cs @@ -0,0 +1,28 @@ +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(); + } + } +}
\ No newline at end of file |
