diff options
| author | Ac_K <Acoustik666@gmail.com> | 2018-02-22 01:51:17 +0100 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-02-21 21:51:17 -0300 |
| commit | 224211367f52cf514f0608d69056e84a3ef37ff5 (patch) | |
| tree | 9c8658f1dd3224dc7d004075514a8cd566f69e34 /Ryujinx.Core/Loaders | |
| parent | b2f733da7839ff8ba7a70a529cb9eb3eea9f0af6 (diff) | |
Initiale hbmenu.nro support (#32)
* Initiale hbmenu.nro support
Implement missing SetScreenShotPermission object.
Implement missing IsCurrentProcessBeingDebugged in SVC.
Add a Extension variable to Executable.
Add basic support of hbmenu.nro.
* Homebrew.cs correction
Diffstat (limited to 'Ryujinx.Core/Loaders')
| -rw-r--r-- | Ryujinx.Core/Loaders/Executable.cs | 3 | ||||
| -rw-r--r-- | Ryujinx.Core/Loaders/Executables/IExecutable.cs | 8 | ||||
| -rw-r--r-- | Ryujinx.Core/Loaders/Executables/Nro.cs | 4 | ||||
| -rw-r--r-- | Ryujinx.Core/Loaders/Executables/Nso.cs | 4 |
4 files changed, 19 insertions, 0 deletions
diff --git a/Ryujinx.Core/Loaders/Executable.cs b/Ryujinx.Core/Loaders/Executable.cs index e2660838..25a62136 100644 --- a/Ryujinx.Core/Loaders/Executable.cs +++ b/Ryujinx.Core/Loaders/Executable.cs @@ -13,6 +13,7 @@ namespace Ryujinx.Core.Loaders public long ImageBase { get; private set; } public long ImageEnd { get; private set; } + public Extensions Extension { get; private set; } public Executable(IExecutable Exe, AMemory Memory, long ImageBase) { @@ -46,6 +47,8 @@ namespace Ryujinx.Core.Loaders long EhHdrEndOffset = Memory.ReadInt32(Mod0Offset + 0x14) + Mod0Offset; long ModObjOffset = Memory.ReadInt32(Mod0Offset + 0x18) + Mod0Offset; + Extension = Exe.Extension; + MapBss(BssStartOffset, BssEndOffset - BssStartOffset); ImageEnd = BssEndOffset; diff --git a/Ryujinx.Core/Loaders/Executables/IExecutable.cs b/Ryujinx.Core/Loaders/Executables/IExecutable.cs index 73787b1d..f6aa31ac 100644 --- a/Ryujinx.Core/Loaders/Executables/IExecutable.cs +++ b/Ryujinx.Core/Loaders/Executables/IExecutable.cs @@ -2,6 +2,12 @@ using System.Collections.ObjectModel; namespace Ryujinx.Core.Loaders.Executables { + public enum Extensions + { + NRO, + NSO + } + public interface IExecutable { ReadOnlyCollection<byte> Text { get; } @@ -13,5 +19,7 @@ namespace Ryujinx.Core.Loaders.Executables int ROOffset { get; } int DataOffset { get; } int BssSize { get; } + + Extensions Extension { get; } } }
\ No newline at end of file diff --git a/Ryujinx.Core/Loaders/Executables/Nro.cs b/Ryujinx.Core/Loaders/Executables/Nro.cs index 3cbc4c5d..7f492cc2 100644 --- a/Ryujinx.Core/Loaders/Executables/Nro.cs +++ b/Ryujinx.Core/Loaders/Executables/Nro.cs @@ -20,6 +20,8 @@ namespace Ryujinx.Core.Loaders.Executables public int DataOffset { get; private set; } public int BssSize { get; private set; } + public Extensions Extension { get; private set; } + public Nro(Stream Input) { BinaryReader Reader = new BinaryReader(Input); @@ -47,6 +49,8 @@ namespace Ryujinx.Core.Loaders.Executables this.DataOffset = DataOffset; this.BssSize = BssSize; + this.Extension = Extensions.NRO; + byte[] Read(long Position, int Size) { Input.Seek(Position, SeekOrigin.Begin); diff --git a/Ryujinx.Core/Loaders/Executables/Nso.cs b/Ryujinx.Core/Loaders/Executables/Nso.cs index 7b8bf253..63ae08ae 100644 --- a/Ryujinx.Core/Loaders/Executables/Nso.cs +++ b/Ryujinx.Core/Loaders/Executables/Nso.cs @@ -21,6 +21,8 @@ namespace Ryujinx.Core.Loaders.Executables public int DataOffset { get; private set; } public int BssSize { get; private set; } + public Extensions Extension { get; private set; } + [Flags] private enum NsoFlags { @@ -79,6 +81,8 @@ namespace Ryujinx.Core.Loaders.Executables this.DataOffset = DataMemOffset; this.BssSize = BssSize; + this.Extension = Extensions.NSO; + //Text segment Input.Seek(TextOffset, SeekOrigin.Begin); |
